diff --git a/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java b/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java index 5c376373..94e02720 100644 --- a/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java @@ -82,7 +82,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe private FragmentHashtagBinding binding; private MotionLayout root; private boolean shouldRefresh = true; - private boolean hasStories = false; +// private boolean hasStories = false; private boolean opening = false; private String hashtag; private Hashtag hashtagModel = null; @@ -309,7 +309,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe @Override public void onRefresh() { binding.posts.refresh(); - fetchStories(); +// fetchStories(); } @Override @@ -385,7 +385,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe } setTitle(); setupPosts(); - fetchStories(); +// fetchStories(); if (isLoggedIn) { hashtagDetailsBinding.btnFollowTag.setVisibility(View.VISIBLE); hashtagDetailsBinding.btnFollowTag.setText(hashtagModel.getFollowing() == FollowingType.FOLLOWING @@ -528,13 +528,13 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe span.setSpan(new StyleSpan(Typeface.BOLD), 0, postCount.length(), 0); hashtagDetailsBinding.mainTagPostCount.setText(span); hashtagDetailsBinding.mainTagPostCount.setVisibility(View.VISIBLE); - hashtagDetailsBinding.mainHashtagImage.setOnClickListener(v -> { - if (!hasStories) return; - // show stories - final NavDirections action = HashTagFragmentDirections - .actionHashtagFragmentToStoryViewerFragment(StoryViewerOptions.forHashtag(hashtagModel.getName())); - NavHostFragment.findNavController(this).navigate(action); - }); +// hashtagDetailsBinding.mainHashtagImage.setOnClickListener(v -> { +// if (!hasStories) return; +// // show stories +// final NavDirections action = HashTagFragmentDirections +// .actionHashtagFragmentToStoryViewerFragment(StoryViewerOptions.forHashtag(hashtagModel.getName())); +// NavHostFragment.findNavController(this).navigate(action); +// }); } private void showSnackbar(final String message) { @@ -545,27 +545,27 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe .show(); } - private void fetchStories() { - if (!isLoggedIn) return; - storiesFetching = true; - storiesRepository.getUserStory( - StoryViewerOptions.forHashtag(hashtagModel.getName()), - CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> { - if (throwable != null) { - Log.e(TAG, "Error", throwable); - storiesFetching = false; - return; - } - if (storyModels != null && !storyModels.isEmpty()) { - hashtagDetailsBinding.mainHashtagImage.setStoriesBorder(1); - hasStories = true; - } else { - hasStories = false; - } - storiesFetching = false; - }), Dispatchers.getIO()) - ); - } +// private void fetchStories() { +// if (!isLoggedIn) return; +// storiesFetching = true; +// storiesRepository.getUserStory( +// StoryViewerOptions.forHashtag(hashtagModel.getName()), +// CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> { +// if (throwable != null) { +// Log.e(TAG, "Error", throwable); +// storiesFetching = false; +// return; +// } +// if (storyModels != null && !storyModels.isEmpty()) { +// hashtagDetailsBinding.mainHashtagImage.setStoriesBorder(1); +// hasStories = true; +// } else { +// hasStories = false; +// } +// storiesFetching = false; +// }), Dispatchers.getIO()) +// ); +// } private void setTitle() { final ActionBar actionBar = fragmentActivity.getSupportActionBar(); diff --git a/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java b/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java index 21408afd..3ee581d4 100644 --- a/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/LocationFragment.java @@ -76,7 +76,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR private FragmentLocationBinding binding; private MotionLayout root; private boolean shouldRefresh = true; - private boolean hasStories = false; +// private boolean hasStories = false; private boolean opening = false; private long locationId; private Location locationModel; @@ -305,7 +305,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR @Override public void onRefresh() { binding.posts.refresh(); - fetchStories(); +// fetchStories(); } @Override @@ -386,7 +386,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR } setTitle(); setupPosts(); - fetchStories(); +// fetchStories(); final long locationId = locationModel.getPk(); // binding.swipeRefreshLayout.setRefreshing(true); locationDetailsBinding.mainLocationImage.setImageURI("res:/" + R.drawable.ic_location); @@ -531,14 +531,14 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR ); }), Dispatchers.getIO()) )); - locationDetailsBinding.mainLocationImage.setOnClickListener(v -> { - if (hasStories) { - // show stories - final NavDirections action = LocationFragmentDirections - .actionLocationFragmentToStoryViewerFragment(StoryViewerOptions.forLocation(locationId, locationModel.getName())); - NavHostFragment.findNavController(this).navigate(action); - } - }); +// locationDetailsBinding.mainLocationImage.setOnClickListener(v -> { +// if (hasStories) { +// // show stories +// final NavDirections action = LocationFragmentDirections +// .actionLocationFragmentToStoryViewerFragment(StoryViewerOptions.forLocation(locationId, locationModel.getName())); +// NavHostFragment.findNavController(this).navigate(action); +// } +// }); } private void showSnackbar(final String message) { @@ -549,26 +549,26 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR .show(); } - private void fetchStories() { - if (isLoggedIn) { - storiesFetching = true; - storiesRepository.getUserStory( - StoryViewerOptions.forLocation(locationId, locationModel.getName()), - CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> { - if (throwable != null) { - Log.e(TAG, "Error", throwable); - storiesFetching = false; - return; - } - if (storyModels != null && !storyModels.isEmpty()) { - locationDetailsBinding.mainLocationImage.setStoriesBorder(1); - hasStories = true; - } - storiesFetching = false; - }), Dispatchers.getIO()) - ); - } - } +// private void fetchStories() { +// if (isLoggedIn) { +// storiesFetching = true; +// storiesRepository.getUserStory( +// StoryViewerOptions.forLocation(locationId, locationModel.getName()), +// CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> { +// if (throwable != null) { +// Log.e(TAG, "Error", throwable); +// storiesFetching = false; +// return; +// } +// if (storyModels != null && !storyModels.isEmpty()) { +// locationDetailsBinding.mainLocationImage.setStoriesBorder(1); +// hasStories = true; +// } +// storiesFetching = false; +// }), Dispatchers.getIO()) +// ); +// } +// } private void setTitle() { final ActionBar actionBar = fragmentActivity.getSupportActionBar();