forked from recloudstream/cloudstream
minor change
This commit is contained in:
parent
3cd335aaa0
commit
e3cc7ca489
6 changed files with 31 additions and 27 deletions
|
@ -18,7 +18,7 @@ import androidx.navigation.NavDestination
|
|||
import androidx.navigation.NavDestination.Companion.hierarchy
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import androidx.navigation.NavOptions
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.android.gms.cast.framework.*
|
||||
|
@ -34,6 +34,7 @@ import com.lagradost.cloudstream3.CommonActivity.onDialogDismissedEvent
|
|||
import com.lagradost.cloudstream3.CommonActivity.onUserLeaveHint
|
||||
import com.lagradost.cloudstream3.CommonActivity.showToast
|
||||
import com.lagradost.cloudstream3.CommonActivity.updateLocale
|
||||
import com.lagradost.cloudstream3.movieproviders.NginxProvider
|
||||
import com.lagradost.cloudstream3.mvvm.logError
|
||||
import com.lagradost.cloudstream3.network.Requests
|
||||
import com.lagradost.cloudstream3.receivers.VideoDownloadRestartReceiver
|
||||
|
@ -64,14 +65,12 @@ import com.lagradost.cloudstream3.utils.UIHelper.getResourceColor
|
|||
import com.lagradost.cloudstream3.utils.UIHelper.hideKeyboard
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.navigate
|
||||
import com.lagradost.cloudstream3.utils.UIHelper.requestRW
|
||||
import com.lagradost.cloudstream3.movieproviders.NginxProvider
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.fragment_result_swipe.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
import kotlin.collections.HashMap
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
|
||||
|
@ -107,7 +106,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
|
|||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
updateLocale() // android fucks me by chaining lang when rotating the phone
|
||||
findNavController(R.id.nav_host_fragment).currentDestination?.let { updateNavBar(it) }
|
||||
|
||||
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
|
||||
navHostFragment.navController.currentDestination?.let { updateNavBar(it) }
|
||||
}
|
||||
|
||||
private fun updateNavBar(destination: NavDestination) {
|
||||
|
@ -521,8 +522,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
|
|||
setUpBackup()
|
||||
|
||||
CommonActivity.init(this)
|
||||
|
||||
val navController = findNavController(R.id.nav_host_fragment)
|
||||
val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
|
||||
val navController = navHostFragment.navController
|
||||
//val navController = findNavController(R.id.nav_host_fragment)
|
||||
|
||||
/*navOptions = NavOptions.Builder()
|
||||
.setLaunchSingleTop(true)
|
||||
|
|
|
@ -9,7 +9,7 @@ import androidx.appcompat.app.AppCompatActivity
|
|||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lagradost.cloudstream3.R
|
||||
|
@ -113,8 +113,8 @@ class DownloadFragment : Fragment() {
|
|||
//wont be called
|
||||
} else {
|
||||
val folder = DataStore.getFolderName(DOWNLOAD_EPISODE_CACHE, click.data.id.toString())
|
||||
val navController = activity?.findNavController(R.id.nav_host_fragment)
|
||||
navController?.navigate(
|
||||
val navHostFragment = activity?.supportFragmentManager?.findFragmentById(R.id.nav_host_fragment) as? NavHostFragment?
|
||||
navHostFragment?.navController?.navigate(
|
||||
R.id.navigation_download_child,
|
||||
DownloadChildFragment.newInstance(click.data.name, folder)
|
||||
)
|
||||
|
|
|
@ -1321,7 +1321,7 @@ class ResultFragment : Fragment(), PanelsChildGestureRegionObserver.GestureRegio
|
|||
result_sync_names?.text =
|
||||
list.filter { it.isSynced && it.hasAccount }.joinToString { it.name }
|
||||
|
||||
val newList = list.filter { it.isSynced }
|
||||
val newList = list.filter { it.isSynced && it.hasAccount }
|
||||
|
||||
result_mini_sync?.isVisible = newList.isNotEmpty()
|
||||
(result_mini_sync?.adapter as? ImageAdapter?)?.updateList(newList.map { it.icon })
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
app:menu="@menu/bottom_nav_menu"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<fragment
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
@ -12,22 +12,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<com.google.android.material.navigationrail.NavigationRailView
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/nav_rail_view"
|
||||
android:background="?attr/primaryGrayBackground"
|
||||
app:itemTextColor="@color/item_select_color"
|
||||
app:itemIconTint="@color/item_select_color"
|
||||
app:menuGravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:labelVisibilityMode="unlabeled"
|
||||
app:menu="@menu/bottom_nav_menu">
|
||||
|
||||
</com.google.android.material.navigationrail.NavigationRailView>
|
||||
|
||||
<fragment
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
|
@ -40,6 +25,22 @@
|
|||
app:layout_constraintStart_toEndOf="@id/nav_rail_view"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<com.google.android.material.navigationrail.NavigationRailView
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/nav_rail_view"
|
||||
android:background="?attr/primaryGrayBackground"
|
||||
app:itemTextColor="@color/item_select_color"
|
||||
app:itemIconTint="@color/item_select_color"
|
||||
|
||||
app:menuGravity="center"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:labelVisibilityMode="unlabeled"
|
||||
app:menu="@menu/bottom_nav_menu">
|
||||
|
||||
</com.google.android.material.navigationrail.NavigationRailView>
|
||||
|
||||
<LinearLayout
|
||||
app:layout_constraintStart_toEndOf="@+id/nav_rail_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
android:layout_height="35dp"
|
||||
android:layout_gravity="center"
|
||||
tools:src="@drawable/ic_anilist_icon"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
app:tint="?attr/white">
|
||||
</ImageView>
|
Loading…
Reference in a new issue