Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1a713ee

Browse files
author
chenyouwei
committed
feat:新增知识点
1 parent ddea335 commit 1a713ee

33 files changed

+1033
-95
lines changed

‎.idea/codeStyles/Project.xml‎

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/misc.xml‎

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/build.gradle‎

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'com.tencent.tinker.patch'
3+
apply from: 'tinker-support.gradle'
24

35
android {
46
compileSdkVersion 28
@@ -9,23 +11,41 @@ android {
911
versionCode 1
1012
versionName "1.0"
1113
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14+
// multiDexEnabled true // 开启dex分包
1215
}
1316
buildTypes {
14-
15-
debug{
16-
debuggable true
17-
}
18-
1917
release {
18+
minifyEnabled true
19+
signingConfig signingConfigs.debug
20+
proguardFiles getDefaultProguardFile('proguard-android.txt'), project.file('proguard-rules.pro')
21+
}
22+
debug {
23+
debuggable true
2024
minifyEnabled false
21-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25+
signingConfig signingConfigs.debug
2226
}
2327
}
2428

29+
2530
compileOptions {//使用JAVA8语法解析
2631
sourceCompatibility JavaVersion.VERSION_1_8
2732
targetCompatibility JavaVersion.VERSION_1_8
2833
}
34+
35+
// 这里做签名的配置
36+
signingConfigs {
37+
release {
38+
storeFile file("./keystore/release.keystore")
39+
storePassword "testres"
40+
keyAlias "testres"
41+
keyPassword "testres"
42+
v2SigningEnabled false
43+
}
44+
45+
debug {
46+
storeFile file("./keystore/debug.keystore")
47+
}
48+
}
2949
}
3050

3151
dependencies {
@@ -46,18 +66,27 @@ dependencies {
4666

4767
//ijkplayer
4868

49-
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
50-
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
69+
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
70+
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
5171

52-
compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
53-
compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
54-
compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
55-
compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
72+
implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
73+
implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
74+
implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
75+
implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
5676

5777
// ExoPlayer as IMediaPlayer: optional, experimental
5878
compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
5979
implementation 'com.android.support:cardview-v7:25.3.1'
6080
// 滴滴调试工具
6181
debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:1.2.1'
6282
releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:1.2.0'
83+
84+
//tinker
85+
implementation 'com.tencent.tinker:tinker-android-lib:1.9.1'
86+
// debugImplementation,因为LeakCanary应该只在调试版本中运行。
87+
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
88+
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
89+
90+
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
91+
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'
6392
}

‎app/keystore/debug.keystore‎

1.24 KB
Binary file not shown.

‎app/keystore/release.keystore‎

4 KB
Binary file not shown.

‎app/src/androidTest/java/com/hugh/basis/ExampleInstrumentedTest.java‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎app/src/main/AndroidManifest.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
<activity android:name=".constraintlayout.ConstraintLayoutActivity"/>
6363
<activity android:name=".rvlooper.LooperActivity"/>
6464
<activity android:name=".footer.HeaderAndFooterActivity"/>
65+
<activity android:name=".activities.TransParentActivity"
66+
android:theme="@style/dialog_activity"
67+
/>
68+
<activity android:name=".leakcanary.LeakActivity"/>
69+
<activity android:name=".exoplayer.ExoPlayerActivity"/>
6570

6671
</application>
6772

‎app/src/main/assets/a.html‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77

88
function callAndroid(){
99
// 由于对象映射,所以调用test对象等于调用Android映射的对象
10-
<!--test.hello("js调用了android中的hello方法");-->
11-
/*约定的url协议为:js://webview?arg1=111&arg2=222*/
12-
document.location = "js://webview?arg1=111&arg2=222";
10+
test.hello("js调用了android中的hello方法");
11+
12+
/*约定的url协议为:js://webview?arg1=111&arg2=222*/
13+
<!-- document.location = "js://webview?arg1=111&arg2=222";-->
1314
}
1415
</script>
1516
</head>
1617
<body>
1718
<!--//点击按钮则调用callAndroid函数-->
18-
<button type="button" id="button1" onclick="callAndroid()">点击调用Android代码</button>
19+
<button type="button" id="button1" onclick="callAndroid()">点击调用Android代码</button>
1920
</body>
2021
</html>

‎app/src/main/java/com/hugh/basis/HughApplication.java‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import android.util.Log;
88

99
import com.didichuxing.doraemonkit.DoraemonKit;
10+
import com.squareup.leakcanary.LeakCanary;
11+
import com.squareup.leakcanary.RefWatcher;
1012

1113
/**
1214
* Created by {chenyouwei}
@@ -15,16 +17,32 @@
1517
public class HughApplication extends Application {
1618

1719
private static final String TAG = HughApplication.class.getSimpleName();
20+
private RefWatcher refWatcher;
1821

1922
@Override
2023
public void onCreate() {
2124
super.onCreate();
22-
DoraemonKit.install(this);
23-
25+
// DoraemonKit.install(this);
26+
// LeakCanary.install(this);
27+
refWatcher= setupLeakCanary();
2428
Log.e(TAG, "onCreate : getProcessName:" );
2529
Log.e(TAG,"isDebug"+isApkInDebug(this));
2630
}
2731

32+
private RefWatcher setupLeakCanary() {
33+
if (LeakCanary.isInAnalyzerProcess(this)) {
34+
return RefWatcher.DISABLED;
35+
}
36+
return LeakCanary.install(this);
37+
}
38+
39+
40+
public static RefWatcher getRefWatcher(Context context) {
41+
HughApplication application = (HughApplication) context.getApplicationContext();
42+
return application.refWatcher;
43+
}
44+
45+
2846
//判断当前应用是否是debug状态
2947
public static boolean isApkInDebug(Context context) {
3048
try {

‎app/src/main/java/com/hugh/basis/MainActivity.java‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
import com.hugh.basis.activities.BindServiceActivity;
2424
import com.hugh.basis.activities.FragmentActivity;
2525
import com.hugh.basis.activities.ListActivity;
26+
import com.hugh.basis.activities.TransParentActivity;
2627
import com.hugh.basis.binder.UserManager;
2728
import com.hugh.basis.constraintlayout.ConstraintLayoutActivity;
2829
import com.hugh.basis.dialog.DialogShowActivity;
2930
import com.hugh.basis.eventbus.EventActivity1;
31+
import com.hugh.basis.exoplayer.ExoPlayerActivity;
3032
import com.hugh.basis.footer.HeaderAndFooterActivity;
3133
import com.hugh.basis.ijkplayer.PlayActivity;
34+
import com.hugh.basis.leakcanary.LeakActivity;
3235
import com.hugh.basis.retrofit.RetrofitActivity;
3336
import com.hugh.basis.rvlooper.LooperActivity;
3437
import com.hugh.basis.services.TestOneService;
@@ -247,6 +250,23 @@ public void onClick(View v) {
247250

248251
}
249252
});
253+
findViewById(R.id.btn_transparent_activity).setOnClickListener(new View.OnClickListener() {
254+
@Override
255+
public void onClick(View v) {
256+
Intent intent = new Intent(MainActivity.this, TransParentActivity.class);
257+
startActivity(intent);
258+
259+
}
260+
});
261+
262+
findViewById(R.id.btn_leakcanary_activity).setOnClickListener(new View.OnClickListener() {
263+
@Override
264+
public void onClick(View v) {
265+
Intent intent = new Intent(MainActivity.this, LeakActivity.class);
266+
startActivity(intent);
267+
268+
}
269+
});
250270

251271
linearLayout = findViewById(R.id.ll_contain);
252272

@@ -394,6 +414,14 @@ public void onClick(View v) {
394414
}
395415
});
396416

417+
findViewById(R.id.btn_exoplayer_activity).setOnClickListener(new View.OnClickListener() {
418+
@Override
419+
public void onClick(View v) {
420+
Intent intent2 = new Intent(MainActivity.this, ExoPlayerActivity.class);
421+
startActivity(intent2);
422+
}
423+
});
424+
397425
Log.e("aaa ----pppp",ppp+"");
398426
// ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor();
399427

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /