Skip to content

Commit 710341f

Browse files
committed
移除butterknife
1 parent 2513eed commit 710341f

File tree

6 files changed

+9
-23
lines changed

6 files changed

+9
-23
lines changed

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.4.10'
4+
ext.kotlin_version = '1.4.20'
55
repositories {
66
google()
77
jcenter()
88

99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.1.0'
11+
classpath 'com.android.tools.build:gradle:4.1.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1313
// NOTE: Do not place your application dependencies here; they belong
1414
// in the individual module build.gradle files
15-
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.1'
1615
}
1716
}
1817

rscamera/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ dependencies {
4141
implementation project(path: ':util')
4242
implementation 'androidx.core:core-ktx:1.3.2'
4343
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
44-
4544
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
4645

4746
}

rscamera/src/main/java/cn/module/rscamera/use/Camera1v2Activity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ class Camera1v2Activity : BaseCoreActivity() {
2222
override fun initView() {
2323
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
2424

25+
launch {
26+
27+
28+
}
2529
cameraView = findViewById(R.id.cameraview)
2630
cameraView.cameraRenderer.params.facing = 0
2731
cameraView.cameraRenderer.params.w = 640

util/build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'com.jakewharton.butterknife'
43

54
android {
6-
compileSdkVersion 29
5+
compileSdkVersion 30
76

87
defaultConfig {
98
minSdkVersion 17
10-
targetSdkVersion 29
9+
targetSdkVersion 30
1110
versionCode 1
12-
versionName "1.5.0"
11+
versionName "1.5.1"
1312

1413
}
1514

@@ -29,8 +28,6 @@ android {
2928

3029
dependencies {
3130
implementation 'androidx.appcompat:appcompat:1.2.0'
32-
implementation 'com.jakewharton:butterknife:10.2.1'
33-
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
3431
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
3532
implementation "androidx.recyclerview:recyclerview:1.1.0"
3633
implementation "androidx.core:core-ktx:1.3.2"

util/src/main/java/cn/readsense/module/base/BaseCoreActivity.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
package cn.readsense.module.base
22

33
import android.app.ProgressDialog
4-
import android.content.Context
54
import android.os.Bundle
65
import androidx.annotation.IdRes
76
import androidx.annotation.LayoutRes
87
import androidx.appcompat.app.AppCompatActivity
98
import androidx.lifecycle.LifecycleObserver
10-
import butterknife.ButterKnife
11-
import butterknife.Unbinder
129
import cn.readsense.module.permissions.PermissionListener
1310
import cn.readsense.module.permissions.PermissionsUtil
1411
import cn.readsense.module.util.DisplayUtil
1512
import cn.readsense.module.util.ToastUtils
1613
import kotlinx.coroutines.CoroutineScope
1714
import kotlinx.coroutines.MainScope
1815
import kotlinx.coroutines.cancel
19-
import java.util.*
2016

2117
abstract class BaseCoreActivity : AppCompatActivity(), CoroutineScope by MainScope() {
2218
var progressDialog: ProgressDialog? = null
23-
var unbinder: Unbinder? = null
2419
private var screenWidth = 0
2520
private var screenHeight = 0
2621
private var permissions: MutableList<String> = mutableListOf()
2722
private val lifecycleObservers: MutableList<LifecycleObserver> = mutableListOf()
2823
override fun setContentView(@LayoutRes layoutResID: Int) {
2924
super.setContentView(layoutResID)
30-
unbinder = ButterKnife.bind(this)
3125
}
3226

3327
public override fun onCreate(savedInstanceState: Bundle?) {
@@ -99,7 +93,6 @@ abstract class BaseCoreActivity : AppCompatActivity(), CoroutineScope by MainSco
9993

10094
override fun onDestroy() {
10195
super.onDestroy()
102-
unbinder!!.unbind()
10396
cancel()
10497
}
10598

util/src/main/java/cn/readsense/module/base/BaseCoreFragment.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@
88
import androidx.annotation.Nullable;
99
import androidx.fragment.app.Fragment;
1010

11-
import butterknife.ButterKnife;
12-
import butterknife.Unbinder;
13-
1411

1512
public abstract class BaseCoreFragment extends Fragment {
1613
public View rootView;
1714
public LayoutInflater inflater;
18-
Unbinder unbinder;
1915

2016
@Nullable
2117
@Override
@@ -24,7 +20,6 @@ public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bun
2420
this.inflater = inflater;
2521
if (rootView == null) {
2622
rootView = inflater.inflate(this.getLayoutId(), container, false);
27-
unbinder = ButterKnife.bind(this, rootView);
2823
initView();
2924
}
3025
ViewGroup parent = (ViewGroup) rootView.getParent();
@@ -37,7 +32,6 @@ public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bun
3732
@Override
3833
public void onDetach() {
3934
super.onDetach();
40-
unbinder.unbind();
4135
}
4236

4337
protected abstract int getLayoutId();

0 commit comments

Comments
 (0)