1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 06:37:30 +00:00

fix notification navigation in pursuant to #850

This commit is contained in:
Austin Huang 2021-04-02 16:59:28 -04:00
parent 4ab225cdaf
commit d0e01b3b9b
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
4 changed files with 29 additions and 7 deletions

View File

@ -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);
}

View File

@ -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;
}));

View File

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

View File

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