mirror of https://github.com/FongMi/TV.git
parent
ca61f38445
commit
18ed56955e
@ -1,54 +0,0 @@ |
||||
package com.fongmi.android.tv.ui.dialog; |
||||
|
||||
import android.content.DialogInterface; |
||||
import android.view.LayoutInflater; |
||||
|
||||
import androidx.appcompat.app.AlertDialog; |
||||
import androidx.fragment.app.Fragment; |
||||
|
||||
import com.fongmi.android.tv.R; |
||||
import com.fongmi.android.tv.Setting; |
||||
import com.fongmi.android.tv.databinding.DialogDanmuAlphaBinding; |
||||
import com.fongmi.android.tv.impl.DanmuAlphaCallback; |
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder; |
||||
|
||||
public class DanmuAlphaDialog { |
||||
|
||||
private final DialogDanmuAlphaBinding binding; |
||||
private final DanmuAlphaCallback callback; |
||||
private int value; |
||||
|
||||
public static DanmuAlphaDialog create(Fragment fragment) { |
||||
return new DanmuAlphaDialog(fragment); |
||||
} |
||||
|
||||
public DanmuAlphaDialog(Fragment fragment) { |
||||
this.callback = (DanmuAlphaCallback) fragment; |
||||
this.binding = DialogDanmuAlphaBinding.inflate(LayoutInflater.from(fragment.getContext())); |
||||
} |
||||
|
||||
public void show() { |
||||
initDialog(); |
||||
initView(); |
||||
} |
||||
|
||||
private void initDialog() { |
||||
AlertDialog dialog = new MaterialAlertDialogBuilder(binding.getRoot().getContext()).setTitle(R.string.player_danmu_alpha).setView(binding.getRoot()).setPositiveButton(R.string.dialog_positive, this::onPositive).setNegativeButton(R.string.dialog_negative, this::onNegative).create(); |
||||
dialog.getWindow().setDimAmount(0); |
||||
dialog.show(); |
||||
} |
||||
|
||||
private void initView() { |
||||
binding.slider.setValue(value = Setting.getDanmuAlpha()); |
||||
} |
||||
|
||||
private void onPositive(DialogInterface dialog, int which) { |
||||
callback.setDanmuAlpha((int) binding.slider.getValue()); |
||||
dialog.dismiss(); |
||||
} |
||||
|
||||
private void onNegative(DialogInterface dialog, int which) { |
||||
callback.setDanmuAlpha(value); |
||||
dialog.dismiss(); |
||||
} |
||||
} |
||||
@ -0,0 +1,83 @@ |
||||
package com.fongmi.android.tv.ui.dialog; |
||||
|
||||
import android.view.LayoutInflater; |
||||
import android.view.View; |
||||
import android.view.ViewGroup; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
import androidx.annotation.Nullable; |
||||
import androidx.fragment.app.Fragment; |
||||
import androidx.fragment.app.FragmentActivity; |
||||
import androidx.viewbinding.ViewBinding; |
||||
|
||||
import com.fongmi.android.tv.R; |
||||
import com.fongmi.android.tv.Setting; |
||||
import com.fongmi.android.tv.databinding.DialogDanmuBinding; |
||||
import com.fongmi.android.tv.ui.activity.VideoActivity; |
||||
import com.fongmi.android.tv.utils.ResUtil; |
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment; |
||||
import com.google.android.material.slider.Slider; |
||||
|
||||
public class DanmuDialog extends BaseDialog { |
||||
|
||||
private DialogDanmuBinding binding; |
||||
private String[] danmuSpeed; |
||||
private int speed; |
||||
private VideoActivity activity; |
||||
|
||||
public static DanmuDialog create() { |
||||
return new DanmuDialog(); |
||||
} |
||||
|
||||
public DanmuDialog() { |
||||
} |
||||
|
||||
public DanmuDialog show(FragmentActivity activity) { |
||||
for (Fragment f : activity.getSupportFragmentManager().getFragments()) if (f instanceof BottomSheetDialogFragment) return this; |
||||
show(activity.getSupportFragmentManager(), null); |
||||
this.activity = (VideoActivity) activity; |
||||
return this; |
||||
} |
||||
|
||||
@Override |
||||
protected ViewBinding getBinding(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) { |
||||
return binding = DialogDanmuBinding.inflate(inflater, container, false); |
||||
} |
||||
|
||||
@Override |
||||
protected void initView() { |
||||
binding.list.setVisibility(View.VISIBLE); |
||||
binding.speed.setValue(speed = Setting.getDanmuSpeed()); |
||||
binding.size.setValue(Setting.getDanmuSize()); |
||||
binding.line.setValue(Setting.getDanmuLine(2)); |
||||
binding.alpha.setValue(Setting.getDanmuAlpha()); |
||||
binding.speedText.setText((danmuSpeed = ResUtil.getStringArray(R.array.select_danmu_speed))[speed]); |
||||
} |
||||
|
||||
@Override |
||||
protected void initEvent() { |
||||
binding.speed.addOnChangeListener((@NonNull Slider slider, float value, boolean fromUser) -> { |
||||
int val = (int) slider.getValue(); |
||||
binding.speedText.setText(danmuSpeed[val]); |
||||
Setting.putDanmuSpeed(val); |
||||
this.activity.setDanmuViewSettings(); |
||||
}); |
||||
binding.size.addOnChangeListener((@NonNull Slider slider, float value, boolean fromUser) -> { |
||||
Setting.putDanmuSize(slider.getValue()); |
||||
this.activity.setDanmuViewSettings(); |
||||
}); |
||||
binding.line.addOnChangeListener((@NonNull Slider slider, float value, boolean fromUser) -> { |
||||
Setting.putDanmuLine((int) slider.getValue()); |
||||
this.activity.setDanmuViewSettings(); |
||||
}); |
||||
binding.alpha.addOnChangeListener((@NonNull Slider slider, float value, boolean fromUser) -> { |
||||
Setting.putDanmuAlpha((int) slider.getValue()); |
||||
this.activity.setDanmuViewSettings(); |
||||
}); |
||||
} |
||||
|
||||
@Override |
||||
public void dismiss() { |
||||
super.dismiss(); |
||||
} |
||||
} |
||||
@ -1,54 +0,0 @@ |
||||
package com.fongmi.android.tv.ui.dialog; |
||||
|
||||
import android.content.DialogInterface; |
||||
import android.view.LayoutInflater; |
||||
|
||||
import androidx.appcompat.app.AlertDialog; |
||||
import androidx.fragment.app.Fragment; |
||||
|
||||
import com.fongmi.android.tv.R; |
||||
import com.fongmi.android.tv.Setting; |
||||
import com.fongmi.android.tv.databinding.DialogDanmuLineBinding; |
||||
import com.fongmi.android.tv.impl.DanmuLineCallback; |
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder; |
||||
|
||||
public class DanmuLineDialog { |
||||
|
||||
private final DialogDanmuLineBinding binding; |
||||
private final DanmuLineCallback callback; |
||||
private int value; |
||||
|
||||
public static DanmuLineDialog create(Fragment fragment) { |
||||
return new DanmuLineDialog(fragment); |
||||
} |
||||
|
||||
public DanmuLineDialog(Fragment fragment) { |
||||
this.callback = (DanmuLineCallback) fragment; |
||||
this.binding = DialogDanmuLineBinding.inflate(LayoutInflater.from(fragment.getContext())); |
||||
} |
||||
|
||||
public void show() { |
||||
initDialog(); |
||||
initView(); |
||||
} |
||||
|
||||
private void initDialog() { |
||||
AlertDialog dialog = new MaterialAlertDialogBuilder(binding.getRoot().getContext()).setTitle(R.string.player_danmu_line).setView(binding.getRoot()).setPositiveButton(R.string.dialog_positive, this::onPositive).setNegativeButton(R.string.dialog_negative, this::onNegative).create(); |
||||
dialog.getWindow().setDimAmount(0); |
||||
dialog.show(); |
||||
} |
||||
|
||||
private void initView() { |
||||
binding.slider.setValue(value = Setting.getDanmuLine(2)); |
||||
} |
||||
|
||||
private void onPositive(DialogInterface dialog, int which) { |
||||
callback.setDanmuLine((int) binding.slider.getValue()); |
||||
dialog.dismiss(); |
||||
} |
||||
|
||||
private void onNegative(DialogInterface dialog, int which) { |
||||
callback.setDanmuLine(value); |
||||
dialog.dismiss(); |
||||
} |
||||
} |
||||
@ -1,54 +0,0 @@ |
||||
package com.fongmi.android.tv.ui.dialog; |
||||
|
||||
import android.content.DialogInterface; |
||||
import android.view.LayoutInflater; |
||||
|
||||
import androidx.appcompat.app.AlertDialog; |
||||
import androidx.fragment.app.Fragment; |
||||
|
||||
import com.fongmi.android.tv.R; |
||||
import com.fongmi.android.tv.Setting; |
||||
import com.fongmi.android.tv.databinding.DialogDanmuSizeBinding; |
||||
import com.fongmi.android.tv.impl.DanmuSizeCallback; |
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder; |
||||
|
||||
public class DanmuSizeDialog { |
||||
|
||||
private final DialogDanmuSizeBinding binding; |
||||
private final DanmuSizeCallback callback; |
||||
private float value; |
||||
|
||||
public static DanmuSizeDialog create(Fragment fragment) { |
||||
return new DanmuSizeDialog(fragment); |
||||
} |
||||
|
||||
public DanmuSizeDialog(Fragment fragment) { |
||||
this.callback = (DanmuSizeCallback) fragment; |
||||
this.binding = DialogDanmuSizeBinding.inflate(LayoutInflater.from(fragment.getContext())); |
||||
} |
||||
|
||||
public void show() { |
||||
initDialog(); |
||||
initView(); |
||||
} |
||||
|
||||
private void initDialog() { |
||||
AlertDialog dialog = new MaterialAlertDialogBuilder(binding.getRoot().getContext()).setTitle(R.string.player_danmu_size).setView(binding.getRoot()).setPositiveButton(R.string.dialog_positive, this::onPositive).setNegativeButton(R.string.dialog_negative, this::onNegative).create(); |
||||
dialog.getWindow().setDimAmount(0); |
||||
dialog.show(); |
||||
} |
||||
|
||||
private void initView() { |
||||
binding.slider.setValue(value = Setting.getDanmuSize()); |
||||
} |
||||
|
||||
private void onPositive(DialogInterface dialog, int which) { |
||||
callback.setDanmuSize(binding.slider.getValue()); |
||||
dialog.dismiss(); |
||||
} |
||||
|
||||
private void onNegative(DialogInterface dialog, int which) { |
||||
callback.setDanmuSize(value); |
||||
dialog.dismiss(); |
||||
} |
||||
} |
||||
@ -1,104 +0,0 @@ |
||||
package com.fongmi.android.tv.ui.fragment; |
||||
|
||||
import android.view.LayoutInflater; |
||||
import android.view.View; |
||||
import android.view.ViewGroup; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
import androidx.annotation.Nullable; |
||||
import androidx.viewbinding.ViewBinding; |
||||
|
||||
import com.fongmi.android.tv.R; |
||||
import com.fongmi.android.tv.Setting; |
||||
import com.fongmi.android.tv.databinding.FragmentSettingDanmuBinding; |
||||
import com.fongmi.android.tv.impl.DanmuAlphaCallback; |
||||
import com.fongmi.android.tv.impl.DanmuLineCallback; |
||||
import com.fongmi.android.tv.impl.DanmuSizeCallback; |
||||
import com.fongmi.android.tv.ui.base.BaseFragment; |
||||
import com.fongmi.android.tv.ui.dialog.DanmuAlphaDialog; |
||||
import com.fongmi.android.tv.ui.dialog.DanmuLineDialog; |
||||
import com.fongmi.android.tv.ui.dialog.DanmuSizeDialog; |
||||
import com.fongmi.android.tv.utils.ResUtil; |
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder; |
||||
|
||||
public class SettingDanmuFragment extends BaseFragment implements DanmuLineCallback, DanmuSizeCallback, DanmuAlphaCallback { |
||||
|
||||
private FragmentSettingDanmuBinding mBinding; |
||||
private String[] danmuSpeed; |
||||
|
||||
public static SettingDanmuFragment newInstance() { |
||||
return new SettingDanmuFragment(); |
||||
} |
||||
|
||||
private String getSwitch(boolean value) { |
||||
return getString(value ? R.string.setting_on : R.string.setting_off); |
||||
} |
||||
|
||||
@Override |
||||
protected ViewBinding getBinding(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) { |
||||
return mBinding = FragmentSettingDanmuBinding.inflate(inflater, container, false); |
||||
} |
||||
|
||||
@Override |
||||
protected void initView() { |
||||
mBinding.danmuLoadText.setText(getSwitch(Setting.isDanmuLoad())); |
||||
mBinding.danmuSizeText.setText(String.valueOf(Setting.getDanmuSize())); |
||||
mBinding.danmuLineText.setText(String.valueOf(Setting.getDanmuLine(2))); |
||||
mBinding.danmuAlphaText.setText(String.valueOf(Setting.getDanmuAlpha())); |
||||
mBinding.danmuSpeedText.setText((danmuSpeed = ResUtil.getStringArray(R.array.select_danmu_speed))[Setting.getDanmuSpeed()]); |
||||
} |
||||
|
||||
@Override |
||||
protected void initEvent() { |
||||
mBinding.danmuSize.setOnClickListener(this::onDanmuSize); |
||||
mBinding.danmuLine.setOnClickListener(this::onDanmuLine); |
||||
mBinding.danmuLoad.setOnClickListener(this::setDanmuLoad); |
||||
mBinding.danmuAlpha.setOnClickListener(this::onDanmuAlpha); |
||||
mBinding.danmuSpeed.setOnClickListener(this::onDanmuSpeed); |
||||
} |
||||
|
||||
|
||||
private void onDanmuSize(View view) { |
||||
DanmuSizeDialog.create(this).show(); |
||||
} |
||||
|
||||
@Override |
||||
public void setDanmuSize(float size) { |
||||
mBinding.danmuSizeText.setText(String.valueOf(size)); |
||||
Setting.putDanmuSize(size); |
||||
} |
||||
|
||||
private void onDanmuLine(View view) { |
||||
DanmuLineDialog.create(this).show(); |
||||
} |
||||
|
||||
@Override |
||||
public void setDanmuLine(int line) { |
||||
mBinding.danmuLineText.setText(String.valueOf(line)); |
||||
Setting.putDanmuLine(line); |
||||
} |
||||
|
||||
private void setDanmuLoad(View view) { |
||||
Setting.putDanmuLoad(!Setting.isDanmuLoad()); |
||||
mBinding.danmuLoadText.setText(getSwitch(Setting.isDanmuLoad())); |
||||
} |
||||
|
||||
private void onDanmuAlpha(View view) { |
||||
DanmuAlphaDialog.create(this).show(); |
||||
} |
||||
|
||||
@Override |
||||
public void setDanmuAlpha(int alpha) { |
||||
mBinding.danmuAlphaText.setText(String.valueOf(alpha)); |
||||
Setting.putDanmuAlpha(alpha); |
||||
} |
||||
|
||||
private void onDanmuSpeed(View view) { |
||||
new MaterialAlertDialogBuilder(getActivity()).setTitle(R.string.player_danmu_speed).setNegativeButton(R.string.dialog_negative, null).setSingleChoiceItems(danmuSpeed, Setting.getDanmuSpeed(), (dialog, which) -> { |
||||
mBinding.danmuSpeedText.setText(danmuSpeed[which]); |
||||
Setting.putDanmuSpeed(which); |
||||
dialog.dismiss(); |
||||
}).show(); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,13 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:width="24dp" |
||||
android:height="24dp" |
||||
android:viewportWidth="24" |
||||
android:viewportHeight="24"> |
||||
<path |
||||
android:fillColor="#FFFFFF" |
||||
android:fillType="evenOdd" |
||||
android:pathData="m15.645 4.881 1.06-1.473a.998.998 0 1 0-1.622-1.166L13.22 4.835a110.67 110.67 0 0 0-1.1-.007h-.131c-.47 0-.975.004-1.515.012L8.783 2.3A.998.998 0 0 0 7.12 3.408l.988 1.484c-.688.019-1.418.042-2.188.069a4.013 4.013 0 0 0-3.83 3.44c-.165 1.15-.245 2.545-.245 4.185 0 1.965.115 3.67.35 5.116a4.012 4.012 0 0 0 3.763 3.363c1.903.094 3.317.141 5.513.141a.988.988 0 0 0 0-1.975 97.58 97.58 0 0 1-5.416-.139 2.037 2.037 0 0 1-1.91-1.708c-.216-1.324-.325-2.924-.325-4.798 0-1.563.076-2.864.225-3.904.14-.977.96-1.713 1.945-1.747 2.444-.087 4.465-.13 6.063-.131 1.598 0 3.62.044 6.064.13.96.034 1.71.81 1.855 1.814.075.524.113 1.962.141 3.065v.002c.005.183.01.07.014-.038.004-.096.008-.189.011-.081a.987.987 0 1 0 1.974-.069c-.004-.105-.007-.009-.011.09-.002.056-.004.112-.007.135l-.002.01a.574.574 0 0 1-.005-.091v-.027c-.03-1.118-.073-2.663-.16-3.276-.273-1.906-1.783-3.438-3.74-3.507-.905-.032-1.752-.058-2.543-.079Zm-3.113 4.703h-1.307v4.643h2.2v.04l.651-1.234c.113-.215.281-.389.482-.509v-.11h.235c.137-.049.283-.074.433-.074h1.553V9.584h-1.264a8.5 8.5 0 0 0 .741-1.405l-1.078-.381c-.24.631-.501 1.23-.806 1.786h-1.503l.686-.305c-.228-.501-.5-.959-.806-1.394l-1.034.348c.294.392.566.839.817 1.35Zm-1.7 5.502h2.16l-.564 1.068h-1.595v-1.068Zm-2.498-1.863.152-1.561h1.96V8.289H7.277v.969h2.048v1.435h-1.84l-.306 3.51h2.254c0 1.155-.043 1.906-.12 2.255-.076.348-.38.523-.925.523-.305 0-.61-.022-.893-.055l.294 1.056.061.005c.282.02.546.039.81.039.991-.065 1.547-.414 1.677-1.046.11-.631.175-1.883.175-3.757H8.334Zm5.09-.8v.85h-1.188v-.85h1.187Zm-1.188-.955h1.187v-.893h-1.187v.893Zm2.322.007v-.893h1.241v.893h-1.241Zm.528 2.757a1.26 1.26 0 0 1 1.087-.627l4.003-.009a1.26 1.26 0 0 1 1.094.63l1.721 2.982c.226.39.225.872-.001 1.263l-1.743 3a1.26 1.26 0 0 1-1.086.628l-4.003.009a1.26 1.26 0 0 1-1.094-.63l-1.722-2.982a1.26 1.26 0 0 1 .002-1.263l1.742-3Zm1.967.858a1.26 1.26 0 0 0-1.08.614l-.903 1.513a1.26 1.26 0 0 0-.002 1.289l.885 1.492c.227.384.64.62 1.086.618l2.192-.005a1.26 1.26 0 0 0 1.08-.615l.904-1.518a1.26 1.26 0 0 0 .001-1.288l-.884-1.489a1.26 1.26 0 0 0-1.086-.616l-2.193.005Zm2.517 2.76a1.4 1.4 0 1 1-2.8 0 1.4 1.4 0 0 1 2.8 0Z" |
||||
android:strokeWidth="1" |
||||
android:strokeColor="#00000000" /> |
||||
</vector> |
||||
@ -0,0 +1,179 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout 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="wrap_content" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:text="@string/play_danmu" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:textSize="16sp" /> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/list" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
android:paddingStart="16dp" |
||||
android:paddingTop="8dp" |
||||
android:paddingEnd="16dp" |
||||
android:paddingBottom="8dp" |
||||
android:visibility="gone" |
||||
tools:visibility="visible"> |
||||
|
||||
<LinearLayout |
||||
android:orientation="horizontal" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<TextView |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:text="@string/player_danmu_speed" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:gravity="center_vertical|left" |
||||
android:textSize="16sp" /> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/speed" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="3" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="center_vertical|center" |
||||
android:stepSize="1" |
||||
android:valueFrom="0" |
||||
android:valueTo="3" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/speedText" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center_vertical|center_horizontal" |
||||
android:text="适中" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:orientation="horizontal" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<TextView |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:text="@string/player_danmu_size" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:gravity="center_vertical|left" |
||||
android:textSize="16sp" /> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/size" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="3" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="center_vertical|center" |
||||
android:stepSize="0.2" |
||||
android:valueFrom="0.6" |
||||
android:valueTo="2" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/sizeText" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center_vertical|center_horizontal" |
||||
android:text="@string/times" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:orientation="horizontal" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<TextView |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:text="@string/player_danmu_line" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:gravity="center_vertical|left" |
||||
android:textSize="16sp" /> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/line" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="3" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="center_vertical|center" |
||||
android:stepSize="1" |
||||
android:valueFrom="1" |
||||
android:valueTo="15" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/lineText" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center_vertical|center_horizontal" |
||||
android:text="@string/lines" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:orientation="horizontal" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content"> |
||||
|
||||
<TextView |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:text="@string/player_danmu_alpha" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:gravity="center_vertical|left" |
||||
android:textSize="16sp" /> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/alpha" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="3" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="center_vertical|center" |
||||
android:stepSize="5" |
||||
android:valueFrom="10" |
||||
android:valueTo="100" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/alphaText" |
||||
android:layout_width="0dp" |
||||
android:layout_weight="1" |
||||
android:layout_height="match_parent" |
||||
android:gravity="center_vertical|center_horizontal" |
||||
android:text="%" |
||||
android:textColor="?android:attr/textColorPrimary" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
||||
</LinearLayout> |
||||
@ -1,20 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
android:paddingStart="24dp" |
||||
android:paddingTop="16dp" |
||||
android:paddingEnd="24dp"> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/slider" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:stepSize="5" |
||||
android:valueFrom="10" |
||||
android:valueTo="100" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
</LinearLayout> |
||||
@ -1,20 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
android:paddingStart="24dp" |
||||
android:paddingTop="16dp" |
||||
android:paddingEnd="24dp"> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/slider" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:stepSize="1" |
||||
android:valueFrom="1" |
||||
android:valueTo="15" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
</LinearLayout> |
||||
@ -1,20 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="vertical" |
||||
android:paddingStart="24dp" |
||||
android:paddingTop="16dp" |
||||
android:paddingEnd="24dp"> |
||||
|
||||
<com.google.android.material.slider.Slider |
||||
android:id="@+id/slider" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:stepSize="0.2" |
||||
android:valueFrom="0.6" |
||||
android:valueTo="2" |
||||
app:trackColorInactive="@color/blue_50" /> |
||||
|
||||
</LinearLayout> |
||||
@ -1,210 +0,0 @@ |
||||
<?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"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:text="@string/setting_danmu" |
||||
android:textColor="@color/white" |
||||
android:textSize="20sp" |
||||
android:textStyle="bold" |
||||
app:layout_scrollFlags="scroll|enterAlways" /> |
||||
|
||||
</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="16dp" |
||||
android:paddingTop="16dp" |
||||
android:paddingEnd="16dp" |
||||
android:paddingBottom="16dp"> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/danmuLoad" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp" |
||||
android:background="@drawable/shape_item" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="16dp" |
||||
android:text="@string/player_danmu_load" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/danmuLoadText" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" |
||||
tools:text="開" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/danmuSpeed" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp" |
||||
android:background="@drawable/shape_item" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="16dp" |
||||
android:text="@string/player_danmu_speed" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/danmuSpeedText" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" |
||||
tools:text="慢" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/danmuSize" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp" |
||||
android:background="@drawable/shape_item" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="16dp" |
||||
android:text="@string/player_danmu_size" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/danmuSizeText" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:gravity="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" |
||||
tools:text="1" /> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="4dp" |
||||
android:text="@string/times" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/danmuLine" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp" |
||||
android:background="@drawable/shape_item" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="16dp" |
||||
android:text="@string/player_danmu_line" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/danmuLineText" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:gravity="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" |
||||
tools:text="1" /> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="4dp" |
||||
android:text="@string/lines" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/danmuAlpha" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp" |
||||
android:background="@drawable/shape_item" |
||||
android:orientation="horizontal"> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="16dp" |
||||
android:text="@string/player_danmu_alpha" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/danmuAlphaText" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:gravity="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" |
||||
tools:text="1" /> |
||||
|
||||
<TextView |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginStart="4dp" |
||||
android:text="%" |
||||
android:textColor="@color/white" |
||||
android:textSize="16sp" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
</LinearLayout> |
||||
</androidx.core.widget.NestedScrollView> |
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout> |
||||
Loading…
Reference in new issue