Skip to content

Commit 72d84e4

Browse files
committed
see 02/10 log
1 parent 6a1cb73 commit 72d84e4

29 files changed

+583
-189
lines changed

app/build.gradle

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
plugins {
2-
id "tech.harmonysoft.oss.traute" version '1.0.5'
3-
}
41
apply plugin: 'com.android.application'
52

63
File signPropertiesFile = rootProject.file('sign/keystore.properties')
@@ -49,25 +46,17 @@ android {
4946
}
5047
}
5148

52-
traute {
53-
javacPluginVersion = trauteVersion
54-
}
55-
5649
dependencies {
5750
implementation fileTree(include: ['*.jar'], dir: 'libs')
5851
implementation project(':utilcode')
5952
implementation project(':subutil')
60-
6153
implementation "com.android.support:appcompat-v7:$support_version"
6254
implementation "com.android.support:design:$support_version"
63-
6455
implementation 'com.r0adkll:slidableactivity:2.0.5'
65-
6656
// LeakCanary
6757
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
6858
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
69-
70-
// implementation 'com.blankj:utilcode:1.12.5'
59+
// implementation 'com.blankj:utilcode:1.12.5'
7160
}
7261

7362

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<!--screen-->
3838
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
3939

40-
4140
<!--flashlight-->
4241
<uses-permission android:name="android.permission.CAMERA" />
4342

@@ -181,6 +180,9 @@
181180
<activity
182181
android:name=".feature.sub.SubUtilActivity"
183182
android:launchMode="singleTop" />
183+
<activity
184+
android:name=".feature.sub.brightness.BrightnessActivity"
185+
android:launchMode="singleTop" />
184186
<activity
185187
android:name=".feature.sub.location.LocationActivity"
186188
android:launchMode="singleTop" />

app/src/main/java/com/blankj/androidutilcode/UtilsApp.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.blankj.utilcode.util.ActivityUtils;
1010
import com.blankj.utilcode.util.CrashUtils;
1111
import com.blankj.utilcode.util.LogUtils;
12-
import com.blankj.utilcode.util.PermissionUtils;
1312
import com.squareup.leakcanary.LeakCanary;
1413

1514
/**
@@ -37,8 +36,6 @@ public void onCreate() {
3736
initLeakCanary();
3837
initLog();
3938
initCrash();
40-
41-
LogUtils.d(PermissionUtils.getPermissions());
4239
}
4340

4441
private void initLeakCanary() {
@@ -53,7 +50,7 @@ private void initLeakCanary() {
5350

5451
// init it in ur application
5552
public void initLog() {
56-
LogUtils.Config config = LogUtils.getConfig()
53+
final LogUtils.Config config = LogUtils.getConfig()
5754
.setLogSwitch(BuildConfig.DEBUG)// 设置 log 总开关,包括输出到控制台和文件,默认开
5855
.setConsoleSwitch(BuildConfig.DEBUG)// 设置是否输出到控制台开关,默认开
5956
.setGlobalTag(null)// 设置 log 全局标签,默认为空
@@ -67,7 +64,13 @@ public void initLog() {
6764
.setConsoleFilter(LogUtils.V)// log 的控制台过滤器,和 logcat 过滤器同理,默认 Verbose
6865
.setFileFilter(LogUtils.V)// log 文件过滤器,和 logcat 过滤器同理,默认 Verbose
6966
.setStackDeep(1);// log 栈深度,默认为 1
70-
LogUtils.d(config.toString());
67+
new Thread(new Runnable() {
68+
@Override
69+
public void run() {
70+
LogUtils.d(config.toString());
71+
}
72+
}).start();
73+
7174
}
7275

7376
private void initCrash() {

app/src/main/java/com/blankj/androidutilcode/feature/core/activity/ActivityActivity.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.blankj.androidutilcode.feature.core.CoreUtilActivity;
1919
import com.blankj.androidutilcode.MainActivity;
2020
import com.blankj.utilcode.util.ActivityUtils;
21+
import com.blankj.utilcode.util.LogUtils;
2122
import com.blankj.utilcode.util.SpanUtils;
2223

2324
import java.util.Random;
@@ -225,7 +226,7 @@ public void onWidgetClick(View view) {
225226
case R.id.btn_act_intents_opt:
226227
ActivityUtils.startActivities(this,
227228
intents,
228-
getOption(random.nextInt(3)));
229+
getOption(random.nextInt(5)));
229230
break;
230231
case R.id.btn_act_intents_anim:
231232
ActivityUtils.startActivities(this,
@@ -248,6 +249,7 @@ public void onWidgetClick(View view) {
248249
}
249250

250251
private Bundle getOption(int type) {
252+
LogUtils.d(type);
251253
switch (type) {
252254
case 0:
253255
return ActivityOptionsCompat.makeCustomAnimation(this,
@@ -266,16 +268,16 @@ private Bundle getOption(int type) {
266268
0, 0)
267269
.toBundle();
268270
case 3:
271+
return ActivityOptionsCompat.makeSceneTransitionAnimation(this,
272+
viewSharedElement,
273+
getString(R.string.activity_shared_element))
274+
.toBundle();
275+
case 4:
269276
return ActivityOptionsCompat.makeClipRevealAnimation(viewSharedElement,
270277
viewSharedElement.getWidth() / 2,
271278
viewSharedElement.getHeight() / 2,
272279
0, 0)
273280
.toBundle();
274-
case 4:
275-
return ActivityOptionsCompat.makeSceneTransitionAnimation(this,
276-
viewSharedElement,
277-
getString(R.string.activity_shared_element))
278-
.toBundle();
279281
default:
280282
return null;
281283
}

app/src/main/java/com/blankj/androidutilcode/feature/core/bar/BarStatusActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public void initView(Bundle savedInstanceState, View view) {
4646
tvAboutStatus = findViewById(R.id.tv_about_status);
4747
findViewById(R.id.btn_show_status).setOnClickListener(this);
4848
findViewById(R.id.btn_hide_status).setOnClickListener(this);
49+
findViewById(R.id.btn_light_mode).setOnClickListener(this);
50+
findViewById(R.id.btn_dark_mode).setOnClickListener(this);
4951
updateAboutStatus();
5052
}
5153

@@ -63,6 +65,12 @@ public void onWidgetClick(View view) {
6365
case R.id.btn_hide_status:
6466
BarUtils.setStatusBarVisibility(this, false);
6567
break;
68+
case R.id.btn_light_mode:
69+
BarUtils.setStatusBarLightMode(this, true);
70+
break;
71+
case R.id.btn_dark_mode:
72+
BarUtils.setStatusBarLightMode(this, false);
73+
break;
6674
}
6775
updateAboutStatus();
6876
}

app/src/main/java/com/blankj/androidutilcode/feature/core/bar/BarStatusAlphaFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public int bindLayout() {
4343
@Override
4444
public void initView(Bundle savedInstanceState, View view) {
4545
fakeStatusBar = view.findViewById(R.id.fake_status_bar);
46-
mTvStatusAlpha = (TextView) view.findViewById(R.id.tv_status_alpha);
47-
sbChangeAlpha = (SeekBar) view.findViewById(R.id.sb_change_alpha);
46+
mTvStatusAlpha = view.findViewById(R.id.tv_status_alpha);
47+
sbChangeAlpha = view.findViewById(R.id.sb_change_alpha);
4848
view.findViewById(R.id.btn_set_transparent).setOnClickListener(this);
4949
sbChangeAlpha.setOnSeekBarChangeListener(translucentListener);
5050
mTvStatusAlpha.setText(String.valueOf(mAlpha));

app/src/main/java/com/blankj/androidutilcode/feature/core/permission/PermissionActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public void rationale(final ShouldRequest shouldRequest) {
9292
@Override
9393
public void onGranted(List<String> permissionsGranted) {
9494
updateAboutPermission();
95+
LogUtils.d(permissionsGranted);
9596
}
9697

9798
@Override
@@ -123,6 +124,7 @@ public void rationale(final ShouldRequest shouldRequest) {
123124
@Override
124125
public void onGranted(List<String> permissionsGranted) {
125126
updateAboutPermission();
127+
LogUtils.d(permissionsGranted);
126128
}
127129

128130
@Override

app/src/main/java/com/blankj/androidutilcode/feature/core/screen/ScreenActivity.java

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import android.widget.TextView;
99

1010
import com.blankj.androidutilcode.R;
11-
import com.blankj.androidutilcode.base.BaseBackActivity;
11+
import com.blankj.androidutilcode.base.BaseActivity;
1212
import com.blankj.utilcode.util.ScreenUtils;
1313
import com.blankj.utilcode.util.SpanUtils;
1414

@@ -20,9 +20,10 @@
2020
* desc : Screen 工具类 Demo
2121
* </pre>
2222
*/
23-
public class ScreenActivity extends BaseBackActivity {
23+
public class ScreenActivity extends BaseActivity {
2424

2525
ImageView ivScreenshot;
26+
TextView tvAboutScreen;
2627

2728
public static void start(Context context) {
2829
Intent starter = new Intent(context, ScreenActivity.class);
@@ -36,31 +37,20 @@ public void initData(Bundle bundle) {
3637

3738
@Override
3839
public int bindLayout() {
39-
return R.layout.activity_screen;
40+
return R.layout.activity_brightness;
4041
}
4142

4243
@Override
4344
public void initView(Bundle savedInstanceState, View view) {
44-
getToolBar().setTitle(getString(R.string.demo_sdcard));
45-
45+
ivScreenshot = findViewById(R.id.iv_screenshot);
46+
tvAboutScreen = findViewById(R.id.tv_about_screen);
4647
findViewById(R.id.btn_set_fullscreen).setOnClickListener(this);
4748
findViewById(R.id.btn_set_landscape).setOnClickListener(this);
4849
findViewById(R.id.btn_set_portrait).setOnClickListener(this);
4950
findViewById(R.id.btn_screenshot).setOnClickListener(this);
5051
findViewById(R.id.btn_set_sleep_duration).setOnClickListener(this);
51-
ivScreenshot = findViewById(R.id.iv_screenshot);
52-
TextView tvAboutSdcard = findViewById(R.id.tv_about_screen);
53-
tvAboutSdcard.setText(new SpanUtils()
54-
.appendLine("getScreenWidth: " + ScreenUtils.getScreenWidth())
55-
.appendLine("getScreenHeight: " + ScreenUtils.getScreenHeight())
56-
.appendLine("isLandscape: " + ScreenUtils.isLandscape())
57-
.appendLine("isPortrait: " + ScreenUtils.isPortrait())
58-
.appendLine("getScreenRotation: " + ScreenUtils.getScreenRotation(this))
59-
.appendLine("isScreenLock: " + ScreenUtils.isScreenLock())
60-
.appendLine("getSleepDuration: " + ScreenUtils.getSleepDuration())
61-
.append("isTablet: " + ScreenUtils.isTablet())
62-
.create()
63-
);
52+
53+
updateAboutScreen();
6454
}
6555

6656
@Override
@@ -85,7 +75,22 @@ public void onWidgetClick(View view) {
8575
break;
8676
case R.id.btn_set_sleep_duration:
8777
ScreenUtils.setSleepDuration(100000);
78+
updateAboutScreen();
8879
break;
8980
}
9081
}
82+
83+
private void updateAboutScreen() {
84+
tvAboutScreen.setText(new SpanUtils()
85+
.appendLine("getScreenWidth: " + ScreenUtils.getScreenWidth())
86+
.appendLine("getScreenHeight: " + ScreenUtils.getScreenHeight())
87+
.appendLine("isLandscape: " + ScreenUtils.isLandscape())
88+
.appendLine("isPortrait: " + ScreenUtils.isPortrait())
89+
.appendLine("getScreenRotation: " + ScreenUtils.getScreenRotation(this))
90+
.appendLine("isScreenLock: " + ScreenUtils.isScreenLock())
91+
.appendLine("getSleepDuration: " + ScreenUtils.getSleepDuration())
92+
.append("isTablet: " + ScreenUtils.isTablet())
93+
.create()
94+
);
95+
}
9196
}

app/src/main/java/com/blankj/androidutilcode/feature/sub/SubUtilActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.blankj.androidutilcode.R;
99
import com.blankj.androidutilcode.base.BaseBackActivity;
10+
import com.blankj.androidutilcode.feature.sub.brightness.BrightnessActivity;
1011
import com.blankj.androidutilcode.feature.sub.location.LocationActivity;
1112
import com.blankj.androidutilcode.feature.sub.pinyin.PinyinActivity;
1213

@@ -50,6 +51,10 @@ public void onWidgetClick(View view) {
5051

5152
}
5253

54+
public void brightnessClick(View view) {
55+
BrightnessActivity.start(this);
56+
}
57+
5358
public void locationClick(View view) {
5459
LocationActivity.start(this);
5560
}

0 commit comments

Comments
 (0)