Browse Source

restore swipeup

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
d5161ac2ea
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 17
      app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java

17
app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java

@ -84,6 +84,7 @@ import awais.instagrabber.models.stickers.PollModel;
import awais.instagrabber.models.stickers.QuestionModel;
import awais.instagrabber.models.stickers.QuizModel;
import awais.instagrabber.models.stickers.SliderModel;
import awais.instagrabber.models.stickers.SwipeUpModel;
import awais.instagrabber.repositories.responses.StoryStickerResponse;
import awais.instagrabber.utils.Constants;
import awais.instagrabber.utils.CookieUtils;
@ -124,6 +125,7 @@ public class StoryViewerFragment extends Fragment {
private String[] mentions;
private QuizModel quiz;
private SliderModel slider;
private SwipeUpModel swipeUp;
private MenuItem menuDownload;
private MenuItem menuDm;
private SimpleExoPlayer player;
@ -380,6 +382,14 @@ public class StoryViewerFragment extends Fragment {
startActivity(intent);
}
});
binding.swipeUp.setOnClickListener(v -> {
final Object tag = v.getTag();
if (tag instanceof CharSequence) {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(tag.toString()));
startActivity(intent);
}
});
binding.viewStoryPost.setOnClickListener(v -> {
final Object tag = v.getTag();
if (!(tag instanceof CharSequence)) return;
@ -737,6 +747,13 @@ public class StoryViewerFragment extends Fragment {
binding.slider.setVisibility(slider != null ? View.VISIBLE : View.GONE);
binding.slider.setTag(slider);
swipeUp = currentStory.getSwipeUp();
if (swipeUp != null) {
binding.swipeUp.setVisibility(View.VISIBLE);
binding.swipeUp.setText(swipeUp.getText());
binding.swipeUp.setTag(swipeUp.getUrl());
}
releasePlayer();
if (isHashtag || isLoc) {
final ActionBar actionBar = fragmentActivity.getSupportActionBar();

Loading…
Cancel
Save