Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TV Support Scan Devices And Sync Keep and History #460

Open
wants to merge 14 commits into
base: release
Choose a base branch
from
Prev Previous commit
Next Next commit
* 调整同步收藏布局,解决同步收藏无焦点的bug
  • Loading branch information
jadehh committed Jun 6, 2024
commit 4febbf0750d0d303058364e6113feba23d301ee2
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.fongmi.android.tv.ui.cast.ScanEvent;
import com.fongmi.android.tv.ui.cast.ScanTask;
import com.fongmi.android.tv.utils.Notify;
import com.fongmi.android.tv.utils.ResUtil;
import com.github.catvod.net.OkHttp;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;

Expand Down Expand Up @@ -60,6 +61,9 @@ public SyncDialog(FragmentActivity activity) {

private void initDialog() {
WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
params.width = (int) (ResUtil.getScreenWidth() * 0.4f);
dialog.getWindow().setAttributes(params);
dialog.getWindow().setDimAmount(0);
dialog.show();
}

Expand Down
44 changes: 26 additions & 18 deletions app/src/leanback/res/layout/activity_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:orientation="horizontal">

<LinearLayout
android:id="@+id/version"
android:id="@+id/sync_keep"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
Expand All @@ -463,26 +462,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_version"
android:text="@string/setting_keep_sync"
android:textColor="@color/white"
android:textSize="18sp" />

<TextView
android:id="@+id/versionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="1.2.1" />

</LinearLayout>

<LinearLayout
android:id="@+id/sync_keep"
android:id="@+id/sync_history"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:background="@drawable/selector_item"
android:focusable="true"
Expand All @@ -493,15 +481,23 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_keep_sync"
android:text="@string/setting_history_sync"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:orientation="horizontal">

<LinearLayout
android:id="@+id/sync_history"
android:id="@+id/version"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:background="@drawable/selector_item"
android:focusable="true"
Expand All @@ -512,10 +508,22 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_history_sync"
android:text="@string/setting_version"
android:textColor="@color/white"
android:textSize="18sp" />

<TextView
android:id="@+id/versionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/white"
android:textSize="18sp"
tools:text="1.2.1" />

</LinearLayout>


</LinearLayout>


Expand Down