Browse Source

highlight fix, also better verified badge

renovate/org.robolectric-robolectric-4.x test-v19.0-a2
Austin Huang 4 years ago
parent
commit
03f52d5058
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 11
      app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java
  2. 6
      app/src/main/java/awais/instagrabber/webservices/StoriesService.java
  3. 7
      app/src/main/res/layout/fragment_profile.xml

11
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() {

6
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/");

7
app/src/main/res/layout/fragment_profile.xml

@ -91,9 +91,10 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/isVerified"
android:layout_width="18dp"
android:layout_height="0dp"
android:layout_gravity="start"
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingTop="8dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:visibility="gone"

Loading…
Cancel
Save