mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
fix: navigating back home after clicking home section link (#6976)
This commit is contained in:
parent
9893df8763
commit
8911810c76
@ -33,6 +33,7 @@ import com.github.libretube.ui.models.HomeViewModel
|
||||
import com.github.libretube.ui.models.SubscriptionsViewModel
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
|
||||
|
||||
class HomeFragment : Fragment(R.layout.fragment_home) {
|
||||
private var _binding: FragmentHomeBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
@ -54,23 +55,23 @@ class HomeFragment : Fragment(R.layout.fragment_home) {
|
||||
}
|
||||
|
||||
binding.featuredTV.setOnClickListener {
|
||||
findNavController().navigate(R.id.subscriptionsFragment)
|
||||
findNavController().navigate(R.id.action_homeFragment_to_subscriptionsFragment)
|
||||
}
|
||||
|
||||
binding.watchingTV.setOnClickListener {
|
||||
findNavController().navigate(R.id.watchHistoryFragment)
|
||||
findNavController().navigate(R.id.action_homeFragment_to_watchHistoryFragment)
|
||||
}
|
||||
|
||||
binding.trendingTV.setOnClickListener {
|
||||
findNavController().navigate(R.id.trendsFragment)
|
||||
findNavController().navigate(R.id.action_homeFragment_to_trendsFragment)
|
||||
}
|
||||
|
||||
binding.playlistsTV.setOnClickListener {
|
||||
findNavController().navigate(R.id.libraryFragment)
|
||||
findNavController().navigate(R.id.action_homeFragment_to_libraryFragment)
|
||||
}
|
||||
|
||||
binding.bookmarksTV.setOnClickListener {
|
||||
findNavController().navigate(R.id.libraryFragment)
|
||||
findNavController().navigate(R.id.action_homeFragment_to_libraryFragment)
|
||||
}
|
||||
|
||||
binding.refresh.setOnRefreshListener {
|
||||
|
@ -8,7 +8,36 @@
|
||||
android:id="@+id/homeFragment"
|
||||
android:name="com.github.libretube.ui.fragments.HomeFragment"
|
||||
android:label="fragment_home"
|
||||
tools:layout="@layout/fragment_home" />
|
||||
tools:layout="@layout/fragment_home">
|
||||
<action
|
||||
android:id="@+id/action_homeFragment_to_libraryFragment"
|
||||
app:destination="@id/libraryFragment"
|
||||
app:popUpTo="@id/homeFragment"
|
||||
app:popUpToInclusive="false"
|
||||
app:popUpToSaveState="true"
|
||||
app:restoreState="true" />
|
||||
<action
|
||||
android:id="@+id/action_homeFragment_to_watchHistoryFragment"
|
||||
app:destination="@id/watchHistoryFragment"
|
||||
app:popUpTo="@id/homeFragment"
|
||||
app:popUpToInclusive="false"
|
||||
app:popUpToSaveState="true"
|
||||
app:restoreState="true" />
|
||||
<action
|
||||
android:id="@+id/action_homeFragment_to_trendsFragment"
|
||||
app:destination="@id/trendsFragment"
|
||||
app:popUpTo="@id/homeFragment"
|
||||
app:popUpToInclusive="false"
|
||||
app:popUpToSaveState="true"
|
||||
app:restoreState="true" />
|
||||
<action
|
||||
android:id="@+id/action_homeFragment_to_subscriptionsFragment"
|
||||
app:destination="@id/subscriptionsFragment"
|
||||
app:popUpTo="@id/homeFragment"
|
||||
app:popUpToInclusive="false"
|
||||
app:popUpToSaveState="true"
|
||||
app:restoreState="true" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/trendsFragment"
|
||||
android:name="com.github.libretube.ui.fragments.TrendsFragment"
|
||||
@ -43,17 +72,17 @@
|
||||
android:id="@+id/channelFragment"
|
||||
android:name="com.github.libretube.ui.fragments.ChannelFragment"
|
||||
android:label="channel"
|
||||
tools:layout="@layout/fragment_channel" >
|
||||
tools:layout="@layout/fragment_channel">
|
||||
<argument
|
||||
android:name="channelId"
|
||||
android:defaultValue="@null"
|
||||
app:argType="string"
|
||||
app:nullable="true"
|
||||
android:defaultValue="@null" />
|
||||
app:nullable="true" />
|
||||
<argument
|
||||
android:name="channelName"
|
||||
android:defaultValue="@null"
|
||||
app:argType="string"
|
||||
app:nullable="true"
|
||||
android:defaultValue="@null" />
|
||||
app:nullable="true" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/playlistFragment"
|
||||
@ -66,9 +95,9 @@
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="playlistType"
|
||||
android:defaultValue="PUBLIC"
|
||||
app:argType="com.github.libretube.enums.PlaylistType"
|
||||
app:nullable="false"
|
||||
android:defaultValue="PUBLIC" />
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/watchHistoryFragment"
|
||||
@ -81,10 +110,13 @@
|
||||
android:label="@string/downloads"
|
||||
tools:layout="@layout/fragment_downloads" />
|
||||
|
||||
<action android:id="@+id/openChannel"
|
||||
<action
|
||||
android:id="@+id/openChannel"
|
||||
app:destination="@id/channelFragment" />
|
||||
<action android:id="@+id/openPlaylist"
|
||||
<action
|
||||
android:id="@+id/openPlaylist"
|
||||
app:destination="@id/playlistFragment" />
|
||||
<action android:id="@+id/showSearchResults"
|
||||
<action
|
||||
android:id="@+id/showSearchResults"
|
||||
app:destination="@id/searchResultFragment" />
|
||||
</navigation>
|
Loading…
x
Reference in New Issue
Block a user