remove hashtag and location stories

r/instagram said they were removed during the us election and never came back
This commit is contained in:
Austin Huang 2021-06-29 11:42:43 -04:00
parent c326356acc
commit 9e711638c4
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with 62 additions and 62 deletions

View File

@ -82,7 +82,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
private FragmentHashtagBinding binding; private FragmentHashtagBinding binding;
private MotionLayout root; private MotionLayout root;
private boolean shouldRefresh = true; private boolean shouldRefresh = true;
private boolean hasStories = false; // private boolean hasStories = false;
private boolean opening = false; private boolean opening = false;
private String hashtag; private String hashtag;
private Hashtag hashtagModel = null; private Hashtag hashtagModel = null;
@ -309,7 +309,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
@Override @Override
public void onRefresh() { public void onRefresh() {
binding.posts.refresh(); binding.posts.refresh();
fetchStories(); // fetchStories();
} }
@Override @Override
@ -385,7 +385,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
} }
setTitle(); setTitle();
setupPosts(); setupPosts();
fetchStories(); // fetchStories();
if (isLoggedIn) { if (isLoggedIn) {
hashtagDetailsBinding.btnFollowTag.setVisibility(View.VISIBLE); hashtagDetailsBinding.btnFollowTag.setVisibility(View.VISIBLE);
hashtagDetailsBinding.btnFollowTag.setText(hashtagModel.getFollowing() == FollowingType.FOLLOWING 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); span.setSpan(new StyleSpan(Typeface.BOLD), 0, postCount.length(), 0);
hashtagDetailsBinding.mainTagPostCount.setText(span); hashtagDetailsBinding.mainTagPostCount.setText(span);
hashtagDetailsBinding.mainTagPostCount.setVisibility(View.VISIBLE); hashtagDetailsBinding.mainTagPostCount.setVisibility(View.VISIBLE);
hashtagDetailsBinding.mainHashtagImage.setOnClickListener(v -> { // hashtagDetailsBinding.mainHashtagImage.setOnClickListener(v -> {
if (!hasStories) return; // if (!hasStories) return;
// show stories // // show stories
final NavDirections action = HashTagFragmentDirections // final NavDirections action = HashTagFragmentDirections
.actionHashtagFragmentToStoryViewerFragment(StoryViewerOptions.forHashtag(hashtagModel.getName())); // .actionHashtagFragmentToStoryViewerFragment(StoryViewerOptions.forHashtag(hashtagModel.getName()));
NavHostFragment.findNavController(this).navigate(action); // NavHostFragment.findNavController(this).navigate(action);
}); // });
} }
private void showSnackbar(final String message) { private void showSnackbar(final String message) {
@ -545,27 +545,27 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
.show(); .show();
} }
private void fetchStories() { // private void fetchStories() {
if (!isLoggedIn) return; // if (!isLoggedIn) return;
storiesFetching = true; // storiesFetching = true;
storiesRepository.getUserStory( // storiesRepository.getUserStory(
StoryViewerOptions.forHashtag(hashtagModel.getName()), // StoryViewerOptions.forHashtag(hashtagModel.getName()),
CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> { // CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> {
if (throwable != null) { // if (throwable != null) {
Log.e(TAG, "Error", throwable); // Log.e(TAG, "Error", throwable);
storiesFetching = false; // storiesFetching = false;
return; // return;
} // }
if (storyModels != null && !storyModels.isEmpty()) { // if (storyModels != null && !storyModels.isEmpty()) {
hashtagDetailsBinding.mainHashtagImage.setStoriesBorder(1); // hashtagDetailsBinding.mainHashtagImage.setStoriesBorder(1);
hasStories = true; // hasStories = true;
} else { // } else {
hasStories = false; // hasStories = false;
} // }
storiesFetching = false; // storiesFetching = false;
}), Dispatchers.getIO()) // }), Dispatchers.getIO())
); // );
} // }
private void setTitle() { private void setTitle() {
final ActionBar actionBar = fragmentActivity.getSupportActionBar(); final ActionBar actionBar = fragmentActivity.getSupportActionBar();

View File

@ -76,7 +76,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
private FragmentLocationBinding binding; private FragmentLocationBinding binding;
private MotionLayout root; private MotionLayout root;
private boolean shouldRefresh = true; private boolean shouldRefresh = true;
private boolean hasStories = false; // private boolean hasStories = false;
private boolean opening = false; private boolean opening = false;
private long locationId; private long locationId;
private Location locationModel; private Location locationModel;
@ -305,7 +305,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
@Override @Override
public void onRefresh() { public void onRefresh() {
binding.posts.refresh(); binding.posts.refresh();
fetchStories(); // fetchStories();
} }
@Override @Override
@ -386,7 +386,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
} }
setTitle(); setTitle();
setupPosts(); setupPosts();
fetchStories(); // fetchStories();
final long locationId = locationModel.getPk(); final long locationId = locationModel.getPk();
// binding.swipeRefreshLayout.setRefreshing(true); // binding.swipeRefreshLayout.setRefreshing(true);
locationDetailsBinding.mainLocationImage.setImageURI("res:/" + R.drawable.ic_location); locationDetailsBinding.mainLocationImage.setImageURI("res:/" + R.drawable.ic_location);
@ -531,14 +531,14 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
); );
}), Dispatchers.getIO()) }), Dispatchers.getIO())
)); ));
locationDetailsBinding.mainLocationImage.setOnClickListener(v -> { // locationDetailsBinding.mainLocationImage.setOnClickListener(v -> {
if (hasStories) { // if (hasStories) {
// show stories // // show stories
final NavDirections action = LocationFragmentDirections // final NavDirections action = LocationFragmentDirections
.actionLocationFragmentToStoryViewerFragment(StoryViewerOptions.forLocation(locationId, locationModel.getName())); // .actionLocationFragmentToStoryViewerFragment(StoryViewerOptions.forLocation(locationId, locationModel.getName()));
NavHostFragment.findNavController(this).navigate(action); // NavHostFragment.findNavController(this).navigate(action);
} // }
}); // });
} }
private void showSnackbar(final String message) { private void showSnackbar(final String message) {
@ -549,26 +549,26 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
.show(); .show();
} }
private void fetchStories() { // private void fetchStories() {
if (isLoggedIn) { // if (isLoggedIn) {
storiesFetching = true; // storiesFetching = true;
storiesRepository.getUserStory( // storiesRepository.getUserStory(
StoryViewerOptions.forLocation(locationId, locationModel.getName()), // StoryViewerOptions.forLocation(locationId, locationModel.getName()),
CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> { // CoroutineUtilsKt.getContinuation((storyModels, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> {
if (throwable != null) { // if (throwable != null) {
Log.e(TAG, "Error", throwable); // Log.e(TAG, "Error", throwable);
storiesFetching = false; // storiesFetching = false;
return; // return;
} // }
if (storyModels != null && !storyModels.isEmpty()) { // if (storyModels != null && !storyModels.isEmpty()) {
locationDetailsBinding.mainLocationImage.setStoriesBorder(1); // locationDetailsBinding.mainLocationImage.setStoriesBorder(1);
hasStories = true; // hasStories = true;
} // }
storiesFetching = false; // storiesFetching = false;
}), Dispatchers.getIO()) // }), Dispatchers.getIO())
); // );
} // }
} // }
private void setTitle() { private void setTitle() {
final ActionBar actionBar = fragmentActivity.getSupportActionBar(); final ActionBar actionBar = fragmentActivity.getSupportActionBar();