1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-14 10:47:30 +00:00

follow-up on merge (story directions)

This commit is contained in:
Austin Huang 2021-07-06 17:22:53 -04:00
parent f0a2feeaa8
commit 390b3c384b
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with 14 additions and 12 deletions

View File

@ -31,7 +31,6 @@ import awais.instagrabber.R
import awais.instagrabber.adapters.StoriesAdapter import awais.instagrabber.adapters.StoriesAdapter
import awais.instagrabber.customviews.helpers.SwipeGestureListener import awais.instagrabber.customviews.helpers.SwipeGestureListener
import awais.instagrabber.databinding.FragmentStoryViewerBinding import awais.instagrabber.databinding.FragmentStoryViewerBinding
import awais.instagrabber.fragments.main.ProfileFragment
import awais.instagrabber.fragments.settings.PreferenceKeys import awais.instagrabber.fragments.settings.PreferenceKeys
import awais.instagrabber.interfaces.SwipeEvent import awais.instagrabber.interfaces.SwipeEvent
import awais.instagrabber.models.Resource import awais.instagrabber.models.Resource
@ -641,20 +640,19 @@ class StoryViewerFragment : Fragment() {
actionBar.title = null actionBar.title = null
actionBar.subtitle = null actionBar.subtitle = null
} }
when (data.second) { val action = when (data.second) {
FavoriteType.USER -> { FavoriteType.USER -> {
bundle.putString("username", data.first) StoryViewerFragmentDirections.actionToProfile().apply { this.username = data.first!! }
navController.navigate(R.id.action_global_profileFragment, bundle)
} }
FavoriteType.HASHTAG -> { FavoriteType.HASHTAG -> {
bundle.putString("hashtag", data.first) StoryViewerFragmentDirections.actionToHashtag(data.first!!)
navController.navigate(R.id.action_global_hashTagFragment, bundle)
} }
FavoriteType.LOCATION -> { FavoriteType.LOCATION -> {
bundle.putLong("locationId", data.first!!.toLong()) StoryViewerFragmentDirections.actionToLocation(data.first!!.toLong())
navController.navigate(R.id.action_global_locationFragment, bundle)
} }
else -> null
} }
navController.navigate(action!!)
} }
private fun releasePlayer() { private fun releasePlayer() {
@ -799,12 +797,12 @@ class StoryViewerFragment : Fragment() {
} }
private fun shareStoryViaDm() { private fun shareStoryViaDm() {
val actionGlobalUserSearch = UserSearchFragmentDirections.actionGlobalUserSearch().apply { val actionGlobalUserSearch = StoryViewerFragmentDirections.actionToUserSearch().apply {
title = getString(R.string.share) title = getString(R.string.share)
setActionLabel(getString(R.string.send)) actionLabel = getString(R.string.send)
showGroups = true showGroups = true
multiple = true multiple = true
setSearchMode(UserSearchFragment.SearchMode.RAVEN) searchMode = UserSearchMode.RAVEN
} }
try { try {
val navController = NavHostFragment.findNavController(this@StoryViewerFragment) val navController = NavHostFragment.findNavController(this@StoryViewerFragment)
@ -871,7 +869,7 @@ class StoryViewerFragment : Fragment() {
val bundle = Bundle() val bundle = Bundle()
bundle.putSerializable(PostViewV2Fragment.ARG_MEDIA, it.data) bundle.putSerializable(PostViewV2Fragment.ARG_MEDIA, it.data)
try { try {
navController.navigate(R.id.action_global_post_view, bundle) navController.navigate(StoryViewerFragmentDirections.actionToPost(it.data, 0))
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "openPostDialog: ", e) Log.e(TAG, "openPostDialog: ", e)
} }

View File

@ -93,6 +93,10 @@
<action <action
android:id="@+id/action_to_location" android:id="@+id/action_to_location"
app:destination="@id/locationFragment" /> app:destination="@id/locationFragment" />
<action
android:id="@+id/action_to_user_search"
app:destination="@id/user_search" />
</fragment> </fragment>
<fragment <fragment