From 03f52d50587d7f08fd6160478aad0d85261faad7 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sat, 26 Sep 2020 21:33:41 -0400 Subject: [PATCH] highlight fix, also better verified badge --- .../instagrabber/fragments/StoryViewerFragment.java | 11 ++++++++--- .../instagrabber/webservices/StoriesService.java | 6 +++--- app/src/main/res/layout/fragment_profile.xml | 7 ++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java b/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java index 044f9c22..fbbea90a 100644 --- a/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java @@ -132,7 +132,6 @@ public class StoryViewerFragment extends Fragment { private StoryViewerFragmentArgs fragmentArgs; private ViewModel viewModel; private boolean isHighlight; - private boolean isLoggedIn; private final String cookie = settingsHelper.getString(Constants.COOKIE); @@ -244,7 +243,6 @@ public class StoryViewerFragment extends Fragment { } private void init() { - isLoggedIn = !TextUtils.isEmpty(cookie) && CookieUtils.getUserIdFromCookie(cookie) != null; if (getArguments() == null) return; fragmentArgs = StoryViewerFragmentArgs.fromBundle(getArguments()); currentFeedStoryIndex = fragmentArgs.getFeedStoryIndex(); @@ -745,8 +743,11 @@ public class StoryViewerFragment extends Fragment { } private void openProfile(final String username) { + final ActionBar actionBar = fragmentActivity.getSupportActionBar(); + if (actionBar != null) { + actionBar.setSubtitle(null); + } final char t = username.charAt(0); - Log.d("austin_debug", username); if (t == '@') { final NavDirections action = HashTagFragmentDirections.actionGlobalProfileFragment(username); NavHostFragment.findNavController(this).navigate(action); @@ -755,6 +756,10 @@ public class StoryViewerFragment extends Fragment { final NavDirections action = HashTagFragmentDirections.actionGlobalHashTagFragment(username.substring(1)); NavHostFragment.findNavController(this).navigate(action); } + else { + final NavDirections action = ProfileFragmentDirections.actionGlobalLocationFragment(username.split(" \\(")[1].replace(")", "")); + NavHostFragment.findNavController(this).navigate(action); + } } private void releasePlayer() { diff --git a/app/src/main/java/awais/instagrabber/webservices/StoriesService.java b/app/src/main/java/awais/instagrabber/webservices/StoriesService.java index a16381e4..7830adf0 100644 --- a/app/src/main/java/awais/instagrabber/webservices/StoriesService.java +++ b/app/src/main/java/awais/instagrabber/webservices/StoriesService.java @@ -221,8 +221,8 @@ public class StoriesService extends BaseService { if (locations != null) { for (int h = 0; h < locations.length(); ++h) { mentions[h + (hashtags == null ? 0 : hashtags.length()) + (atmarks == null ? 0 : atmarks.length())] = - locations.getJSONObject(h).getJSONObject("location").getLong("pk") - + "/ (" + locations.getJSONObject(h).getJSONObject("location").getString("short_name") + ")"; + locations.getJSONObject(h).getJSONObject("location").getString("short_name") + + " (" + locations.getJSONObject(h).getJSONObject("location").getLong("pk") + ")"; } } if (mentions.length != 0) model.setMentions(mentions); @@ -256,7 +256,7 @@ public class StoriesService extends BaseService { builder.append("tags/"); } else if (highlight) { - builder.append("feed/reels_media?user_ids="); + builder.append("feed/reels_media/?user_ids="); } else { builder.append("feed/user/"); diff --git a/app/src/main/res/layout/fragment_profile.xml b/app/src/main/res/layout/fragment_profile.xml index 6fa3fb1a..1c97e437 100644 --- a/app/src/main/res/layout/fragment_profile.xml +++ b/app/src/main/res/layout/fragment_profile.xml @@ -91,9 +91,10 @@