mirror of
				https://github.com/recloudstream/cloudstream.git
				synced 2024-08-15 01:53:11 +00:00 
			
		
		
		
	TV navigation improvements
This commit is contained in:
		
							parent
							
								
									e68fda7d82
								
							
						
					
					
						commit
						309c2b828c
					
				
					 2 changed files with 16 additions and 0 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| package com.lagradost.cloudstream3.ui.settings.extensions | ||||
| 
 | ||||
| import android.content.ClipData | ||||
| import android.content.ClipboardManager | ||||
| import android.content.Context | ||||
| import android.content.DialogInterface | ||||
|  | @ -22,6 +23,7 @@ import com.lagradost.cloudstream3.mvvm.Some | |||
| import com.lagradost.cloudstream3.mvvm.observe | ||||
| import com.lagradost.cloudstream3.plugins.RepositoryManager | ||||
| import com.lagradost.cloudstream3.ui.result.setText | ||||
| import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.isTvSettings | ||||
| import com.lagradost.cloudstream3.ui.settings.SettingsFragment.Companion.setUpToolbar | ||||
| import com.lagradost.cloudstream3.utils.Coroutines.ioSafe | ||||
| import com.lagradost.cloudstream3.utils.Coroutines.main | ||||
|  | @ -118,6 +120,15 @@ class ExtensionsFragment : Fragment() { | |||
| 
 | ||||
|         list_repositories?.setOnClickListener { | ||||
|             openBrowser(PUBLIC_REPOSITORIES_LIST) | ||||
| 
 | ||||
|             // Set clipboard on TV because the browser might not exist or work properly | ||||
|             if (it.context.isTvSettings()) { | ||||
|                 val serviceClipboard = | ||||
|                     (activity?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager?) | ||||
|                         ?: return@setOnClickListener | ||||
|                 val clip = ClipData.newPlainText("Repository url", PUBLIC_REPOSITORIES_LIST) | ||||
|                 serviceClipboard.setPrimaryClip(clip) | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         observe(extensionViewModel.pluginStats) { | ||||
|  |  | |||
|  | @ -47,12 +47,15 @@ | |||
| 
 | ||||
|         <com.google.android.material.button.MaterialButton | ||||
|             android:id="@+id/list_repositories" | ||||
|             android:nextFocusDown="@id/add_repo_button" | ||||
|             style="@style/WhiteButton" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:text="@string/view_public_repositories_button" /> | ||||
|     </LinearLayout> | ||||
| 
 | ||||
|     <LinearLayout | ||||
|         android:foreground="@drawable/outline_drawable" | ||||
|         android:nextFocusUp="@id/add_repo_button" | ||||
|         android:id="@+id/plugin_storage_appbar" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="80dp" | ||||
|  | @ -160,6 +163,8 @@ | |||
| 
 | ||||
|     <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton | ||||
|         android:id="@+id/add_repo_button" | ||||
|         android:nextFocusUp="@id/list_repositories" | ||||
|         android:nextFocusDown="@id/plugin_storage_appbar" | ||||
|         style="@style/ExtendedFloatingActionButton" | ||||
|         android:text="@string/add_repository" | ||||
|         android:textColor="?attr/textColor" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue