Skip to content

Commit

Permalink
适配Android 13,优化内部逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
molihuan committed Dec 26, 2022
1 parent 29f0574 commit 3fecf13
Show file tree
Hide file tree
Showing 24 changed files with 849 additions and 324 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
.externalNativeBuild
.cxx
local.properties
app/build
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ android {
dependencies {
implementation fileTree(dir: "libs", includes: ["*.aar", "*.jar"])
//文件选择器(包含权限请求)
implementation 'io.github.molihuan:pathselector:1.1.5'
implementation 'io.github.molihuan:pathselector:1.1.6'
//RxFFmpeg依赖
implementation 'com.github.microshow:RxFFmpeg:4.9.0-lite'
//bugly依赖
Expand All @@ -47,6 +47,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0'
//XUI


implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
Expand Down
Binary file not shown.
3 changes: 3 additions & 0 deletions app/src/main/java/com/molihua/hlbmerge/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.molihua.hlbmerge.dao.ConfigData;
import com.molihuan.pathselector.PathSelector;
import com.molihuan.pathselector.configs.PathSelectorConfig;
import com.tencent.bugly.Bugly;
import com.tencent.mmkv.MMKV;
import com.xuexiang.xui.XUI;
Expand Down Expand Up @@ -32,6 +33,8 @@ public void onCreate() {
ConfigData.init();
//路径选择器debug
PathSelector.setDebug(true);
//取消自动申请权限
PathSelectorConfig.setAutoGetPermission(false);

super.onCreate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationView;
import com.molihua.hlbmerge.fragment.AbstractMainFileShowFragment;
import com.molihua.hlbmerge.interfaces.IMainFileShowFragment;
import com.molihua.hlbmerge.interfaces.IMainTitlebarFragment;

Expand All @@ -23,4 +24,6 @@ public abstract class AbstractMainActivity extends BaseActivity implements IMain
public abstract void showHideNavigation(boolean status);

public abstract void handleShowHide(boolean isShow);

public abstract AbstractMainFileShowFragment getMainFileShowFragment();
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public void getComponents() {

@Override
public void initData() {

//申请权限
PermissionsTools.getStoragePermissions(this);

mainTitlebarFragment = new MainTitlebarFragment();
Expand Down Expand Up @@ -187,6 +189,11 @@ public NavigationView getNavigationView() {
return navigationView;
}

@Override
public AbstractMainFileShowFragment getMainFileShowFragment() {
return mainFileShowFragment;
}

@Override
public void showHideNavigation(boolean status) {
if (status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.widget.CompoundButton;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.molihua.hlbmerge.R;
import com.molihua.hlbmerge.dao.ConfigData;
Expand All @@ -17,6 +18,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
* @ClassName: JudgeMergeDialog
Expand All @@ -26,14 +28,29 @@
*/
public class MergeOptionDialog {


public static MaterialDialog showMergeOptionDialog(CacheFile cacheFile, Context context) {
/**
* 单个合并
*
* @param cacheFile
* @param fragment
* @return
*/
public static MaterialDialog showMergeOptionDialog(CacheFile cacheFile, Fragment fragment) {
List<CacheFile> cacheFileList = new ArrayList<>();
cacheFileList.add(cacheFile);
return showMergeOptionDialog(cacheFileList, context);
return showMergeOptionDialog(cacheFileList, fragment);
}

public static MaterialDialog showMergeOptionDialog(List<CacheFile> cacheFileList, Context context) {
/**
* 多个合并
*
* @param cacheFileList
* @param fragment
* @return
*/
public static MaterialDialog showMergeOptionDialog(List<CacheFile> cacheFileList, Fragment fragment) {
Context context = fragment.getContext();
Objects.requireNonNull(context, "context is null");

View dialog_judgemerge = LayoutInflater.from(context).inflate(R.layout.dialog_judge_merge, null);
MaterialSpinner dialog_materialspinner = dialog_judgemerge.findViewById(R.id.dialog_materialspinner);
Expand Down Expand Up @@ -68,7 +85,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
//打开合并进度窗口
MergeProgressDialog.showMergeProgressDialog(cacheFileList, context);
MergeProgressDialog.showMergeProgressDialog(cacheFileList, fragment);
}
})
.negativeText("取消")
Expand Down
Loading

0 comments on commit 3fecf13

Please sign in to comment.