1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-04-03 09:31:34 +00:00

Merge branch 'master' into support-android-11

This commit is contained in:
Ammar Githam 2021-04-08 18:50:14 +09:00
commit c8704fb2dc
82 changed files with 1131 additions and 309 deletions

View file

@ -93,12 +93,12 @@ public final class NotificationsViewerFragment extends Fragment implements Swipe
final NotificationImage notificationImage = model.getArgs().getMedia().get(0);
final long mediaId = Long.parseLong(notificationImage.getId().split("_")[0]);
if (model.getType() == NotificationType.RESPONDED_STORY) {
final NavDirections action = NotificationsViewerFragmentDirections
.actionNotificationsToStory(
StoryViewerOptions.forStory(
final StoryViewerOptions options = StoryViewerOptions.forStory(
mediaId,
model.getArgs().getUsername()));
NavHostFragment.findNavController(NotificationsViewerFragment.this).navigate(action);
model.getArgs().getUsername());
final Bundle bundle = new Bundle();
bundle.putSerializable("options", options);
NavHostFragment.findNavController(NotificationsViewerFragment.this).navigate(R.id.action_notifications_to_story, bundle);
} else {
final AlertDialog alertDialog = new AlertDialog.Builder(context)
.setCancelable(false)

View file

@ -354,8 +354,7 @@ public class DirectMessageSettingsFragment extends Fragment implements ConfirmDi
}
if (TextUtils.isEmpty(user.getUsername())) return;
final ProfileNavGraphDirections.ActionGlobalProfileFragment directions = ProfileNavGraphDirections
.actionGlobalProfileFragment()
.setUsername("@" + user.getUsername());
.actionGlobalProfileFragment("@" + user.getUsername());
NavHostFragment.findNavController(this).navigate(directions);
},
(position, user) -> {
@ -393,8 +392,7 @@ public class DirectMessageSettingsFragment extends Fragment implements ConfirmDi
@Override
public void onClick(final int position, final PendingUser pendingUser) {
final ProfileNavGraphDirections.ActionGlobalProfileFragment directions = ProfileNavGraphDirections
.actionGlobalProfileFragment()
.setUsername("@" + pendingUser.getUser().getUsername());
.actionGlobalProfileFragment("@" + pendingUser.getUser().getUsername());
NavHostFragment.findNavController(DirectMessageSettingsFragment.this).navigate(directions);
}

View file

@ -1446,8 +1446,7 @@ public class DirectMessageThreadFragment extends Fragment implements DirectReact
private void navigateToUser(@NonNull final String username) {
final ProfileNavGraphDirections.ActionGlobalProfileFragment direction = ProfileNavGraphDirections
.actionGlobalProfileFragment()
.setUsername("@" + username);
.actionGlobalProfileFragment("@" + username);
NavHostFragment.findNavController(DirectMessageThreadFragment.this).navigate(direction);
}

View file

@ -75,6 +75,12 @@ public class AboutFragment extends BasePreferencesFragment {
"Copyright (C) 2014 Austin Andrews & Google LLC. Apache 2.0.",
"https://materialdesignicons.com"
));
thirdPartyCategory.addPreference(get3ptPreference(
context,
"Process Phoenix",
"Copyright (C) 2015 Jake Wharton. Apache 2.0.",
"https://github.com/JakeWharton/ProcessPhoenix"
));
thirdPartyCategory.addPreference(get3ptPreference(
context,
"Retrofit",

View file

@ -17,6 +17,7 @@ public class StoriesPreferencesFragment extends BasePreferencesFragment {
final Context context = getContext();
if (context == null) return;
screen.addPreference(getStorySortPreference(context));
screen.addPreference(getHideMutedReelsPreference(context));
screen.addPreference(getMarkStoriesSeenPreference(context));
}

View file

@ -1093,7 +1093,6 @@ public final class ResponseBodyUtils {
final List<MediaCandidate> sortedCandidates = candidates.stream()
.sorted((c1, c2) -> Integer.compare(c2.getWidth(), c1.getWidth()))
.collect(Collectors.toList());
if (sortedCandidates.size() == 1) return sortedCandidates.get(0).getUrl();
final List<MediaCandidate> filteredCandidates = sortedCandidates.stream()
.filter(c ->
c.getWidth() <= media.getOriginalWidth()
@ -1101,6 +1100,7 @@ public final class ResponseBodyUtils {
&& (isSquare || Integer.compare(c.getWidth(), c.getHeight()) != 0)
)
.collect(Collectors.toList());
if (filteredCandidates.size() == 0) return sortedCandidates.get(0).getUrl();
final MediaCandidate candidate = filteredCandidates.get(0);
if (candidate == null) return null;
return candidate.getUrl();