mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-07 23:47:30 +00:00
This commit is contained in:
parent
fa1f5d2b72
commit
6833e03299
@ -2,7 +2,6 @@ package awais.instagrabber.fragments;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -57,7 +56,6 @@ public final class FollowViewerFragment extends Fragment implements SwipeRefresh
|
|||||||
private FollowAdapter adapter;
|
private FollowAdapter adapter;
|
||||||
private View.OnClickListener clickListener;
|
private View.OnClickListener clickListener;
|
||||||
private FragmentFollowersViewerBinding binding;
|
private FragmentFollowersViewerBinding binding;
|
||||||
private AsyncTask<Void, Void, FollowModel[]> currentlyExecuting;
|
|
||||||
private SwipeRefreshLayout root;
|
private SwipeRefreshLayout root;
|
||||||
private FriendshipService friendshipService;
|
private FriendshipService friendshipService;
|
||||||
private AppCompatActivity fragmentActivity;
|
private AppCompatActivity fragmentActivity;
|
||||||
|
@ -3,7 +3,6 @@ package awais.instagrabber.fragments;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
@ -95,7 +94,6 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
|||||||
private Hashtag hashtagModel = null;
|
private Hashtag hashtagModel = null;
|
||||||
private ActionMode actionMode;
|
private ActionMode actionMode;
|
||||||
private StoriesService storiesService;
|
private StoriesService storiesService;
|
||||||
private AsyncTask<?, ?, ?> currentlyExecuting;
|
|
||||||
private boolean isLoggedIn;
|
private boolean isLoggedIn;
|
||||||
private TagsService tagsService;
|
private TagsService tagsService;
|
||||||
private GraphQLService graphQLService;
|
private GraphQLService graphQLService;
|
||||||
|
@ -4,7 +4,6 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -90,7 +89,6 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||||||
private StoriesService storiesService;
|
private StoriesService storiesService;
|
||||||
private GraphQLService graphQLService;
|
private GraphQLService graphQLService;
|
||||||
private LocationService locationService;
|
private LocationService locationService;
|
||||||
private AsyncTask<?, ?, ?> currentlyExecuting;
|
|
||||||
private boolean isLoggedIn;
|
private boolean isLoggedIn;
|
||||||
private boolean storiesFetching;
|
private boolean storiesFetching;
|
||||||
private Set<Media> selectedFeedModels;
|
private Set<Media> selectedFeedModels;
|
||||||
@ -580,18 +578,6 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopCurrentExecutor() {
|
|
||||||
if (currentlyExecuting != null) {
|
|
||||||
try {
|
|
||||||
currentlyExecuting.cancel(true);
|
|
||||||
} catch (final Exception e) {
|
|
||||||
// if (logCollector != null) logCollector.appendException(
|
|
||||||
// e, LogCollector.LogFile.MAIN_HELPER, "stopCurrentExecutor");
|
|
||||||
Log.e(TAG, "", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setTitle() {
|
private void setTitle() {
|
||||||
final ActionBar actionBar = fragmentActivity.getSupportActionBar();
|
final ActionBar actionBar = fragmentActivity.getSupportActionBar();
|
||||||
if (actionBar != null && locationModel != null) {
|
if (actionBar != null && locationModel != null) {
|
||||||
|
@ -1328,95 +1328,6 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void sendText(final String text, final String itemId, final boolean delete) {
|
|
||||||
// DirectThreadBroadcaster.TextBroadcastOptions textOptions = null;
|
|
||||||
// DirectThreadBroadcaster.ReactionBroadcastOptions reactionOptions = null;
|
|
||||||
// if (text != null) {
|
|
||||||
// try {
|
|
||||||
// textOptions = new DirectThreadBroadcaster.TextBroadcastOptions(text);
|
|
||||||
// } catch (UnsupportedEncodingException e) {
|
|
||||||
// Log.e(TAG, "Error", e);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// reactionOptions = new DirectThreadBroadcaster.ReactionBroadcastOptions(itemId, delete);
|
|
||||||
// }
|
|
||||||
// broadcast(text != null ? textOptions : reactionOptions, result -> {
|
|
||||||
// final Context context = getContext();
|
|
||||||
// if (context == null) return;
|
|
||||||
// if (result == null || result.getResponseCode() != HttpURLConnection.HTTP_OK) {
|
|
||||||
// Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (text != null) {
|
|
||||||
// // binding.commentText.setText("");
|
|
||||||
// } else {
|
|
||||||
// // final View viewWithTag = binding.messageList.findViewWithTag(directItemModel);
|
|
||||||
// // if (viewWithTag != null) {
|
|
||||||
// // final ViewParent dim = viewWithTag.getParent();
|
|
||||||
// // if (dim instanceof View) {
|
|
||||||
// // final View dimView = (View) dim;
|
|
||||||
// // final View likedContainer = dimView.findViewById(R.id.liked_container);
|
|
||||||
// // if (likedContainer != null) {
|
|
||||||
// // likedContainer.setVisibility(delete ? View.GONE : View.VISIBLE);
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // directItemModel.setLiked();
|
|
||||||
// }
|
|
||||||
// context.sendBroadcast(new Intent(DMRefreshBroadcastReceiver.ACTION_REFRESH_DM));
|
|
||||||
// hasSentSomething = true;
|
|
||||||
// // new DirectMessageInboxThreadFetcher(threadId, UserInboxDirection.OLDER, null, fetchListener)
|
|
||||||
// // .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private void sendImage(final Uri imageUri) {
|
|
||||||
// final Context context = getContext();
|
|
||||||
// if (context == null) return;
|
|
||||||
// try (InputStream inputStream = context.getContentResolver().openInputStream(imageUri)) {
|
|
||||||
// final Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
|
|
||||||
// Toast.makeText(context, R.string.uploading, Toast.LENGTH_SHORT).show();
|
|
||||||
// // Upload Image
|
|
||||||
// final ImageUploader imageUploader = new ImageUploader();
|
|
||||||
// imageUploader.setOnTaskCompleteListener(response -> {
|
|
||||||
// if (response == null || response.getResponseCode() != HttpURLConnection.HTTP_OK) {
|
|
||||||
// Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
|
|
||||||
// if (response != null && response.getResponse() != null) {
|
|
||||||
// Log.e(TAG, response.getResponse().toString());
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// final JSONObject responseJson = response.getResponse();
|
|
||||||
// try {
|
|
||||||
// final String uploadId = responseJson.getString("upload_id");
|
|
||||||
// // Broadcast
|
|
||||||
// final DirectThreadBroadcaster.ImageBroadcastOptions options = new DirectThreadBroadcaster.ImageBroadcastOptions(true, uploadId);
|
|
||||||
// hasSentSomething = true;
|
|
||||||
// broadcast(options,
|
|
||||||
// broadcastResponse -> {
|
|
||||||
// // new DirectMessageInboxThreadFetcher(threadId, UserInboxDirection.OLDER, null, fetchListener)
|
|
||||||
// // .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
|
||||||
// });
|
|
||||||
// } catch (JSONException e) {
|
|
||||||
// Log.e(TAG, "Error parsing json response", e);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// final ImageUploadOptions options = ImageUploadOptions.builder(bitmap).build();
|
|
||||||
// imageUploader.execute(options);
|
|
||||||
// } catch (IOException e) {
|
|
||||||
// Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
|
|
||||||
// Log.e(TAG, "Error opening file", e);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// private void broadcast(final DirectThreadBroadcaster.BroadcastOptions broadcastOptions,
|
|
||||||
// final DirectThreadBroadcaster.OnBroadcastCompleteListener listener) {
|
|
||||||
// final DirectThreadBroadcaster broadcaster = new DirectThreadBroadcaster(threadId);
|
|
||||||
// broadcaster.setOnTaskCompleteListener(listener);
|
|
||||||
// broadcaster.execute(broadcastOptions);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private User getUser(final long userId) {
|
private User getUser(final long userId) {
|
||||||
for (final User user : users) {
|
for (final User user : users) {
|
||||||
@ -1426,58 +1337,6 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void searchUsername(final String text) {
|
|
||||||
// final Bundle bundle = new Bundle();
|
|
||||||
// bundle.putString("username", "@" + text);
|
|
||||||
// NavHostFragment.findNavController(this).navigate(R.id.action_global_profileFragment, bundle);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// class ThreadAction extends AsyncTask<String, Void, Void> {
|
|
||||||
// String action, argument;
|
|
||||||
//
|
|
||||||
// protected Void doInBackground(String... rawAction) {
|
|
||||||
// action = rawAction[0];
|
|
||||||
// argument = rawAction[1];
|
|
||||||
// final String url = "https://i.instagram.com/api/v1/direct_v2/threads/" + threadId + "/items/" + argument + "/" + action + "/";
|
|
||||||
// try {
|
|
||||||
// String urlParameters = "_csrftoken=" + COOKIE.split("csrftoken=")[1].split(";")[0]
|
|
||||||
// + "&_uuid=" + Utils.settingsHelper.getString(Constants.DEVICE_UUID);
|
|
||||||
// final HttpURLConnection urlConnection = (HttpURLConnection) new URL(url).openConnection();
|
|
||||||
// urlConnection.setRequestMethod("POST");
|
|
||||||
// urlConnection.setUseCaches(false);
|
|
||||||
// urlConnection.setRequestProperty("User-Agent", Constants.I_USER_AGENT);
|
|
||||||
// urlConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
|
||||||
// urlConnection.setRequestProperty("Content-Length", Integer.toString(urlParameters.getBytes().length));
|
|
||||||
// urlConnection.setDoOutput(true);
|
|
||||||
// DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream());
|
|
||||||
// wr.writeBytes(urlParameters);
|
|
||||||
// wr.flush();
|
|
||||||
// wr.close();
|
|
||||||
// urlConnection.connect();
|
|
||||||
// if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
|
|
||||||
// if (action.equals("delete")) {
|
|
||||||
// hasDeletedSomething = true;
|
|
||||||
// } else if (action.equals("seen")) {
|
|
||||||
// // context.sendBroadcast(new Intent(DMRefreshBroadcastReceiver.ACTION_REFRESH_DM));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// urlConnection.disconnect();
|
|
||||||
// } catch (Throwable ex) {
|
|
||||||
// Log.e("austin_debug", action + ": " + ex);
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// protected void onPostExecute(Void result) {
|
|
||||||
// if (hasDeletedSomething) {
|
|
||||||
// // directItemModel = null;
|
|
||||||
// // new DirectMessageInboxThreadFetcher(threadId, UserInboxDirection.OLDER, null, fetchListener)
|
|
||||||
// // .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void setupKbHeightProvider() {
|
private void setupKbHeightProvider() {
|
||||||
if (heightProvider != null) return;
|
if (heightProvider != null) return;
|
||||||
heightProvider = new HeightProvider(fragmentActivity).init().setHeightListener(height -> {
|
heightProvider = new HeightProvider(fragmentActivity).init().setHeightListener(height -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user