Bladeren bron

fix compilation: use app:tint, escape % in formatted string value + update possibly untested change in SendMail class + remove unused import + update gitignore + add .classpath

Noah Vogt 2 jaren geleden
bovenliggende
commit
6c6cbd7fd6

+ 4 - 0
.classpath

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="lib" path="."/>
+</classpath>

+ 1 - 0
.gitignore

@@ -21,3 +21,4 @@ app/release/
 .settings/
 app/.classpath
 app/schemas/
+app/bin/

+ 1 - 2
app/src/main/java/com/noahvogt/snailmail/MainActivity.java

@@ -10,7 +10,6 @@ import android.view.MenuItem;
 import android.view.View;
 import android.widget.Button;
 
-import androidx.appcompat.app.AlertDialog;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.appcompat.widget.Toolbar;
 import androidx.drawerlayout.widget.DrawerLayout;
@@ -189,4 +188,4 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
         DrawerFunctions drawerFunctions = new DrawerFunctions();
         return drawerFunctions.handleMasterDotsMenu(item, MainActivity.this, getLayoutInflater());
     }
-}
+}

+ 6 - 3
app/src/main/java/com/noahvogt/snailmail/mail/SendMail.java

@@ -38,14 +38,17 @@ public class SendMail {
             message.setSubject(subject);
             message.setText(messageBody);
         } catch (MessagingException e) {
+            e.printStackTrace();
             System.out.println("Error while parsing message");
         }
     }
 
     public static void addRecipientsOfCertainTypeSuccess(Message.RecipientType recipientType, String recipients) throws MessagingException {
-        String[] recipientsArray = recipients.split(",");
-        for (String recipient: recipientsArray)
-            message.addRecipient(recipientType, new InternetAddress(recipient));
+        if (!recipients.isEmpty()) {
+            String[] recipientsArray = recipients.split(",");
+            for (String recipient : recipientsArray)
+                message.addRecipient(recipientType, new InternetAddress(recipient));
+        }
     }
 
     public static void setupProperties(String smtpHostname, int smtpPort) {

+ 4 - 4
app/src/main/res/layout/editor_fragment.xml

@@ -61,7 +61,7 @@
                 android:background="?attr/selectableItemBackgroundBorderless"
                 android:padding="8dp"
                 android:src="@drawable/ic_baseline_attachment_24"
-                android:tint="@android:color/white" />
+                app:tint="@android:color/white" />
 
             <ImageButton
                 android:id="@+id/create_message_dots_button"
@@ -79,7 +79,7 @@
                 android:background="?attr/selectableItemBackgroundBorderless"
                 android:padding="8dp"
                 android:src="@drawable/ic_round_pending_24"
-                android:tint="@android:color/white" />
+                app:tint="@android:color/white" />
 
             <ImageButton
                 android:id="@+id/create_message_send_button"
@@ -94,7 +94,7 @@
                 android:padding="8dp"
                 android:src="@drawable/ic_baseline_arrow_forward_ios_24"
                 android:textColor="@android:color/white"
-                android:tint="@color/white" />
+                app:tint="@color/white" />
 
         </RelativeLayout>
     </androidx.cardview.widget.CardView>
@@ -255,4 +255,4 @@
 
     </ScrollView>
 
-</LinearLayout>
+</LinearLayout>

+ 4 - 4
app/src/main/res/layout/reader_fragment.xml

@@ -29,7 +29,7 @@
                 android:layout_marginStart="0dp"
                 android:background="?attr/selectableItemBackgroundBorderless"
                 android:padding="8dp"
-                android:tint="@android:color/white"
+                app:tint="@android:color/white"
                 android:src="@drawable/ic_baseline_close_24" />
 
             <ImageButton
@@ -41,7 +41,7 @@
                 android:layout_marginLeft="320dp"
                 android:background="?attr/selectableItemBackgroundBorderless"
                 android:padding="8dp"
-                android:tint="@android:color/white"
+                app:tint="@android:color/white"
                 android:src="@drawable/ic_round_pending_24" />
 
             <ImageButton
@@ -56,7 +56,7 @@
                 android:layout_toRightOf="@id/show_message_dots_button"
                 android:background="?attr/selectableItemBackgroundBorderless"
                 android:padding="8dp"
-                android:tint="@android:color/white"
+                app:tint="@android:color/white"
                 android:src="@drawable/ic_baseline_attachment_24" />
 
 
@@ -311,4 +311,4 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
 
-</LinearLayout>
+</LinearLayout>

+ 2 - 2
app/src/main/res/values/stringsSettings.xml

@@ -17,7 +17,7 @@
     <string name="pref_uploads">pref_uploads</string>
     <string name="specify_network_prefs">Specify network preferences for uploads</string>
     <string name="prefs_restricted_mode">prefs_restricted_mode</string>
-    <string name="restricated_mode">Restricted Mode can help to hide videos with potentially mature content.No filter is 100% accurate, but it should help you to avoid most of this type of content.</string>
+    <string name="restricated_mode">Restricted Mode can help to hide videos with potentially mature content.No filter is 100%% accurate, but it should help you to avoid most of this type of content.</string>
     <string name="restricated_mode_description">Restricted Mode</string>
     <string name="prefs_enable_stats">prefs_enable_stats</string>
     <string name="enable_stats">Enable stats for nerds</string>
@@ -61,4 +61,4 @@
     </string-array>
 
 
-</resources>
+</resources>