From fb8691132430fe186c9313fb0f308f3374561c2a Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Mon, 7 Sep 2020 13:08:28 -0400 Subject: [PATCH] beta release preparation + some toasts --- app/build.gradle | 6 +++--- .../main/java/awais/instagrabber/asyncs/DownloadAsync.java | 2 +- .../awais/instagrabber/fragments/SavedViewerFragment.java | 7 ++++++- app/src/main/res/values/strings.xml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ffd17758..71346386 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,13 +5,13 @@ android { compileSdkVersion 29 defaultConfig { - applicationId 'me.austinhuang.instagrabber' + applicationId 'me.austinhuang.instagrabbr' minSdkVersion 16 targetSdkVersion 29 - versionCode 48 - versionName '18.2' + versionCode 49 + versionName '19.0-a1' multiDexEnabled true diff --git a/app/src/main/java/awais/instagrabber/asyncs/DownloadAsync.java b/app/src/main/java/awais/instagrabber/asyncs/DownloadAsync.java index 3bb32a43..a5d47e6f 100755 --- a/app/src/main/java/awais/instagrabber/asyncs/DownloadAsync.java +++ b/app/src/main/java/awais/instagrabber/asyncs/DownloadAsync.java @@ -188,7 +188,7 @@ public final class DownloadAsync extends AsyncTask { MediaScannerConnection.scanFile(context, new String[]{result.getAbsolutePath()}, null, null); if (notificationManager != null) { - final Uri uri = FileProvider.getUriForFile(context, "me.austinhuang.instagrabber.provider", result); + final Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", result); final ContentResolver contentResolver = context.getContentResolver(); Bitmap bitmap = null; diff --git a/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java b/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java index 58064b00..9af8c42f 100644 --- a/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java @@ -10,6 +10,7 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; +import android.widget.Toast; import androidx.activity.OnBackPressedCallback; import androidx.activity.OnBackPressedDispatcher; @@ -104,8 +105,8 @@ public final class SavedViewerFragment extends Fragment implements SwipeRefreshL private final FetchListener postsFetchListener = new FetchListener() { @Override public void onResult(final PostModel[] result) { + final List current = postsViewModel.getList().getValue(); if (result != null) { - final List current = postsViewModel.getList().getValue(); final List resultList = Arrays.asList(result); if (current == null) { postsViewModel.getList().postValue(resultList); @@ -131,6 +132,10 @@ public final class SavedViewerFragment extends Fragment implements SwipeRefreshL model.setPageCursor(false, null); } } + else if (current == null) { + Toast.makeText(requireContext(), R.string.empty_list, Toast.LENGTH_SHORT).show(); + NavHostFragment.findNavController(SavedViewerFragment.this).popBackStack(); + } binding.swipeRefreshLayout.setRefreshing(false); } }; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c8ac487b..641cd5f1 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,6 @@ - InstaGrabber + InstaGrabber alpha The original maintainer, AWAiS, made InstaGrabber as a small and basic little personal app with intentions of [steali-]downloading posts off Instagram. Very unfortunately, this was abandoned and me, Austin Huang, took over the ship. [Let\'s hope that\'s at least a lil\' bit cash money.] After all, this app is fully open source, ad-less, and tracking-less [aside from what Instagram knows]. Even if you don\'t care about downloading stuff [like me], it\'s still a great Instagram client to use!\n\nGot questions [or just wanna talk]? Contact instagrabber@austinhuang.me or click one of the buttons below. Quick Access About