├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── attrs.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ └── layout │ │ │ │ ├── list_item.xml │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ ├── zjw │ │ │ │ └── appmethodtime │ │ │ │ │ ├── CostTime.java │ │ │ │ │ ├── SearchCoreModel.java │ │ │ │ │ ├── SearchShopModel.java │ │ │ │ │ ├── BaseModel.java │ │ │ │ │ ├── DPIUtil.java │ │ │ │ │ ├── FlexBoxMaxLinesLayout.java │ │ │ │ │ ├── MyApplication.java │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ ├── HoldTagSpan.java │ │ │ │ │ ├── Truss.java │ │ │ │ │ ├── GradientTextView.java │ │ │ │ │ ├── ViewDragHelperLayout.java │ │ │ │ │ └── EllipsizedTextView.java │ │ │ │ └── tablayout │ │ │ │ ├── PageTransformerListener.java │ │ │ │ ├── ScaleTitleView.java │ │ │ │ └── ClipPagerFrameLayout.java │ │ └── AndroidManifest.xml │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── zjw │ │ │ └── appmethodtime │ │ │ └── ExampleInstrumentedTest.java │ └── test │ │ └── java │ │ └── com │ │ └── zjw │ │ └── appmethodtime │ │ └── ExampleUnitTest.java ├── proguard-rules.pro └── build.gradle ├── customlint ├── .gitignore ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── zjw │ └── customlint │ ├── CustomIssueRegistry.java │ └── MyLogDetector.java ├── mylibrary ├── .gitignore ├── classes.jar ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ └── activity_lib.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── zjw │ │ │ │ └── mylibrary │ │ │ │ ├── Bean.java │ │ │ │ └── LibActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── zjw │ │ │ └── mylibrary │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── zjw │ │ └── mylibrary │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── myapplication ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── location.png │ │ │ │ ├── location_night.png │ │ │ │ ├── location_normal.png │ │ │ │ └── location_selector.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ └── layout │ │ │ │ └── app_lib_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── zjw │ │ │ │ └── myapplication │ │ │ │ └── MyLibActivity.java │ │ ├── release │ │ │ └── AndroidManifest.xml │ │ └── debug │ │ │ └── AndroidManifest.xml │ └── test │ │ └── java │ │ └── com │ │ └── zjw │ │ └── myapplication │ │ └── ExampleUnitTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /customlint/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mylibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /myapplication/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':mylibrary', ':customLint', ':buildSrc' 2 | -------------------------------------------------------------------------------- /mylibrary/classes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/mylibrary/classes.jar -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /mylibrary/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | My Library 3 | 4 | -------------------------------------------------------------------------------- /myapplication/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MyApplication 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /myapplication/src/main/res/drawable/location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/drawable/location.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /myapplication/src/main/res/drawable/location_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/drawable/location_night.png -------------------------------------------------------------------------------- /myapplication/src/main/res/drawable/location_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/drawable/location_normal.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /mylibrary/src/main/java/com/zjw/mylibrary/Bean.java: -------------------------------------------------------------------------------- 1 | package com.zjw.mylibrary; 2 | 3 | /** 4 | * Created by hasee on 2017/5/8. 5 | */ 6 | 7 | public class Bean { 8 | } 9 | -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /myapplication/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zjw-swun/AppMethodTime/HEAD/myapplication/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | /.idea 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | /repo/ -------------------------------------------------------------------------------- /myapplication/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 28 22:34:50 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #4D97FF 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AppMethodTime 3 | Main3Activity 4 | Main4Activity 5 | Main2Activity 6 | 7 | -------------------------------------------------------------------------------- /myapplication/src/main/res/drawable/location_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/zjw/appmethodtime/CostTime.java: -------------------------------------------------------------------------------- 1 | package com.zjw.appmethodtime; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Created by hasee on 2017/5/2. 10 | */ 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.METHOD) 13 | public @interface CostTime { 14 | } 15 | -------------------------------------------------------------------------------- /myapplication/src/main/java/com/zjw/myapplication/MyLibActivity.java: -------------------------------------------------------------------------------- 1 | package com.zjw.myapplication; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | public class MyLibActivity extends AppCompatActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.app_lib_main); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /mylibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /myapplication/src/main/release/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /myapplication/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /customlint/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java-library' 2 | 3 | dependencies { 4 | implementation fileTree(dir: 'libs', include: ['*.jar']) 5 | 6 | compileOnly "com.android.tools.lint:lint-api:26.4.2" 7 | compileOnly "com.android.tools.lint:lint-checks:26.4.2" 8 | } 9 | 10 | sourceCompatibility = "1.8" 11 | targetCompatibility = "1.8" 12 | 13 | jar { 14 | manifest { 15 | attributes("Lint-Registry-v2": "com.zjw.customlint.CustomIssueRegistry") 16 | } 17 | } -------------------------------------------------------------------------------- /mylibrary/src/test/java/com/zjw/mylibrary/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.zjw.mylibrary; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /myapplication/src/test/java/com/zjw/myapplication/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.zjw.myapplication; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /mylibrary/src/main/java/com/zjw/mylibrary/LibActivity.java: -------------------------------------------------------------------------------- 1 | package com.zjw.mylibrary; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.util.Log; 6 | import android.widget.TextView; 7 | 8 | public class LibActivity extends AppCompatActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | setContentView(R.layout.activity_lib); 14 | final TextView viewById = findViewById(R.id.mTextView); 15 | Log.e("tag","test"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/zjw/appmethodtime/SearchCoreModel.java: -------------------------------------------------------------------------------- 1 | package com.zjw.appmethodtime; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class SearchCoreModel extends BaseModel { 6 | @SerializedName(value = "title") 7 | public String base; 8 | 9 | public String getBase() { 10 | return base; 11 | } 12 | 13 | public void setBase(String base) { 14 | this.base = base; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "SearchCoreModel{" + 20 | "base='" + base + '\'' + 21 | '}'+super.toString(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/zjw/appmethodtime/SearchShopModel.java: -------------------------------------------------------------------------------- 1 | package com.zjw.appmethodtime; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class SearchShopModel extends SearchCoreModel { 6 | @SerializedName(value = "title") 7 | public String shop; 8 | 9 | public String getShop() { 10 | return shop; 11 | } 12 | 13 | public void setShop(String shop) { 14 | this.shop = shop; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "SearchShopModel{" + 20 | "shop='" + shop + '\'' + 21 | '}' + super.toString(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/zjw/appmethodtime/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.zjw.appmethodtime; 2 | 3 | public class BaseModel { 4 | private int age; 5 | private String name = "test"; 6 | 7 | public int getAge() { 8 | return age; 9 | } 10 | 11 | public void setAge(int age) { 12 | this.age = age; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "BaseModel{" + 26 | "age=" + age + 27 | ", name='" + name + '\'' + 28 | '}'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/tablayout/PageTransformerListener.java: -------------------------------------------------------------------------------- 1 | package com.tablayout; 2 | 3 | 4 | interface PageTransformerListener { 5 | void setDirection(Direction direction); 6 | 7 | void setCurrentProgress(float currentProgress); 8 | 9 | void setVisibility(int visibility); 10 | 11 | enum Direction { 12 | LEFT_TO_RIGHT, RIGHT_TO_LIFT 13 | } 14 | 15 | /** 16 | * 离开 17 | * 18 | * @param leavePercent 离开的百分比, 0.0f - 1.0f 19 | * @param leftToRight 从左至右离开 20 | */ 21 | void onLeave(int index, float leavePercent, boolean leftToRight); 22 | 23 | /** 24 | * 进入 25 | * 26 | * @param enterPercent 进入的百分比, 0.0f - 1.0f 27 | * @param leftToRight 从左至右离开 28 | */ 29 | void onEnter(int index, float enterPercent, boolean leftToRight); 30 | } 31 | -------------------------------------------------------------------------------- /myapplication/src/main/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mylibrary/src/main/res/layout/activity_lib.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/zjw/appmethodtime/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.zjw.appmethodtime; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.zjw.appmethodtime", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mylibrary/src/androidTest/java/com/zjw/mylibrary/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.zjw.mylibrary; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.zjw.mylibrary.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /customlint/src/main/java/com/zjw/customlint/CustomIssueRegistry.java: -------------------------------------------------------------------------------- 1 | package com.zjw.customlint; 2 | 3 | import com.android.tools.lint.checks.LogDetector; 4 | import com.android.tools.lint.client.api.IssueRegistry; 5 | import com.android.tools.lint.detector.api.ApiKt; 6 | import com.android.tools.lint.detector.api.Issue; 7 | 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * Created by Omooo 16 | * Date:2019-07-04 17 | */ 18 | @SuppressWarnings("UnstableApiUsage") 19 | public class CustomIssueRegistry extends IssueRegistry { 20 | 21 | @NotNull 22 | @Override 23 | public List getIssues() { 24 | 25 | return Arrays.asList( 26 | //自定义lint 尽量不要和android 原有Lint重名 例如 27 | //com.android.tools.lint.checks.LogDetector 28 | MyLogDetector.ISSUE 29 | ); 30 | } 31 | 32 | @Override 33 | public int getApi() { 34 | return ApiKt.CURRENT_API; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /myapplication/src/main/res/layout/app_lib_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |