├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.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 │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_fragment.xml │ │ │ │ ├── fragment_main.xml │ │ │ │ ├── fragment_transitions.xml │ │ │ │ └── activity_transitions.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── bennyhuo │ │ │ │ └── tieguanyin │ │ │ │ └── sample │ │ │ │ ├── utils │ │ │ │ └── ActivityUtils.kt │ │ │ │ ├── App.kt │ │ │ │ ├── PrimitiveDefaultTestActivity.java │ │ │ │ ├── FragmentContainerActivity.kt │ │ │ │ ├── inherited │ │ │ │ └── AbsActivity.java │ │ │ │ ├── inner │ │ │ │ └── OutterClass.java │ │ │ │ ├── childfragment │ │ │ │ ├── ParentFragment.kt │ │ │ │ └── ChildFragment.kt │ │ │ │ ├── EditUserActivity.java │ │ │ │ ├── fragments │ │ │ │ ├── KotlinFragment.kt │ │ │ │ └── JavaFragment.java │ │ │ │ ├── transitions │ │ │ │ ├── DetailsActivity.kt │ │ │ │ └── DetailsFragment.kt │ │ │ │ ├── KotlinActivity.kt │ │ │ │ ├── GenerateBothActivity.kt │ │ │ │ └── UserActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── annotations ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── annotations │ │ ├── ResultEntity.java │ │ ├── SharedElementWithName.java │ │ ├── SharedElement.java │ │ ├── SharedElementByNames.java │ │ ├── PendingTransition.java │ │ ├── Generated.java │ │ ├── Required.java │ │ ├── GenerateMode.java │ │ ├── Optional.java │ │ └── Builder.java └── build.gradle ├── app-java ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.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 │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── layout │ │ │ │ ├── content_main.xml │ │ │ │ ├── fragment_main.xml │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── bennyhuo │ │ │ │ └── tieguanyin │ │ │ │ └── javademo │ │ │ │ ├── App.java │ │ │ │ └── fragments │ │ │ │ └── JavaFragment.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── javademo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── javademo │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── compiler ├── .gitignore ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── services │ │ │ └── javax.annotation.processing.Processor │ │ │ └── gradle │ │ │ └── incremental.annotation.processors │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── compiler │ │ ├── utils │ │ ├── Extensions.kt │ │ └── CamelUtils.kt │ │ ├── fragment │ │ ├── builder │ │ │ ├── ConstantBuilder.kt │ │ │ ├── SaveStateMethodBuilder.kt │ │ │ └── InjectMethodBuilder.kt │ │ ├── FragmentClassBuilder.kt │ │ └── FragmentClass.kt │ │ ├── activity │ │ ├── builder │ │ │ ├── SaveStateMethodBuilder.kt │ │ │ ├── InjectMethodBuilder.kt │ │ │ ├── NewIntentKFunctionBuilder.kt │ │ │ ├── ConstantBuilder.kt │ │ │ ├── FinishKFunctionBuilder.kt │ │ │ ├── NewIntentMethodBuilder.kt │ │ │ └── FinishMethodBuilder.kt │ │ └── ActivityClassBuilder.kt │ │ ├── basic │ │ ├── builder │ │ │ ├── BasicConstantBuilder.kt │ │ │ └── BasicSaveStateMethodBuilder.kt │ │ └── entity │ │ │ ├── SharedElementEntity.kt │ │ │ ├── Field.kt │ │ │ ├── ResultParameter.kt │ │ │ └── OptionalField.kt │ │ └── BuilderProcessor.kt └── build.gradle ├── runtime-kt ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── runtime │ │ │ └── kotlin │ │ │ └── fragment │ │ │ └── Fragments.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── runtime │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── runtime │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── runtime ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ ├── com │ │ │ └── bennyhuo │ │ │ │ └── tieguanyin │ │ │ │ └── runtime │ │ │ │ ├── core │ │ │ │ ├── OnFragmentCreateListener.java │ │ │ │ ├── OnActivityCreateListener.java │ │ │ │ ├── OnActivityResultListener.java │ │ │ │ └── BuilderClassFinder.java │ │ │ │ ├── ActivityBuilderCallback.java │ │ │ │ ├── result │ │ │ │ └── fields │ │ │ │ │ ├── ActivityField.java │ │ │ │ │ ├── ViewField.java │ │ │ │ │ ├── FragmentField.java │ │ │ │ │ └── ListenerField.java │ │ │ │ ├── Tieguanyin.java │ │ │ │ └── utils │ │ │ │ ├── BundleUtils.java │ │ │ │ ├── Logger.java │ │ │ │ └── ViewUtils.java │ │ │ └── android │ │ │ └── support │ │ │ └── v4 │ │ │ └── app │ │ │ └── SupportFragmentUtils.java │ └── test │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── runtime │ │ └── core │ │ ├── FinderTestClasses │ │ └── A$B.java │ │ └── BuilderClassFinderTest.java ├── build.gradle └── proguard-rules.pro ├── sample-common ├── .gitignore ├── consumer-rules.pro ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── sample │ │ │ └── common │ │ │ └── BaseActivity.kt │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── sample │ │ │ └── common │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── sample │ │ └── common │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── app-androidx ├── .gitignore ├── gradle.properties ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.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 │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_fragment.xml │ │ │ │ ├── activity_parcelable.xml │ │ │ │ ├── fragment_main.xml │ │ │ │ ├── fragment_transitions.xml │ │ │ │ └── activity_transitions.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── bennyhuo │ │ │ │ └── tieguanyin │ │ │ │ └── sample │ │ │ │ ├── utils │ │ │ │ └── ActivityUtils.kt │ │ │ │ ├── App.kt │ │ │ │ ├── SubActivity.kt │ │ │ │ ├── inherited │ │ │ │ ├── SubActivity.kt │ │ │ │ └── AbsActivity.java │ │ │ │ ├── PrimitiveDefaultTestActivity.java │ │ │ │ ├── FragmentContainerActivity.kt │ │ │ │ ├── inner │ │ │ │ └── OutterClass.java │ │ │ │ ├── childfragment │ │ │ │ ├── ParentFragment.kt │ │ │ │ └── ChildFragment.kt │ │ │ │ ├── ParcelableActivity.kt │ │ │ │ ├── EditUserActivity.java │ │ │ │ ├── fragments │ │ │ │ ├── KotlinFragment.kt │ │ │ │ └── JavaFragment.java │ │ │ │ ├── transitions │ │ │ │ ├── DetailsActivity.kt │ │ │ │ └── DetailsFragment.kt │ │ │ │ ├── UserActivity.java │ │ │ │ ├── GenerateBothActivity.kt │ │ │ │ └── KotlinActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── bennyhuo │ │ │ └── tieguanyin │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── ExampleInstrumentedTest.kt └── proguard-rules.pro ├── compiler-ksp ├── .gitignore ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── com.google.devtools.ksp.processing.SymbolProcessorProvider │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── compiler │ │ └── ksp │ │ ├── utils │ │ ├── Extensions.kt │ │ ├── CamelUtils.kt │ │ ├── TypeUtils.kt │ │ ├── ClassType.kt │ │ └── TypeExtensions.kt │ │ ├── fragment │ │ ├── builder │ │ │ ├── ConstantBuilder.kt │ │ │ ├── InjectMethodBuilder.kt │ │ │ └── SaveStateMethodBuilder.kt │ │ ├── FragmentClass.kt │ │ └── FragmentClassBuilder.kt │ │ ├── activity │ │ └── builder │ │ │ ├── InjectMethodBuilder.kt │ │ │ ├── SaveStateMethodBuilder.kt │ │ │ ├── NewIntentKFunctionBuilder.kt │ │ │ ├── ConstantBuilder.kt │ │ │ ├── OnIntentKFunctionBuilder.kt │ │ │ ├── FinishKFunctionBuilder.kt │ │ │ ├── NewIntentMethodBuilder.kt │ │ │ └── FinishMethodBuilder.kt │ │ ├── core │ │ └── KspContext.kt │ │ ├── basic │ │ ├── entity │ │ │ ├── SharedElementEntity.kt │ │ │ ├── ResultParameter.kt │ │ │ └── Field.kt │ │ ├── builder │ │ │ ├── BasicConstantBuilder.kt │ │ │ └── BasicSaveStateMethodBuilder.kt │ │ └── BasicClassBuilder.kt │ │ └── BuilderSymbolProcessorProvider.kt └── build.gradle ├── runtime-androidx ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ ├── com │ │ │ └── bennyhuo │ │ │ │ └── tieguanyin │ │ │ │ └── runtime │ │ │ │ ├── core │ │ │ │ ├── OnFragmentCreateListener.java │ │ │ │ ├── OnActivityCreateListener.java │ │ │ │ ├── OnActivityResultListener.java │ │ │ │ └── BuilderClassFinder.java │ │ │ │ ├── ActivityBuilderCallback.java │ │ │ │ ├── result │ │ │ │ └── fields │ │ │ │ │ ├── ActivityField.java │ │ │ │ │ ├── ViewField.java │ │ │ │ │ ├── FragmentField.java │ │ │ │ │ └── ListenerField.java │ │ │ │ ├── Tieguanyin.java │ │ │ │ └── utils │ │ │ │ ├── BundleUtils.java │ │ │ │ ├── Logger.java │ │ │ │ └── ViewUtils.java │ │ │ └── androidx │ │ │ └── fragment │ │ │ └── app │ │ │ └── SupportFragmentUtils.java │ └── test │ │ └── java │ │ └── com │ │ └── bennyhuo │ │ └── tieguanyin │ │ └── runtime │ │ └── core │ │ ├── FinderTestClasses │ │ └── A$B.java │ │ └── BuilderClassFinderTest.java ├── build.gradle └── proguard-rules.pro ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── installToLocal.sh ├── upload.ps1 ├── upload.sh ├── settings.gradle ├── .gitignore └── gradle.properties /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /annotations/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app-java/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /compiler/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /runtime-kt/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /runtime/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample-common/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /sample-common/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app-androidx/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /compiler-ksp/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /runtime-androidx/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /runtime/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app-androidx/gradle.properties: -------------------------------------------------------------------------------- 1 | ksp.incremental.log=true 2 | useKsp=true 3 | kapt.use.worker.api=false -------------------------------------------------------------------------------- /runtime-androidx/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app-java/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ActivityBuilder 3 | 4 | -------------------------------------------------------------------------------- /runtime-kt/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | runtime-kt 3 | 4 | -------------------------------------------------------------------------------- /compiler/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | com.bennyhuo.tieguanyin.compiler.BuilderProcessor -------------------------------------------------------------------------------- /app-androidx/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ActivityBuilder 3 | 4 | -------------------------------------------------------------------------------- /compiler/src/main/resources/META-INF/gradle/incremental.annotation.processors: -------------------------------------------------------------------------------- 1 | com.bennyhuo.tieguanyin.compiler.BuilderProcessor,isolating -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/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/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/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/bennyhuo/TieGuanYin/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-java/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /compiler-ksp/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider: -------------------------------------------------------------------------------- 1 | com.bennyhuo.tieguanyin.compiler.ksp.BuilderSymbolProcessorProvider -------------------------------------------------------------------------------- /runtime-kt/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/TieGuanYin/HEAD/app-androidx/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app-java/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | app-java 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/ResultEntity.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 2 | 3 | public @interface ResultEntity { 4 | 5 | String name(); 6 | 7 | Class type(); 8 | } 9 | -------------------------------------------------------------------------------- /sample-common/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /annotations/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | dependencies { 6 | implementation fileTree(dir: 'libs', include: ['*.jar']) 7 | } 8 | 9 | targetCompatibility = '1.8' 10 | sourceCompatibility = '1.8' -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app-java/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app-androidx/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/SharedElementWithName.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 2 | 3 | /** 4 | * Created by benny on 2/13/18. 5 | */ 6 | 7 | public @interface SharedElementWithName { 8 | String value(); 9 | } 10 | -------------------------------------------------------------------------------- /runtime/src/test/java/com/bennyhuo/tieguanyin/runtime/core/FinderTestClasses/A$B.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core.FinderTestClasses; 2 | 3 | public class A$B { 4 | public static class C{ 5 | public class D$E{ 6 | 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/SharedElement.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 2 | 3 | /** 4 | * Created by benny on 2/11/18. 5 | */ 6 | public @interface SharedElement { 7 | int sourceId(); 8 | String targetName(); 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 29 07:55:18 CST 2018 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-7.2-all.zip 7 | -------------------------------------------------------------------------------- /runtime-androidx/src/test/java/com/bennyhuo/tieguanyin/runtime/core/FinderTestClasses/A$B.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core.FinderTestClasses; 2 | 3 | public class A$B { 4 | public static class C{ 5 | public class D$E{ 6 | 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/SharedElementByNames.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 2 | 3 | /** 4 | * Created by benny on 2/13/18. 5 | */ 6 | 7 | public @interface SharedElementByNames { 8 | String source(); 9 | String target(); 10 | } 11 | -------------------------------------------------------------------------------- /installToLocal.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | clear 3 | ./gradlew :annotations:publishToMavenLocal 4 | ./gradlew :runtime:publishToMavenLocal 5 | ./gradlew :runtime-androidx:publishToMavenLocal 6 | ./gradlew :runtime-kt:publishToMavenLocal 7 | ./gradlew :compiler:publishToMavenLocal 8 | ./gradlew :compiler-ksp:publishToMavenLocal -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app-java/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app-androidx/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/utils/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.utils 2 | 3 | import com.bennyhuo.tieguanyin.annotations.PendingTransition 4 | 5 | fun PendingTransition.isDefault(): Boolean { 6 | return enterAnim == PendingTransition.DEFAULT && exitAnim == PendingTransition.DEFAULT 7 | } 8 | -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/core/OnFragmentCreateListener.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | 6 | public interface OnFragmentCreateListener { 7 | void onFragmentCreated(Fragment fragment, Bundle savedInstanceState); 8 | } -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/utils/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.utils 2 | 3 | import com.bennyhuo.tieguanyin.annotations.PendingTransition 4 | 5 | fun PendingTransition.isDefault(): Boolean { 6 | return enterAnim == PendingTransition.DEFAULT && exitAnim == PendingTransition.DEFAULT 7 | } 8 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/core/OnFragmentCreateListener.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.fragment.app.Fragment; 6 | 7 | public interface OnFragmentCreateListener { 8 | void onFragmentCreated(Fragment fragment, Bundle savedInstanceState); 9 | } -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/PendingTransition.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 2 | 3 | /** 4 | * Created by benny on 18/04/2018. 5 | */ 6 | public @interface PendingTransition { 7 | int DEFAULT = -1; 8 | 9 | int enterAnim() default DEFAULT; 10 | int exitAnim() default DEFAULT; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/bennyhuo/tieguanyin/sample/utils/ActivityUtils.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("ActivityUtils") 2 | package com.bennyhuo.tieguanyin.utils 3 | 4 | import android.app.Activity 5 | import android.widget.Toast 6 | 7 | /** 8 | * Created by benny on 2/3/18. 9 | */ 10 | 11 | fun Activity.toast(message: String) = Toast.makeText(this, message, Toast.LENGTH_LONG).show() -------------------------------------------------------------------------------- /app-androidx/src/main/java/com/bennyhuo/tieguanyin/sample/utils/ActivityUtils.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("ActivityUtils") 2 | package com.bennyhuo.tieguanyin.utils 3 | 4 | import android.app.Activity 5 | import android.widget.Toast 6 | 7 | /** 8 | * Created by benny on 2/3/18. 9 | */ 10 | 11 | fun Activity.toast(message: String) = Toast.makeText(this, message, Toast.LENGTH_LONG).show() -------------------------------------------------------------------------------- /app-java/src/main/java/com/bennyhuo/tieguanyin/javademo/App.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.javademo; 2 | 3 | import android.app.Application; 4 | 5 | import com.bennyhuo.tieguanyin.runtime.Tieguanyin; 6 | 7 | public class App extends Application { 8 | @Override 9 | public void onCreate() { 10 | super.onCreate(); 11 | Tieguanyin.init(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/fragment/builder/ConstantBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.fragment.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.basic.builder.BasicConstantBuilder 4 | import com.bennyhuo.tieguanyin.compiler.fragment.FragmentClass 5 | 6 | class ConstantBuilder(fragmentClass: FragmentClass) 7 | :BasicConstantBuilder(fragmentClass) -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/core/OnActivityCreateListener.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | /** 7 | * Created by benny on 1/30/18. 8 | */ 9 | public interface OnActivityCreateListener { 10 | void onActivityCreated(Activity activity, Bundle savedInstanceState); 11 | } 12 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/core/OnActivityCreateListener.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | /** 7 | * Created by benny on 1/30/18. 8 | */ 9 | public interface OnActivityCreateListener { 10 | void onActivityCreated(Activity activity, Bundle savedInstanceState); 11 | } 12 | -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/ActivityBuilderCallback.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | 6 | /** 7 | * Created by benny at 2021/11/30 11:45 AM. 8 | */ 9 | public interface ActivityBuilderCallback { 10 | 11 | void beforeStartActivity(Context context, Intent intent); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/fragment/builder/ConstantBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.fragment.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.builder.BasicConstantBuilder 4 | import com.bennyhuo.tieguanyin.compiler.ksp.fragment.FragmentClass 5 | 6 | class ConstantBuilder(fragmentClass: FragmentClass) 7 | : BasicConstantBuilder(fragmentClass) -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/ActivityBuilderCallback.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | 6 | /** 7 | * Created by benny at 2021/11/30 11:45 AM. 8 | */ 9 | public interface ActivityBuilderCallback { 10 | 11 | void beforeStartActivity(Context context, Intent intent); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/Generated.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 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 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.CLASS) 10 | public @interface Generated { 11 | } 12 | -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/result/fields/ActivityField.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.result.fields; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * Created by benny on 2/6/18. 7 | */ 8 | 9 | public class ActivityField extends ListenerField { 10 | 11 | public ActivityField(Object receiver, Field field) { 12 | super(receiver, field); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/result/fields/ActivityField.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.result.fields; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * Created by benny on 2/6/18. 7 | */ 8 | 9 | public class ActivityField extends ListenerField { 10 | 11 | public ActivityField(Object receiver, Field field) { 12 | super(receiver, field); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /upload.ps1: -------------------------------------------------------------------------------- 1 | ./gradlew :annotations:publishAllPublicationsToMavenCentralRepository 2 | ./gradlew :runtime:publishAllPublicationsToMavenCentralRepository 3 | ./gradlew :runtime-androidx:publishAllPublicationsToMavenCentralRepository 4 | ./gradlew :runtime-kt:publishAllPublicationsToMavenCentralRepository 5 | ./gradlew :compiler:publishAllPublicationsToMavenCentralRepository 6 | ./gradlew :compiler-ksp:publishAllPublicationsToMavenCentralRepository -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app-androidx/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | clear 3 | ./gradlew :annotations:publishAllPublicationsToMavenCentralRepository 4 | ./gradlew :runtime:publishAllPublicationsToMavenCentralRepository 5 | ./gradlew :runtime-androidx:publishAllPublicationsToMavenCentralRepository 6 | ./gradlew :runtime-kt:publishAllPublicationsToMavenCentralRepository 7 | ./gradlew :compiler:publishAllPublicationsToMavenCentralRepository 8 | ./gradlew :compiler-ksp:publishAllPublicationsToMavenCentralRepository -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/result/fields/ViewField.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.result.fields; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * Created by benny on 2/6/18. 7 | */ 8 | 9 | public class ViewField extends ListenerField { 10 | public final int id; 11 | 12 | public ViewField(Object receiver, Field field, int id) { 13 | super(receiver, field); 14 | this.id = id; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/test/java/com/bennyhuo/tieguanyin/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/result/fields/ViewField.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.result.fields; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | /** 6 | * Created by benny on 2/6/18. 7 | */ 8 | 9 | public class ViewField extends ListenerField { 10 | public final int id; 11 | 12 | public ViewField(Object receiver, Field field, int id) { 13 | super(receiver, field); 14 | this.id = id; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app-androidx/src/test/java/com/bennyhuo/tieguanyin/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app-java/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/Required.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 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 benny on 1/29/18. 10 | */ 11 | @Target(ElementType.FIELD) 12 | @Retention(RetentionPolicy.CLASS) 13 | public @interface Required { 14 | String key() default ""; 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | -------------------------------------------------------------------------------- /sample-common/src/test/java/com/bennyhuo/tieguanyin/sample/common/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.sample.common 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /app-androidx/src/main/res/layout/activity_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | -------------------------------------------------------------------------------- /app-androidx/src/main/res/layout/activity_parcelable.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/bennyhuo/tieguanyin/sample/App.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.sample 2 | 3 | import android.app.Application 4 | import android.util.Log 5 | import com.bennyhuo.tieguanyin.runtime.Tieguanyin 6 | 7 | /** 8 | * Created by benny at 2021/11/30 11:57 AM. 9 | */ 10 | class App : Application() { 11 | 12 | override fun onCreate() { 13 | super.onCreate() 14 | Tieguanyin.init(this) { context, intent -> 15 | Log.d("tieguanyin", intent.toString()) 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/core/OnActivityResultListener.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core; 2 | 3 | import android.os.Bundle; 4 | 5 | /** 6 | * Created by benny on 1/31/18. 7 | */ 8 | 9 | public abstract class OnActivityResultListener { 10 | 11 | public final Object realListener; 12 | 13 | public OnActivityResultListener(Object realListener) { 14 | this.realListener = realListener; 15 | } 16 | 17 | public abstract void onResult(Bundle bundle); 18 | } 19 | -------------------------------------------------------------------------------- /app-androidx/src/main/java/com/bennyhuo/tieguanyin/sample/App.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.sample 2 | 3 | import android.app.Application 4 | import android.util.Log 5 | import com.bennyhuo.tieguanyin.runtime.Tieguanyin 6 | 7 | /** 8 | * Created by benny at 2021/11/30 11:57 AM. 9 | */ 10 | class App : Application() { 11 | 12 | override fun onCreate() { 13 | super.onCreate() 14 | Tieguanyin.init(this) { context, intent -> 15 | Log.d("tieguanyin", intent.toString()) 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /app-java/src/test/java/com/bennyhuo/tieguanyin/javademo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.javademo; 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() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/core/OnActivityResultListener.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.core; 2 | 3 | import android.os.Bundle; 4 | 5 | /** 6 | * Created by benny on 1/31/18. 7 | */ 8 | 9 | public abstract class OnActivityResultListener { 10 | 11 | public final Object realListener; 12 | 13 | public OnActivityResultListener(Object realListener) { 14 | this.realListener = realListener; 15 | } 16 | 17 | public abstract void onResult(Bundle bundle); 18 | } 19 | -------------------------------------------------------------------------------- /runtime-kt/src/test/java/com/bennyhuo/tieguanyin/runtime/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime; 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() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /sample-common/src/main/java/com/bennyhuo/tieguanyin/sample/common/BaseActivity.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.sample.common 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import com.bennyhuo.tieguanyin.annotations.Builder 5 | import com.bennyhuo.tieguanyin.annotations.Optional 6 | import com.bennyhuo.tieguanyin.annotations.Required 7 | 8 | @Builder 9 | open class BaseActivity: AppCompatActivity() { 10 | 11 | @Required 12 | var id: Long = 0 13 | 14 | @Optional 15 | var name: String? = null 16 | 17 | } -------------------------------------------------------------------------------- /app-androidx/src/main/java/com/bennyhuo/tieguanyin/sample/SubActivity.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.sample 2 | 3 | import android.os.Bundle 4 | import com.bennyhuo.tieguanyin.annotations.Builder 5 | import com.bennyhuo.tieguanyin.annotations.Required 6 | import com.bennyhuo.tieguanyin.sample.common.BaseActivity 7 | 8 | @Builder 9 | class SubActivity: BaseActivity() { 10 | 11 | @Required 12 | var age: Int = 0 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/Tieguanyin.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime; 2 | 3 | import android.content.Context; 4 | 5 | import com.bennyhuo.tieguanyin.runtime.core.ActivityBuilder; 6 | 7 | public class Tieguanyin { 8 | public static void init(Context context){ 9 | ActivityBuilder.INSTANCE.init(context); 10 | } 11 | 12 | public static void init(Context context, ActivityBuilderCallback callback){ 13 | ActivityBuilder.INSTANCE.init(context); 14 | ActivityBuilder.INSTANCE.setBuilderCallback(callback); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /compiler/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'kotlin' 4 | } 5 | 6 | dependencies { 7 | implementation fileTree(dir: 'libs', include: ['*.jar']) 8 | implementation project(':annotations') 9 | implementation 'com.bennyhuo:aptutils:1.8' 10 | implementation 'com.google.auto:auto-common:0.8' 11 | implementation 'com.squareup:javapoet:1.9.0' 12 | implementation 'com.squareup:kotlinpoet:1.0.0-RC1' 13 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 14 | } 15 | 16 | sourceCompatibility = "1.8" 17 | targetCompatibility = "1.8" 18 | 19 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/Tieguanyin.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime; 2 | 3 | import android.content.Context; 4 | 5 | import com.bennyhuo.tieguanyin.runtime.core.ActivityBuilder; 6 | 7 | public class Tieguanyin { 8 | public static void init(Context context){ 9 | ActivityBuilder.INSTANCE.init(context); 10 | } 11 | 12 | public static void init(Context context, ActivityBuilderCallback callback){ 13 | ActivityBuilder.INSTANCE.init(context); 14 | ActivityBuilder.INSTANCE.setBuilderCallback(callback); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/utils/BundleUtils.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.utils; 2 | 3 | import android.os.Bundle; 4 | 5 | /** 6 | * Created by benny on 1/30/18. 7 | */ 8 | 9 | public class BundleUtils { 10 | public static T get(Bundle bundle, String key){ 11 | return (T) bundle.get(key); 12 | } 13 | 14 | public static T get(Bundle bundle, String key, Object defaultValue){ 15 | Object obj = bundle.get(key); 16 | if(obj == null){ 17 | obj = defaultValue; 18 | } 19 | return (T) obj; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/activity/builder/SaveStateMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.activity.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.activity.ActivityClass 4 | import com.bennyhuo.tieguanyin.compiler.basic.builder.BasicSaveStateMethodBuilder 5 | import com.bennyhuo.tieguanyin.compiler.basic.types.ACTIVITY 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | class SaveStateMethodBuilder(activityClass: ActivityClass) 11 | : BasicSaveStateMethodBuilder(activityClass) { 12 | 13 | override val instanceType = ACTIVITY.java 14 | 15 | } 16 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/fragment/builder/SaveStateMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.fragment.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.basic.builder.BasicSaveStateMethodBuilder 4 | import com.bennyhuo.tieguanyin.compiler.basic.types.FRAGMENT 5 | import com.bennyhuo.tieguanyin.compiler.fragment.FragmentClass 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | class SaveStateMethodBuilder(fragmentClass: FragmentClass) 11 | : BasicSaveStateMethodBuilder(fragmentClass) { 12 | 13 | override val instanceType = FRAGMENT.java 14 | 15 | } 16 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/utils/BundleUtils.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.utils; 2 | 3 | import android.os.Bundle; 4 | 5 | /** 6 | * Created by benny on 1/30/18. 7 | */ 8 | 9 | public class BundleUtils { 10 | public static T get(Bundle bundle, String key){ 11 | return (T) bundle.get(key); 12 | } 13 | 14 | public static T get(Bundle bundle, String key, Object defaultValue){ 15 | Object obj = bundle.get(key); 16 | if(obj == null){ 17 | obj = defaultValue; 18 | } 19 | return (T) obj; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':app-java', ':app-androidx', ':sample-common' 2 | include ':compiler', ':compiler-ksp' 3 | include ':annotations', ':runtime', ':runtime-androidx', ':runtime-kt' 4 | 5 | //includeBuild(file("../ksp")) { 6 | // dependencySubstitution { 7 | // substitute(module("com.google.devtools.ksp:symbol-processing-api")).using(project(":api")) 8 | // substitute(module("com.google.devtools.ksp:symbol-processing")).using(project(":symbol-processing")) 9 | // substitute(module("com.google.devtools.ksp:symbol-processing-gradle-plugin")).using(project(":gradle-plugin")) 10 | // } 11 | //} -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/activity/builder/InjectMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.activity.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.ksp.activity.ActivityClass 4 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.builder.BasicInjectMethodBuilder 5 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.types.ACTIVITY 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | 11 | class InjectMethodBuilder(activityClass: ActivityClass): BasicInjectMethodBuilder(activityClass) { 12 | 13 | override val instanceType = ACTIVITY.kotlin 14 | 15 | } 16 | -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/fragment/builder/InjectMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.fragment.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.builder.BasicInjectMethodBuilder 4 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.types.FRAGMENT 5 | import com.bennyhuo.tieguanyin.compiler.ksp.fragment.FragmentClass 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | 11 | class InjectMethodBuilder(fragmentClass: FragmentClass): BasicInjectMethodBuilder(fragmentClass) { 12 | 13 | override val instanceType = FRAGMENT.kotlin 14 | 15 | } 16 | -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/activity/builder/SaveStateMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.activity.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.ksp.activity.ActivityClass 4 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.builder.BasicSaveStateMethodBuilder 5 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.types.ACTIVITY 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | class SaveStateMethodBuilder(activityClass: ActivityClass) 11 | : BasicSaveStateMethodBuilder(activityClass) { 12 | 13 | override val instanceType = ACTIVITY.kotlin 14 | 15 | } 16 | -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/fragment/builder/SaveStateMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.fragment.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.builder.BasicSaveStateMethodBuilder 4 | import com.bennyhuo.tieguanyin.compiler.ksp.basic.types.FRAGMENT 5 | import com.bennyhuo.tieguanyin.compiler.ksp.fragment.FragmentClass 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | class SaveStateMethodBuilder(fragmentClass: FragmentClass) 11 | : BasicSaveStateMethodBuilder(fragmentClass) { 12 | 13 | override val instanceType = FRAGMENT.kotlin 14 | 15 | } 16 | -------------------------------------------------------------------------------- /app-java/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app-androidx/src/main/java/com/bennyhuo/tieguanyin/sample/inherited/SubActivity.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.sample.inherited 2 | 3 | import android.os.Bundle 4 | import com.bennyhuo.tieguanyin.annotations.Builder 5 | import com.bennyhuo.tieguanyin.annotations.Required 6 | import com.bennyhuo.tieguanyin.sample.common.BaseActivity 7 | 8 | @Builder 9 | class SubActivity: AbsActivity() { 10 | 11 | @Required 12 | var age: Int = 0 13 | 14 | // @Required 15 | // var age2: Int = 0 16 | // 17 | 18 | override fun onCreate(savedInstanceState: Bundle?) { 19 | super.onCreate(savedInstanceState) 20 | println("He") 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/core/KspContext.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.core 2 | 3 | import com.google.devtools.ksp.processing.KSBuiltIns 4 | import com.google.devtools.ksp.processing.KSPLogger 5 | import com.google.devtools.ksp.processing.Resolver 6 | import com.google.devtools.ksp.processing.SymbolProcessorEnvironment 7 | 8 | object KspContext { 9 | 10 | lateinit var environment: SymbolProcessorEnvironment 11 | lateinit var resolver: Resolver 12 | 13 | val builtIns: KSBuiltIns 14 | get() = resolver.builtIns 15 | 16 | } 17 | 18 | val logger: KSPLogger 19 | get() = KspContext.environment.logger -------------------------------------------------------------------------------- /annotations/src/main/java/com/bennyhuo/tieguanyin/annotations/GenerateMode.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.annotations; 2 | 3 | /** 4 | * Created by benny on 2/3/18. 5 | */ 6 | 7 | public enum GenerateMode { 8 | /** 9 | * Generate Java utility method for Java developers only. 10 | */ 11 | JavaOnly, 12 | 13 | /** 14 | * Generate Kotlin utility functions for Kotlin developers only. 15 | */ 16 | KotlinOnly, 17 | 18 | Both, 19 | 20 | /** 21 | * Generate methods according to the source file. 22 | * 23 | * When source is Java file, generate java method, while source is Kotlin file, generate both. 24 | */ 25 | Auto 26 | } 27 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/utils/CamelUtils.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.utils 2 | 3 | /** 4 | * Created by benny on 1/30/18. 5 | */ 6 | fun String.camelToUnderline(): String { 7 | return fold(StringBuilder()) { acc, c -> 8 | if (c.isUpperCase()) { 9 | acc.append("_").append(c.toLowerCase()) 10 | } else acc.append(c) 11 | }.toString() 12 | } 13 | 14 | fun String.underlineToCamel(): String { 15 | var upperNext = false 16 | return fold(StringBuilder()) { acc, c -> 17 | if (c == '_') upperNext = true 18 | else acc.append(if (upperNext) c.toUpperCase() else c) 19 | acc 20 | }.toString() 21 | } 22 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/activity/builder/InjectMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.activity.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.activity.ActivityClass 4 | import com.bennyhuo.tieguanyin.compiler.basic.builder.BasicInjectMethodBuilder 5 | import com.bennyhuo.tieguanyin.compiler.basic.types.ACTIVITY 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | 11 | class InjectMethodBuilder(activityClass: ActivityClass): BasicInjectMethodBuilder(activityClass) { 12 | 13 | override val instanceType = ACTIVITY.java 14 | 15 | override val snippetToRetrieveState = "typedInstance.getIntent().getExtras() : savedInstanceState" 16 | 17 | } 18 | -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/utils/Logger.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.utils; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by benny on 2/9/18. 7 | */ 8 | 9 | public class Logger { 10 | public static final String TAG = "TieGuanYin"; 11 | 12 | public static boolean isDebug = false; 13 | 14 | public static void debug(Object log){ 15 | if(isDebug) Log.d(TAG, String.valueOf(log)); 16 | } 17 | 18 | public static void error(Object log){ 19 | if(isDebug) Log.e(TAG, String.valueOf(log)); 20 | } 21 | 22 | public static void warn(Object log){ 23 | if(isDebug) Log.w(TAG, String.valueOf(log)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /compiler-ksp/src/main/java/com/bennyhuo/tieguanyin/compiler/ksp/utils/CamelUtils.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.ksp.utils 2 | 3 | /** 4 | * Created by benny on 1/30/18. 5 | */ 6 | fun String.camelToUnderline(): String { 7 | return fold(StringBuilder()) { acc, c -> 8 | if (c.isUpperCase()) { 9 | acc.append("_").append(c.toLowerCase()) 10 | } else acc.append(c) 11 | }.toString() 12 | } 13 | 14 | fun String.underlineToCamel(): String { 15 | var upperNext = false 16 | return fold(StringBuilder()) { acc, c -> 17 | if (c == '_') upperNext = true 18 | else acc.append(if (upperNext) c.toUpperCase() else c) 19 | acc 20 | }.toString() 21 | } 22 | -------------------------------------------------------------------------------- /compiler/src/main/java/com/bennyhuo/tieguanyin/compiler/fragment/builder/InjectMethodBuilder.kt: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.compiler.fragment.builder 2 | 3 | import com.bennyhuo.tieguanyin.compiler.basic.builder.BasicInjectMethodBuilder 4 | import com.bennyhuo.tieguanyin.compiler.basic.types.FRAGMENT 5 | import com.bennyhuo.tieguanyin.compiler.fragment.FragmentClass 6 | 7 | /** 8 | * Created by benny on 1/31/18. 9 | */ 10 | 11 | class InjectMethodBuilder(private val fragmentClass: FragmentClass): BasicInjectMethodBuilder(fragmentClass) { 12 | 13 | override val instanceType = FRAGMENT.java 14 | 15 | override val snippetToRetrieveState = "typedInstance.getArguments() : savedInstanceState" 16 | 17 | } 18 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/utils/Logger.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.utils; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by benny on 2/9/18. 7 | */ 8 | 9 | public class Logger { 10 | public static final String TAG = "TieGuanYin"; 11 | 12 | public static boolean isDebug = false; 13 | 14 | public static void debug(Object log){ 15 | if (isDebug) Log.d(TAG, String.valueOf(log)); 16 | } 17 | 18 | public static void error(Object log){ 19 | if (isDebug) Log.e(TAG, String.valueOf(log)); 20 | } 21 | 22 | public static void warn(Object log){ 23 | if (isDebug) Log.w(TAG, String.valueOf(log)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /runtime/src/main/java/com/bennyhuo/tieguanyin/runtime/result/fields/FragmentField.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.result.fields; 2 | 3 | import com.bennyhuo.tieguanyin.runtime.utils.Logger; 4 | 5 | import java.lang.reflect.Field; 6 | 7 | /** 8 | * Created by benny on 2/6/18. 9 | */ 10 | 11 | public class FragmentField extends ListenerField { 12 | public final String who; 13 | 14 | public FragmentField(Object object, Field field, String who) { 15 | super(object, field); 16 | try { 17 | Logger.debug("Setup, Who: " + who + ", fragment=" + field.get(object)); 18 | } catch (IllegalAccessException e) { 19 | e.printStackTrace(); 20 | } 21 | this.who = who; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /runtime-androidx/src/main/java/com/bennyhuo/tieguanyin/runtime/result/fields/FragmentField.java: -------------------------------------------------------------------------------- 1 | package com.bennyhuo.tieguanyin.runtime.result.fields; 2 | 3 | import com.bennyhuo.tieguanyin.runtime.utils.Logger; 4 | 5 | import java.lang.reflect.Field; 6 | 7 | /** 8 | * Created by benny on 2/6/18. 9 | */ 10 | 11 | public class FragmentField extends ListenerField { 12 | public final String who; 13 | 14 | public FragmentField(Object object, Field field, String who) { 15 | super(object, field); 16 | try { 17 | Logger.debug("Setup, Who: " + who + ", fragment=" + field.get(object)); 18 | } catch (IllegalAccessException e) { 19 | e.printStackTrace(); 20 | } 21 | this.who = who; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app-java/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |