Files
XMBOX/app/src/mobile/res/layout/fragment_setting.xml
T
您的名字 597261ff57 feat: 添加自定义开关按钮样式和UI优化
- 新增CustomSwitch自定义开关组件(黄色/黑色Material Design风格)
- 优化电量百分比显示(16sp字号,距离闪电图标2dp)
- 更新所有设置页面使用新的开关样式
- 移除旧的开关颜色设置代码
- 构建v8a正式版APK
2025-10-13 20:22:15 +08:00

631 lines
26 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:elevation="0dp"
app:elevation="0dp"
app:liftOnScrollColor="@color/transparent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:text="XMBOX"
android:textColor="@color/white"
android:textSize="24sp"
android:textStyle="bold" />
<com.fongmi.android.tv.ui.custom.MarqueeLayout
android:id="@+id/marquee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="24dp" />
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:overScrollMode="never"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="24dp"
android:paddingTop="16dp"
android:paddingEnd="24dp"
android:paddingBottom="24dp">
<!-- 源管理分组 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/setting_source"
android:textColor="@color/white"
android:textSize="14sp"
android:alpha="0.7" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:text="(单击视频输入框可加源)"
android:textColor="@color/white"
android:textSize="12sp"
android:alpha="0.5" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/vod"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="12dp"
android:layout_weight="1"
android:background="@drawable/shape_item"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_vod"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/vodUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:gravity="end"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="https://" />
</LinearLayout>
<ImageView
android:id="@+id/vodHome"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_item"
android:padding="16dp"
android:scaleType="fitCenter"
android:src="@drawable/potted_plant_24px"
android:tint="@color/white" />
<ImageView
android:id="@+id/vodHistory"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="@drawable/shape_item"
android:padding="16dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_m3_list_alt"
android:tint="@color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/live"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="12dp"
android:layout_weight="1"
android:background="@drawable/shape_item"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_live"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/liveUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:gravity="end"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="https://" />
</LinearLayout>
<ImageView
android:id="@+id/liveHome"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_item"
android:padding="16dp"
android:scaleType="fitCenter"
android:src="@drawable/potted_plant_24px"
android:tint="@color/white" />
<ImageView
android:id="@+id/liveHistory"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="@drawable/shape_item"
android:padding="16dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_m3_list_alt"
android:tint="@color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/wall"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="12dp"
android:layout_weight="1"
android:background="@drawable/shape_item"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_wall"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/wallUrl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="middle"
android:gravity="end"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="https://" />
</LinearLayout>
<ImageView
android:id="@+id/wallDefault"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_item"
android:padding="16dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_setting_switch" />
<ImageView
android:id="@+id/wallRefresh"
android:layout_width="56dp"
android:layout_height="56dp"
android:background="@drawable/shape_item"
android:padding="16dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_setting_refresh" />
</LinearLayout>
<!-- 应用设置分组 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="8dp"
android:text="@string/setting_app"
android:textColor="@color/white"
android:textSize="14sp"
android:alpha="0.7" />
<!-- 将三个设置项放在一个共同的背景容器中 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_item"
android:orientation="vertical">
<!-- 播放器设置 -->
<LinearLayout
android:id="@+id/player"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16dp"
android:paddingBottom="12dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/hive_24px"
android:tint="@color/white" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/setting_player"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<!-- 无痕模式 -->
<LinearLayout
android:id="@+id/incognito"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/domino_mask_24px"
android:tint="@color/white" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/setting_incognito"
android:textColor="@color/white"
android:textSize="16sp" />
<com.fongmi.android.tv.ui.custom.CustomSwitch
android:id="@+id/incognitoSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<!-- 图片尺寸 -->
<LinearLayout
android:id="@+id/size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="12dp"
android:paddingBottom="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/select_all_24px"
android:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_size"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/sizeText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="Medium" />
</LinearLayout>
</LinearLayout>
<!-- 网络设置分组 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="8dp"
android:text="@string/setting_network"
android:textColor="@color/white"
android:textSize="14sp"
android:alpha="0.7" />
<!-- 将三个网络设置项放在一个共同的背景容器中 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_item"
android:orientation="vertical">
<!-- DoH设置 -->
<LinearLayout
android:id="@+id/doh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/globe_book_24px"
android:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_doh"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/dohText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="Google" />
</LinearLayout>
<!-- 代理设置 -->
<LinearLayout
android:id="@+id/proxy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_fab_link"
android:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_proxy"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/proxyText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="http" />
</LinearLayout>
<!-- 缓存设置 -->
<LinearLayout
android:id="@+id/cache"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/owl_24px"
android:tint="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="@string/setting_cache"
android:textColor="@color/white"
android:textSize="16sp" />
<TextView
android:id="@+id/cacheText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="1.0 MB" />
</LinearLayout>
</LinearLayout>
<!-- 备份与恢复分组 -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="8dp"
android:text="@string/setting_data"
android:textColor="@color/white"
android:textSize="14sp"
android:alpha="0.7" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_item"
android:orientation="horizontal"
android:padding="0dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:src="@drawable/photo_prints_24px"
android:tint="@color/white" />
<TextView
android:id="@+id/backup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/setting_backup"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/restore"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:text="@string/setting_restore"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/version"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_item"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_setting_github"
android:tint="@color/white" />
<TextView
android:id="@+id/versionText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/setting_version"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="版本 3.0.3" />
</LinearLayout>
<LinearLayout
android:id="@+id/about"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/shape_item"
android:orientation="horizontal">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/egg_24px"
android:tint="@color/white" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="关于"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>