use no focus tag from strings

This commit is contained in:
KingLucius 2024-02-25 14:38:47 +02:00
parent 976f7c1e69
commit f8ef06dc64
3 changed files with 5 additions and 4 deletions

View file

@ -61,6 +61,7 @@ import com.lagradost.cloudstream3.APIHolder.apis
import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings import com.lagradost.cloudstream3.APIHolder.getApiDubstatusSettings
import com.lagradost.cloudstream3.APIHolder.initAll import com.lagradost.cloudstream3.APIHolder.initAll
import com.lagradost.cloudstream3.APIHolder.updateHasTrailers import com.lagradost.cloudstream3.APIHolder.updateHasTrailers
import com.lagradost.cloudstream3.AcraApplication.Companion.context
import com.lagradost.cloudstream3.AcraApplication.Companion.getKey import com.lagradost.cloudstream3.AcraApplication.Companion.getKey
import com.lagradost.cloudstream3.AcraApplication.Companion.removeKey import com.lagradost.cloudstream3.AcraApplication.Companion.removeKey
import com.lagradost.cloudstream3.AcraApplication.Companion.setKey import com.lagradost.cloudstream3.AcraApplication.Companion.setKey
@ -1185,7 +1186,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
if(isTrueTvSettings()) { if(isTrueTvSettings()) {
newLocalBinding.root.viewTreeObserver.addOnGlobalFocusChangeListener { _, newFocus -> newLocalBinding.root.viewTreeObserver.addOnGlobalFocusChangeListener { _, newFocus ->
if (newFocus?.tag == "tv_no_focus_tag") return@addOnGlobalFocusChangeListener if (newFocus?.tag == context?.getString(R.string.tv_no_focus_tag)) return@addOnGlobalFocusChangeListener
centerView(newFocus) centerView(newFocus)
} }
} }

View file

@ -253,7 +253,7 @@ class ResultFragmentTv : Fragment() {
val leftListener: View.OnFocusChangeListener = val leftListener: View.OnFocusChangeListener =
View.OnFocusChangeListener { view, hasFocus -> View.OnFocusChangeListener { view, hasFocus ->
if (!hasFocus) return@OnFocusChangeListener if (!hasFocus) return@OnFocusChangeListener
if (view?.tag == "tv_no_focus_tag"){ if (view?.tag == context?.getString(R.string.tv_no_focus_tag)){
resultFinishLoading.scrollTo(0,0) resultFinishLoading.scrollTo(0,0)
} }
toggleEpisodes(false) toggleEpisodes(false)

View file

@ -157,7 +157,7 @@
android:id="@+id/home_preview_hidden_prev_focus" android:id="@+id/home_preview_hidden_prev_focus"
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="1dp" android:layout_height="1dp"
android:tag="tv_no_focus_tag" android:tag="@string/tv_no_focus_tag"
android:focusable="false" /> android:focusable="false" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
@ -190,7 +190,7 @@
android:id="@+id/home_preview_hidden_next_focus" android:id="@+id/home_preview_hidden_next_focus"
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="1dp" android:layout_height="1dp"
android:tag="tv_no_focus_tag" android:tag="@string/tv_no_focus_tag"
android:focusable="false" /> android:focusable="false" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>