File tree Expand file tree Collapse file tree
src/main/java/com/ayvytr/customview/custom/text Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Android check, lint and assemble
1+ name : Android CI
22
33on :
44 push :
@@ -13,24 +13,27 @@ jobs:
1313 timeout-minutes : 10
1414
1515 steps :
16- - uses : actions/checkout@v2
17- - uses : actions/setup-java@v1
18- with :
19- java-version : 11
20- - uses : gradle/gradle-build-action@v2
21- with :
22- gradle-version : 6.7.1
23- arguments : build --dry-run # just test build configuration
16+ - name : Checkout code
17+ uses : actions/checkout@v6
2418
25- - uses : gradle/gradle-build-action@v2
26- with :
27- gradle-version : 6.7.1
28- arguments : check
29- - uses : gradle/gradle-build-action@v2
19+ - name : Setup JDK
20+ uses : actions/setup-java@v5
3021 with :
31- gradle-version : 6.7.1
32- arguments : lint
33- - uses : gradle/gradle-build-action@v2
34- with :
35- gradle-version : 6.7.1
36- arguments : assembleRelease
22+ java-version : ' 17'
23+ distribution : ' zulu'
24+ cache : ' gradle' # 启用 Gradle 依赖缓存
25+
26+ - name : Make gradlew executable
27+ run : chmod +x gradlew
28+
29+ - name : Execute Gradle tasks
30+ uses : gradle/actions/setup-gradle@v5
31+
32+ - name : Build with Gradle
33+ run : ./gradlew --dry-run
34+
35+ # - name: Build with Gradle
36+ # run: ./gradlew lint
37+
38+ - name : Build with Gradle
39+ run : ./gradlew assembleRelease
Original file line number Diff line number Diff line change @@ -11,23 +11,33 @@ jobs:
1111 build-and-deploy :
1212 runs-on : ubuntu-latest
1313 steps :
14- # 拉取代码
14+ # 1. 拉取代码(包括 Gradle Wrapper)
1515 - name : Checkout
16- uses : actions/checkout@v2
16+ uses : actions/checkout@v4
1717 with :
1818 persist-credentials : false
1919
20- - name : Set up the Java JDK
21- uses : actions/setup-java@v2
20+ # 2. 设置 Java 环境
21+ - name : Set up Java
22+ uses : actions/setup-java@v4
2223 with :
23- java-version : ' 11'
24- distribution : ' adopt'
24+ java-version : ' 17'
25+ distribution : ' zulu'
26+
27+ # 3. (可选但推荐)设置 Gradle 环境并利用其缓存优化
28+ - name : Setup Gradle
29+ uses : gradle/actions/setup-gradle@v4 # 使用新的官方 Action 并省略 gradle-version 参数
30+ # 注意这里移除了 with: gradle-version 配置
31+
32+ - name : Make gradlew executable
33+ run : chmod +x gradlew
2534
2635 # 生成javadoc
27- - uses : gradle/gradle-build-action@v2
28- with :
29- gradle-version : 6.7.1
30- arguments : custom-views-androidx:javadoc
36+ uses : gradle/actions/setup-gradle@v4 # 使用新的官方 Action 并省略 gradle-version 参数
37+
38+ - name : Generate Javadoc with Gradle Wrapper
39+ run : ./gradlew javaDocReleaseGeneration
40+
3141
3242 # 部署到 GitHub Pages
3343 - name : Deploy
3646 ACCESS_TOKEN : ${{ secrets.ACCESS_TOKEN }}
3747 REPOSITORY_NAME : ayvytr/ayvytr.github.io
3848 BRANCH : master
39- FOLDER : ./custom-views-androidx/build/docs/javadoc
49+ FOLDER : ./custom-views-androidx/build/intermediates/java_doc_dir/release/javaDocReleaseGeneration
4050 CLEAN : false
4151 TARGET_FOLDER : javadocs/custom-views-androidx
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ plugins {
55
66android {
77 compileSdkVersion 31
8+ namespace " com.ayvytr.customviewproject"
89
910 defaultConfig {
1011 applicationId " com.ayvytr.customviewproject"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ plugins {
55
66android {
77 compileSdkVersion 31
8+ namespace " com.ayvytr.cardviewpager"
89
910
1011
Original file line number Diff line number Diff line change 11plugins {
22 alias(libs. plugins. android. library)
33 id " com.vanniktech.maven.publish" version " 0.35.0"
4+ alias(libs. plugins. dokka)
5+
46}
57
68android {
79 compileSdkVersion 31
10+ namespace " com.ayvytr.customview"
811
912 defaultConfig {
1013 minSdkVersion 14
Original file line number Diff line number Diff line change 1010import android .view .MotionEvent ;
1111import android .view .View ;
1212
13+ import com .ayvytr .customview .R ;
14+ import com .ayvytr .customview .util .DensityUtil ;
15+ import com .ayvytr .customview .util .ResUtil ;
16+
1317import androidx .annotation .DrawableRes ;
1418import androidx .annotation .NonNull ;
1519import androidx .appcompat .widget .AppCompatEditText ;
1620import androidx .core .content .ContextCompat ;
1721import androidx .core .graphics .drawable .DrawableCompat ;
1822
19- import com .ayvytr .customview .R ;
20- import com .ayvytr .customview .util .DensityUtil ;
21- import com .ayvytr .customview .util .ResUtil ;
22-
2323
2424/**
2525 * 可清除文本的EditText,清除图标是drawableRight指定的。预览会看不到图,运行起来会显示,直接继承的AppCompatEditText.
@@ -42,7 +42,7 @@ public ClearableEditText(Context context) {
4242 }
4343
4444 public ClearableEditText (Context context , AttributeSet attrs ) {
45- this (context , attrs , R . attr . editTextStyle );
45+ this (context , attrs , 0 );
4646 }
4747
4848 public ClearableEditText (Context context , AttributeSet attrs , int defStyleAttr ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ junitVersion = "1.1.5"
77espressoCore = " 3.5.1"
88appcompat = " 1.3.0"
99material = " 1.10.0"
10+ dokka = " 2.1.0"
1011
1112[libraries ]
1213androidx-core-ktx = { group = " androidx.core" , name = " core-ktx" , version.ref = " coreKtx" }
@@ -34,3 +35,4 @@ ktx-androidx = 'io.github.ayvytr:ktx-androidx:+'
3435android-application = { id = " com.android.application" , version.ref = " agp" }
3536android-library = { id = " com.android.library" , version.ref = " agp" }
3637kotlin-android = { id = " org.jetbrains.kotlin.android" , version.ref = " kotlin" }
38+ dokka = {id = " org.jetbrains.dokka" , version.ref = " dokka" }
You can’t perform that action at this time.
0 commit comments