Skip to content

Commit

Permalink
优化文件选择器ui,去除本地视频倍速振动
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoRanLiu3119 committed Nov 22, 2023
1 parent 1392b9b commit 910ec89
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.VibrateUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.api.ApiConfig;
Expand Down Expand Up @@ -916,7 +915,6 @@ public void onLongPress(MotionEvent e) {
mControlWrapper.setSpeed(speed);
mLlSpeed.setVisibility(VISIBLE);
mTvSpeedTip.setText(speed + "x");
VibrateUtils.vibrate(200);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void onDenied(List<String> permissions, boolean never) {
}

private void pickFile() {
new ChooserDialog(SubscriptionActivity.this)
new ChooserDialog(SubscriptionActivity.this,R.style.FileChooser)
.withFilter(false, false, "txt", "json")
.withStartFile(TextUtils.isEmpty(Hawk.get("before_selected_path"))?"/storage/emulated/0/Download":Hawk.get("before_selected_path"))
.withChosenListener(new ChooserDialog.Result() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public void run() {
subtitleDialog.setLocalFileChooserListener(new SubtitleDialog.LocalFileChooserListener() {
@Override
public void openLocalFileChooserDialog() {
new ChooserDialog(getActivity())
new ChooserDialog(getActivity(),R.style.FileChooser)
.withFilter(false, false, "srt", "ass", "scc", "stl", "ttml")
.withStartFile("/storage/emulated/0/Download")
.withChosenListener(new ChooserDialog.Result() {
Expand Down
49 changes: 49 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,53 @@

</style>

<!--文件选择器样式,在此只改变了背景和基本颜色-->
<style name="FileChooser" parent="FileChooserStyle">
<item name="android:textColor">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/colorPrimary</item>
<item name="android:textColorSecondary">@color/colorPrimary</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/material_deep_teal_200</item>
<item name="fileChooserDialogStyle">@style/FileChooserDialogStyle1</item>
<item name="fileChooserListItemStyle">@style/FileChooserListItemStyle1</item>
<item name="fileChooserPathViewStyle">@style/FileChooserPathViewStyle1</item>
</style>

<!--选择器弹窗样式-->
<style name="FileChooserDialogStyle1" parent="FileChooserDialogStyle">
<item name="android:windowBackground">@drawable/bg_large_round_popup</item>
<item name="android:buttonBarButtonStyle">@style/FileChooserButtonStyle1</item>
<item name="buttonBarButtonStyle">@style/FileChooserButtonStyle1</item>
</style>
<style name="FileChooserButtonStyle1" parent="FileChooserButtonStyle">
<item name="android:textColor">@color/black</item>
</style>
<!-- 选择器弹窗样式结束-->

<!--文件选择器条目样式开始-->
<style name="FileChooserListItemStyle1" parent="FileChooserListItemStyle">
<item name="fileChooserTextNameStyle">@style/FileChooserTextNameStyle1</item>
<item name="fileChooserTextSizeStyle">@style/FileChooserTextSizeStyle1</item>
<item name="fileChooserTextDateStyle">@style/FileChooserTextDateStyle1</item>
<item name="android:background">@android:color/transparent</item>
</style>
<style name="FileChooserTextNameStyle1" parent="FileChooserTextNameStyle">
<item name="android:textColor">@color/text_gray</item>
</style>
<style name="FileChooserTextSizeStyle1" parent="FileChooserTextSizeStyle">
<item name="android:textColor">@color/colorPrimary</item>
</style>
<style name="FileChooserTextDateStyle1" parent="FileChooserTextDateStyle">
<item name="android:textColor">@color/colorPrimary</item>
</style>
<!-- 文件选择器条目样式结束-->

<!-- 选择器文件路径样式 -->
<style name="FileChooserPathViewStyle1" parent="FileChooserPathViewStyle">
<item name="android:background">@android:color/transparent</item>
<item name="android:textColor">@color/text_gray</item>
</style>


</resources>

0 comments on commit 910ec89

Please sign in to comment.