mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
parent
2e988b3ef3
commit
e02ef0aa09
@ -119,7 +119,9 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
|
||||
endCursor = model.getEndCursor();
|
||||
hasNextPage = model.hasNextPage();
|
||||
if (autoloadPosts && hasNextPage)
|
||||
currentlyExecuting = new PostsFetcher(main.profileModel.getId(), endCursor, this)
|
||||
currentlyExecuting = new PostsFetcher(
|
||||
main.profileModel != null ? main.profileModel.getId()
|
||||
: (main.hashtagModel != null ? main.userQuery : main.locationModel.getId()), endCursor, this)
|
||||
.setUsername((isLocation || isHashtag) ? null : main.profileModel.getUsername())
|
||||
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
else {
|
||||
@ -462,7 +464,8 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
|
||||
if ((!autoloadPosts || isHashtag) && hasNextPage) {
|
||||
main.mainBinding.profileView.swipeRefreshLayout.setRefreshing(true);
|
||||
stopCurrentExecutor();
|
||||
currentlyExecuting = new PostsFetcher((isHashtag || isLocation) ? main.userQuery : main.profileModel.getId(), endCursor, postsFetchListener)
|
||||
currentlyExecuting = new PostsFetcher(main.profileModel != null ? main.profileModel.getId()
|
||||
: (main.hashtagModel != null ? main.userQuery : main.locationModel.getId()), endCursor, postsFetchListener)
|
||||
.setUsername((isHashtag || isLocation) ? null : main.profileModel.getUsername())
|
||||
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
endCursor = null;
|
||||
|
@ -6,6 +6,7 @@ import android.graphics.Bitmap;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
@ -118,6 +119,7 @@ public final class Login extends BaseLanguageActivity implements View.OnClickLis
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
|
||||
CookieManager.getInstance().removeAllCookies(null);
|
||||
loginBinding.webView.loadUrl("https://instagram.com/");
|
||||
}
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ public final class SavedViewer extends BaseLanguageActivity implements SwipeRefr
|
||||
private final FetchListener<PostModel[]> postsFetchListener = new FetchListener<PostModel[]>() {
|
||||
@Override
|
||||
public void onResult(final PostModel[] result) {
|
||||
final int oldSize = allItems.size();
|
||||
if (result != null) {
|
||||
final int oldSize = allItems.size();
|
||||
allItems.addAll(Arrays.asList(result));
|
||||
|
||||
postsAdapter.notifyItemRangeInserted(oldSize, result.length);
|
||||
@ -88,8 +88,10 @@ public final class SavedViewer extends BaseLanguageActivity implements SwipeRefr
|
||||
}
|
||||
else {
|
||||
savedBinding.swipeRefreshLayout.setRefreshing(false);
|
||||
Toast.makeText(getApplicationContext(), R.string.empty_list, Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
if (oldSize == 0) {
|
||||
Toast.makeText(getApplicationContext(), R.string.empty_list, Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -39,6 +39,7 @@ import static awais.instagrabber.utils.Constants.APP_THEME;
|
||||
import static awais.instagrabber.utils.Constants.AUTOLOAD_POSTS;
|
||||
import static awais.instagrabber.utils.Constants.AUTOPLAY_VIDEOS;
|
||||
import static awais.instagrabber.utils.Constants.BOTTOM_TOOLBAR;
|
||||
import static awais.instagrabber.utils.Constants.COOKIE;
|
||||
import static awais.instagrabber.utils.Constants.DOWNLOAD_USER_FOLDER;
|
||||
import static awais.instagrabber.utils.Constants.FOLDER_PATH;
|
||||
import static awais.instagrabber.utils.Constants.FOLDER_SAVE_TO;
|
||||
@ -57,6 +58,7 @@ public final class SettingsDialog extends BottomSheetDialogFragment implements V
|
||||
private Spinner spAppTheme, spLanguage;
|
||||
private boolean somethingChanged = false;
|
||||
private int currentTheme, currentLanguage, selectedLanguage;
|
||||
private String currentCookie;
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(final int requestCode, @NonNull final String[] permissions, @NonNull final int[] grantResults) {
|
||||
@ -121,6 +123,8 @@ public final class SettingsDialog extends BottomSheetDialogFragment implements V
|
||||
spLanguage.setSelection(currentLanguage);
|
||||
spLanguage.setOnItemSelectedListener(this);
|
||||
|
||||
currentCookie = settingsHelper.getString(COOKIE);
|
||||
|
||||
final AppCompatCheckBox cbSaveTo = contentView.findViewById(R.id.cbSaveTo);
|
||||
final AppCompatCheckBox cbMuteVideos = contentView.findViewById(R.id.cbMuteVideos);
|
||||
final AppCompatCheckBox cbBottomToolbar = contentView.findViewById(R.id.cbBottomToolbar);
|
||||
|
Loading…
Reference in New Issue
Block a user