1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-03-05 20:11:36 +00:00

beta release preparation + some toasts

This commit is contained in:
Austin Huang 2020-09-07 13:08:28 -04:00
parent ccfaa1c397
commit fb86911324
No known key found for this signature in database
GPG key ID: 84C23AA04587A91F
4 changed files with 11 additions and 6 deletions

View file

@ -188,7 +188,7 @@ public final class DownloadAsync extends AsyncTask<Void, Float, File> {
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;

View file

@ -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<PostModel[]> postsFetchListener = new FetchListener<PostModel[]>() {
@Override
public void onResult(final PostModel[] result) {
final List<PostModel> current = postsViewModel.getList().getValue();
if (result != null) {
final List<PostModel> current = postsViewModel.getList().getValue();
final List<PostModel> 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);
}
};