Browse Source
fix notification navigation in pursuant to #850
renovate/org.robolectric-robolectric-4.x
Austin Huang
4 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
4 changed files with
29 additions and
7 deletions
-
app/src/main/java/awais/instagrabber/fragments/NotificationsViewerFragment.java
-
app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java
-
app/src/main/res/navigation/notification_viewer_nav_graph.xml
-
app/src/main/res/navigation/profile_nav_graph.xml
|
|
@ -31,7 +31,6 @@ import awais.instagrabber.R; |
|
|
|
import awais.instagrabber.adapters.NotificationsAdapter; |
|
|
|
import awais.instagrabber.adapters.NotificationsAdapter.OnNotificationClickListener; |
|
|
|
import awais.instagrabber.databinding.FragmentNotificationsViewerBinding; |
|
|
|
import awais.instagrabber.fragments.settings.MorePreferencesFragmentDirections; |
|
|
|
import awais.instagrabber.models.enums.NotificationType; |
|
|
|
import awais.instagrabber.repositories.requests.StoryViewerOptions; |
|
|
|
import awais.instagrabber.repositories.responses.FriendshipChangeResponse; |
|
|
@ -278,7 +277,7 @@ public final class NotificationsViewerFragment extends Fragment implements Swipe |
|
|
|
} |
|
|
|
|
|
|
|
private void openProfile(final String username) { |
|
|
|
final NavDirections action = MorePreferencesFragmentDirections |
|
|
|
final NavDirections action = NotificationsViewerFragmentDirections |
|
|
|
.actionGlobalProfileFragment("@" + username); |
|
|
|
NavHostFragment.findNavController(this).navigate(action); |
|
|
|
} |
|
|
@ -223,8 +223,6 @@ public class MorePreferencesFragment extends BasePreferencesFragment { |
|
|
|
-1, |
|
|
|
preference -> { |
|
|
|
if (BuildConfig.isPre) return true; |
|
|
|
final AppCompatActivity activity = (AppCompatActivity) getActivity(); |
|
|
|
if (activity == null) return true; |
|
|
|
FlavorTown.updateCheck(activity, true); |
|
|
|
return true; |
|
|
|
})); |
|
|
|
|
|
@ -24,6 +24,17 @@ |
|
|
|
app:destination="@id/storyViewerFragment" /> |
|
|
|
</fragment> |
|
|
|
|
|
|
|
<include app:graph="@navigation/profile_nav_graph" /> |
|
|
|
|
|
|
|
<action |
|
|
|
android:id="@+id/action_global_profileFragment" |
|
|
|
app:destination="@id/profile_nav_graph"> |
|
|
|
<argument |
|
|
|
android:name="username" |
|
|
|
app:argType="string" |
|
|
|
app:nullable="true" /> |
|
|
|
</action> |
|
|
|
|
|
|
|
<action |
|
|
|
android:id="@+id/action_global_notificationsViewerFragment" |
|
|
|
app:destination="@id/notificationsViewer"> |
|
|
|
|
|
@ -71,11 +71,9 @@ |
|
|
|
app:argType="long" /> |
|
|
|
</action> |
|
|
|
|
|
|
|
<include app:graph="@navigation/notification_viewer_nav_graph" /> |
|
|
|
|
|
|
|
<action |
|
|
|
android:id="@+id/action_global_notificationsViewerFragment" |
|
|
|
app:destination="@id/notification_viewer_nav_graph"> |
|
|
|
app:destination="@id/notificationsViewer"> |
|
|
|
<argument |
|
|
|
android:name="type" |
|
|
|
app:argType="string" |
|
|
@ -86,6 +84,22 @@ |
|
|
|
app:argType="long" /> |
|
|
|
</action> |
|
|
|
|
|
|
|
<fragment |
|
|
|
android:id="@+id/notificationsViewer" |
|
|
|
android:name="awais.instagrabber.fragments.NotificationsViewerFragment" |
|
|
|
android:label="@string/title_notifications" |
|
|
|
tools:layout="@layout/fragment_notifications_viewer"> |
|
|
|
<argument |
|
|
|
android:name="type" |
|
|
|
app:argType="string" |
|
|
|
app:nullable="false" |
|
|
|
android:defaultValue="notif"/> |
|
|
|
<argument |
|
|
|
android:name="targetId" |
|
|
|
android:defaultValue="0L" |
|
|
|
app:argType="long" /> |
|
|
|
</fragment> |
|
|
|
|
|
|
|
<include app:graph="@navigation/saved_nav_graph" /> |
|
|
|
|
|
|
|
<action |
|
|
|