From 384c377129fd0527dd887386c901ec7457194949 Mon Sep 17 00:00:00 2001 From: Vavassor Date: Sat, 15 Jul 2017 03:10:55 -0400 Subject: [PATCH] Makes the toolbar shadow visible for pre-Lollipop android versions and fixes a crash when deleting a draft with no media attached. --- .../tusky/SavedTootActivity.java | 10 +- .../color/drawer_visibility_panel_item.xml | 5 - app/src/main/res/drawable/ic_mute_24dp.xml | 3 +- app/src/main/res/drawable/ic_unmute_24dp.xml | 3 +- app/src/main/res/layout/activity_about.xml | 124 ++++++++---------- .../main/res/layout/activity_account_list.xml | 25 ++-- app/src/main/res/layout/activity_compose.xml | 3 +- .../main/res/layout/activity_edit_profile.xml | 15 +-- .../main/res/layout/activity_favourites.xml | 29 ++-- app/src/main/res/layout/activity_report.xml | 21 +-- .../main/res/layout/activity_saved_toot.xml | 18 +-- app/src/main/res/layout/activity_search.xml | 65 ++++----- app/src/main/res/layout/activity_view_tag.xml | 22 +--- .../main/res/layout/activity_view_thread.xml | 24 ++-- .../main/res/layout/activity_view_video.xml | 1 - app/src/main/res/layout/toolbar_basic.xml | 20 +++ .../main/res/layout/toolbar_shadow_shim.xml | 13 ++ 17 files changed, 194 insertions(+), 207 deletions(-) delete mode 100644 app/src/main/res/color/drawer_visibility_panel_item.xml create mode 100644 app/src/main/res/layout/toolbar_basic.xml create mode 100644 app/src/main/res/layout/toolbar_shadow_shim.xml diff --git a/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java b/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java index d5551bf3..3e83074a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/SavedTootActivity.java @@ -131,10 +131,12 @@ public class SavedTootActivity extends BaseActivity implements SavedTootAdapter. // Delete any media files associated with the status. ArrayList uris = new Gson().fromJson(item.getUrls(), new TypeToken>() {}.getType()); - for (String uriString : uris) { - Uri uri = Uri.parse(uriString); - if (getContentResolver().delete(uri, null, null) == 0) { - Log.e(TAG, String.format("Did not delete file %s.", uriString)); + if (uris != null) { + for (String uriString : uris) { + Uri uri = Uri.parse(uriString); + if (getContentResolver().delete(uri, null, null) == 0) { + Log.e(TAG, String.format("Did not delete file %s.", uriString)); + } } } // update DB diff --git a/app/src/main/res/color/drawer_visibility_panel_item.xml b/app/src/main/res/color/drawer_visibility_panel_item.xml deleted file mode 100644 index 9849dfa9..00000000 --- a/app/src/main/res/color/drawer_visibility_panel_item.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_mute_24dp.xml b/app/src/main/res/drawable/ic_mute_24dp.xml index 801dc934..bcdbb5a6 100644 --- a/app/src/main/res/drawable/ic_mute_24dp.xml +++ b/app/src/main/res/drawable/ic_mute_24dp.xml @@ -1,5 +1,6 @@ + android:viewportWidth="35.43307" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true"> + android:viewportWidth="35.43307" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android" + android:autoMirrored="true"> - + + + android:layout_height="wrap_content" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + android:layout_height="wrap_content" + android:orientation="vertical" + android:gravity="center" + android:paddingTop="16dp" + android:paddingBottom="16dp"> - + - - - - - + android:paddingTop="8dp" + android:textIsSelectable="true" + android:textAppearance="@style/TextAppearance.AppCompat.Large" /> - + - + -