Skip to content

Commit 9e101c7

Browse files
author
jaaksi
committed
1.转kotlin
2.使用BottomSheetDialog做载体 3.优化demo
1 parent 9fd6f4e commit 9e101c7

File tree

91 files changed

+21694
-5107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+21694
-5107
lines changed

app/build.gradle

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,51 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
23

34
android {
4-
compileSdkVersion 28
5-
// buildToolsVersion '27.0.3'
5+
compileSdkVersion 31
66

7-
defaultConfig {
8-
applicationId "org.jaaksi.pickerview.demo"
9-
minSdkVersion 15
10-
targetSdkVersion 28
11-
versionCode 2
12-
versionName "1.0.1"
13-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14-
}
15-
buildTypes {
16-
release {
17-
minifyEnabled false
18-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
7+
defaultConfig {
8+
applicationId "org.jaaksi.pickerview.demo"
9+
minSdkVersion 15
10+
targetSdkVersion 31
11+
versionCode 2
12+
versionName "1.0.1"
13+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
14+
}
15+
buildTypes {
16+
release {
17+
minifyEnabled false
18+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19+
}
20+
}
21+
22+
compileOptions {
23+
sourceCompatibility JavaVersion.VERSION_1_8
24+
targetCompatibility JavaVersion.VERSION_1_8
1925
}
20-
}
2126

22-
lintOptions {
23-
checkReleaseBuilds false
24-
abortOnError false
27+
kotlinOptions {
28+
jvmTarget = '1.8'
29+
}
2530

26-
}
31+
lintOptions {
32+
checkReleaseBuilds false
33+
abortOnError false
34+
}
35+
36+
buildFeatures {
37+
viewBinding true
38+
}
2739
}
2840

2941
dependencies {
30-
implementation fileTree(include: ['*.jar'], dir: 'libs')
31-
implementation 'com.android.support:appcompat-v7:28.0.0'
32-
// implementation project(':pickerview')
33-
implementation 'com.android.support:support-v4:28.0.0'
34-
implementation 'org.jaaksi:pickerview:3.0.2'
35-
implementation 'com.google.code.gson:gson:2.8.5'
42+
implementation fileTree(include: ['*.jar'], dir: 'libs')
43+
implementation project(':pickerview')
44+
// implementation 'org.jaaksi:pickerview:3.0.2'
45+
implementation 'com.google.code.gson:gson:2.8.6'
46+
implementation "androidx.core:core-ktx:1.8.0"
47+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
48+
implementation 'androidx.appcompat:appcompat:1.4.2'
49+
implementation 'com.google.android.material:material:1.6.1'
50+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
3651
}

app/proguard-rules.pro

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,22 @@
1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
2121
#-renamesourcefileattribute SourceFile
22+
# Gson
23+
-keepattributes Signature
24+
-keepattributes *Annotation*
25+
-dontwarn sun.misc.**
26+
-keep class com.google.gson.stream.** { *; }
27+
-keep class com.google.gson.examples.android.model.** { *; }
28+
-keep class * implements com.google.gson.TypeAdapterFactory
29+
-keep class * implements com.google.gson.JsonSerializer
30+
-keep class * implements com.google.gson.JsonDeserializer
31+
32+
-keep class **$Properties { *; }
33+
34+
# keep 被添加@keep的类
35+
-keep @androidx.annotation.Keep class **
36+
37+
# BaseActivity中使用反射获取ViewBinding,则需要配置混淆
38+
-keep class * implements androidx.viewbinding.ViewBinding {
39+
*;
40+
}

app/src/main/AndroidManifest.xml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="org.jaaksi.pickerview.demo">
3+
package="org.jaaksi.pickerview.demo">
44

5-
<application
6-
android:name=".MyApplication"
7-
android:allowBackup="true"
8-
android:icon="@drawable/ic_launcher"
9-
android:label="@string/app_name"
10-
android:supportsRtl="true"
11-
android:theme="@style/AppTheme">
12-
<activity android:name=".MainActivity">
13-
<intent-filter>
14-
<action android:name="android.intent.action.MAIN" />
5+
<application
6+
android:name=".MyApplication"
7+
android:allowBackup="true"
8+
android:icon="@drawable/ic_launcher"
9+
android:label="@string/app_name"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity
13+
android:name=".ui.MainActivity"
14+
android:exported="true">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
1517

16-
<category android:name="android.intent.category.LAUNCHER" />
17-
</intent-filter>
18-
</activity>
19-
</application>
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
2022

2123
</manifest>

0 commit comments

Comments
 (0)