Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
适配优化
Browse files Browse the repository at this point in the history
  • Loading branch information
snpmyn committed Jan 15, 2021
1 parent 29ece83 commit 02bc51c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
| 二方库Util-UtilOne ||
| 二方库Util-UtilTwo ||

### 问题
#### autosize
> AutoSizeInitConfigure 用 Log.d(xxx, xxx),须替换为公共方法。
> 用 AndroidAutoSize 致 MaterialDesignAlertDialogBuilder 创建对话框向右偏移。
### 使用
> [SECURITY](https://github.com/snpmyn/Widget/blob/master/SECURITY.md)<br>
> 版本快速迭代中,拉取失败暂时查看源码。
Expand Down Expand Up @@ -141,12 +146,12 @@ android {
}
dependencies {
implementation 'com.github.snpmyn.Widget:library:v0.0.1.2X'
implementation 'com.github.snpmyn.Widget:matisse:v0.0.1.2X'
implementation 'com.github.snpmyn.Widget:ucrop:v0.0.1.2X'
implementation 'com.github.snpmyn.Widget:BgaQrCodeAndroid:v0.0.1.2X'
implementation 'com.github.snpmyn.Widget:banner:v0.0.1.2X'
implementation 'com.github.snpmyn.Widget:autosize:v0.0.1.2X'
implementation 'com.github.snpmyn.Widget:library:v0.0.1.3X'
implementation 'com.github.snpmyn.Widget:matisse:v0.0.1.3X'
implementation 'com.github.snpmyn.Widget:ucrop:v0.0.1.3X'
implementation 'com.github.snpmyn.Widget:BgaQrCodeAndroid:v0.0.1.3X'
implementation 'com.github.snpmyn.Widget:banner:v0.0.1.3X'
implementation 'com.github.snpmyn.Widget:autosize:v0.0.1.3X'
}
```

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ currently being supported with security updates.

| Version | Supported |
|:-------:|:-----------------:|
| v0.0.1.3X | :x: |
| v0.0.1.2X | :white_check_mark: |
| v0.0.1.4X | :x: |
| v0.0.1.3X | :white_check_mark: |

## Reporting a Vulnerability

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- 项目所有页都仅需以高宽其一作基准适配仅需填高宽其一设计图尺寸 -->
<!-- 副单位(pt、in、mm)可直像素填设计图尺寸(无需转像素为dp) -->
<!--在清单文件填全局设计图尺寸(单位 dp)-->
<!--用副单位(pt、in、mm)可直像素填设计图尺寸(无需转像素为 dp)-->
<meta-data
android:name="design_width_in_dp"
android:value="360" />
Expand Down
2 changes: 1 addition & 1 deletion autosize/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
/*自带*/
implementation 'me.jessyan:autosize:1.1.2'
implementation 'me.jessyan:autosize:1.2.1'
/*AutoSize*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@

import android.app.Activity;
import android.app.Application;
import android.util.Log;

import java.util.Locale;

import me.jessyan.autosize.AutoSize;
import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.onAdaptListener;
import me.jessyan.autosize.utils.LogUtils;

/**
* Created on 2019/7/18.
*
* @author 郑少鹏
* @desc AutoSize初始化配置
* @desc AutoSize 初始化配置
*/
public class AutoSizeInitConfigure {
public static void initAutoSize(Application application) {
// 应用多进程且适配所有进程需初始时调initCompatMultiProcess(Context context)
// 应用多进程且适配所有进程需初始时调 initCompatMultiProcess(Context context)
AutoSize.initCompatMultiProcess(application);
// 自定AndroidAutoSize
// 开启支持 Fragment 自定参数功能
AutoSizeConfig.getInstance().setCustomFragment(true);
// 自定 AndroidAutoSize
AutoSizeConfig.getInstance()
// 屏幕适配监听器
.setOnAdaptListener(new onAdaptListener() {
@Override
public void onAdaptBefore(Object target, Activity activity) {
LogUtils.d(String.format(Locale.ENGLISH, "%s onAdaptBefore!", target.getClass().getName()));
Log.d(this.getClass().getSimpleName(), String.format(Locale.ENGLISH, "%s onAdaptBefore!", target.getClass().getName()));
}

@Override
public void onAdaptAfter(Object target, Activity activity) {
LogUtils.d(String.format(Locale.ENGLISH, "%s onAdaptAfter!", target.getClass().getName()));
Log.d(this.getClass().getSimpleName(), String.format(Locale.ENGLISH, "%s onAdaptAfter!", target.getClass().getName()));
}
});
}
Expand Down

0 comments on commit 02bc51c

Please sign in to comment.