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