Merge pull request #442 from okcaptain/dev

Dev
pull/445/head
okcaptain 2 years ago committed by GitHub
commit 253bf0e788
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/build.gradle
  2. 10
      app/src/leanback/java/com/fongmi/android/tv/ui/fragment/HomeFragment.java
  3. 2
      app/src/main/java/com/fongmi/android/tv/utils/Tbs.java

@ -10,8 +10,8 @@ android {
applicationId "com.fongmi.android.tv"
minSdk 21
targetSdk 28
versionCode 233
versionName "0516"
versionCode 234
versionName "2.3.4"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]

@ -2,6 +2,7 @@ package com.fongmi.android.tv.ui.fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
@ -118,6 +119,7 @@ public class HomeFragment extends BaseFragment implements VodPresenter.OnClickLi
mHistoryAdapter = new ArrayObjectAdapter(mPresenter = new HistoryPresenter(this));
homeUI = Setting.getHomeUI();
button = Setting.getHomeButtons(Button.getDefaultButtons());
if (funcRow != null) setTitleNextFocus(funcRow);
}
public void addVideo(Result result) {
@ -145,6 +147,13 @@ public class HomeFragment extends BaseFragment implements VodPresenter.OnClickLi
return new ListRow(adapter);
}
private void setTitleNextFocus(ListRow funcRow) {
if (funcRow == null) return;
Func func = (Func) funcRow.getAdapter().get(0);
int downId = getHomeActicity().mBinding.recycler.getVisibility() == View.VISIBLE ? -1 : func.getId();
getHomeActicity().mBinding.title.setNextFocusDownId(downId);
}
private void refreshFuncRow() {
if (homeUI == Setting.getHomeUI() && Setting.getHomeButtons(Button.getDefaultButtons()).equals(button)) return;
if (!TextUtils.isEmpty(button)) mAdapter.removeItems(0, 1);
@ -152,6 +161,7 @@ public class HomeFragment extends BaseFragment implements VodPresenter.OnClickLi
button = Setting.getHomeButtons(Button.getDefaultButtons());
ListRow funcRow = getFuncRow();
if (funcRow != null) mAdapter.add(0, funcRow);
if (funcRow != null) setTitleNextFocus(funcRow);
}
public void refreshRecommond() {

@ -29,7 +29,7 @@ public class Tbs {
public static String getUrl() {
File file = new File(Path.tv(), "x5.tbs.apk");
if (file.exists()) return Server.get().getAddress("/file/TV/x5.tbs.apk");
if (file.exists()) return Server.get().getAddress("file/TV/x5.tbs.apk");
return Server.get().getAddress("x5.tbs.apk");
}

Loading…
Cancel
Save