highlight fix, also better verified badge

This commit is contained in:
Austin Huang 2020-09-26 21:33:41 -04:00
parent 6393bbc02b
commit 03f52d5058
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
3 changed files with 15 additions and 9 deletions

View File

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

View File

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

View File

@ -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"