├── core ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── net │ │ └── xkor │ │ └── genaroid │ │ ├── builders │ │ ├── BundleBuilder.java │ │ ├── FragmentBuilder.java │ │ ├── SupportFragmentBuilder.java │ │ ├── IntentBuilder.java │ │ ├── BaseFragmentBuilder.java │ │ ├── IntentBaseBuilder.java │ │ └── BundleBaseBuilder.java │ │ ├── internal │ │ ├── Parameterizable.java │ │ ├── Bindable.java │ │ ├── Inflatable.java │ │ └── Restorable.java │ │ ├── Utils.java │ │ ├── annotations │ │ ├── OnClick.java │ │ ├── OnLongClick.java │ │ ├── OnItemClick.java │ │ ├── OnItemLongClick.java │ │ ├── OnItemSelected.java │ │ └── OnNothingSelected.java │ │ └── Genaroid.java └── build.gradle ├── compiler ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── net │ │ └── xkor │ │ └── genaroid │ │ ├── wrap │ │ ├── ViewWrapper.java │ │ ├── FragmentWrapper.java │ │ ├── SupportFragmentWrapper.java │ │ ├── InflatableWrapper.java │ │ ├── BindableWrapper.java │ │ ├── BaseUiContainerWrapper.java │ │ ├── BaseFragmentWrapper.java │ │ ├── ActivityWrapper.java │ │ ├── BaseClassWrapper.java │ │ └── BundleWrapper.java │ │ ├── Utils.java │ │ ├── tree │ │ ├── GClassMember.java │ │ ├── GField.java │ │ ├── GElement.java │ │ ├── GMethod.java │ │ ├── GUnit.java │ │ └── GClass.java │ │ ├── plugins │ │ ├── PluginsManager.java │ │ ├── GenaroidPlugin.java │ │ ├── ViewByIdPlugin.java │ │ ├── InstanceStatePlugin.java │ │ ├── GActivityPlugin.java │ │ ├── GFragmentPlugin.java │ │ └── ListenersPlugin.java │ │ ├── GenaroidProcessor.java │ │ └── GenaroidEnvironment.java └── build.gradle ├── example ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── styles.xml │ │ │ ├── dimens.xml │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── activity_main.xml │ │ │ └── login_fragment.xml │ │ ├── java │ │ └── net │ │ │ └── xkor │ │ │ └── genaroid │ │ │ └── example │ │ │ ├── BaseFragment.java │ │ │ ├── BaseActivity.java │ │ │ └── LoginFragment.java │ │ └── AndroidManifest.xml └── build.gradle ├── settings.gradle ├── genaroid-logo.png ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitattributes ├── common └── src │ └── main │ └── java │ └── net │ └── xkor │ └── genaroid │ └── annotations │ ├── InstanceState.java │ ├── GActivity.java │ ├── GFragment.java │ ├── CustomListener.java │ ├── BuilderParam.java │ ├── InjectGenaroidCall.java │ └── ViewById.java ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /compiler/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':example', ':compiler', ':core' 2 | -------------------------------------------------------------------------------- /genaroid-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixkor/genaroid/HEAD/genaroid-logo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | .idea 4 | .DS_Store 5 | /build 6 | /captures 7 | *.iml 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixkor/genaroid/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixkor/genaroid/HEAD/example/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixkor/genaroid/HEAD/example/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixkor/genaroid/HEAD/example/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ixkor/genaroid/HEAD/example/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 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-2.13-all.zip 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /example/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.neenbedankt.android-apt' 3 | 4 | android { 5 | compileSdkVersion 23 6 | buildToolsVersion "23.0.2" 7 | 8 | sourceCompatibility = 1.7 9 | targetCompatibility = 1.7 10 | 11 | defaultConfig { 12 | applicationId "net.xkor.genaroid.example" 13 | minSdkVersion 11 14 | targetSdkVersion 23 15 | } 16 | } 17 | 18 | dependencies { 19 | //noinspection GradleDynamicVersion 20 | compile 'net.xkor.genaroid:core:1.+' 21 | //noinspection GradleDynamicVersion 22 | apt 'net.xkor.genaroid:compiler:1.+' 23 | compile 'com.android.support:appcompat-v7:23.4.0' 24 | } 25 | 26 | apt { 27 | arguments { 28 | genaroidDebugMode true 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/builders/BundleBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.builders; 18 | 19 | public class BundleBuilder extends BundleBaseBuilder { 20 | protected BundleBuilder() { 21 | super(BundleBuilder.class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/internal/Parameterizable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.internal; 18 | 19 | import android.os.Bundle; 20 | 21 | /** 22 | * For internal usage only! 23 | */ 24 | public interface Parameterizable { 25 | void _gen_readParams(Bundle params); 26 | } 27 | -------------------------------------------------------------------------------- /example/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 16dp 20 | 16dp 21 | 22 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/internal/Bindable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.internal; 18 | 19 | import android.view.View; 20 | 21 | /** 22 | * For internal usage only! 23 | */ 24 | public interface Bindable { 25 | void _gen_bind(View rootView); 26 | 27 | void _gen_unbind(); 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/internal/Inflatable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.internal; 18 | 19 | import android.support.annotation.LayoutRes; 20 | 21 | /** 22 | * For internal usage only! 23 | */ 24 | public interface Inflatable { 25 | @LayoutRes 26 | int _gen_getLayoutId(); 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/internal/Restorable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.internal; 18 | 19 | import android.os.Bundle; 20 | 21 | /** 22 | * For internal usage only! 23 | */ 24 | public interface Restorable { 25 | void _gen_saveInstanceState(Bundle outState); 26 | 27 | void _gen_restoreInstanceState(Bundle savedState); 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/net/xkor/genaroid/annotations/InstanceState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Retention(RetentionPolicy.SOURCE) 25 | @Target(ElementType.FIELD) 26 | public @interface InstanceState { 27 | } 28 | -------------------------------------------------------------------------------- /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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | org.gradle.daemon=true 21 | org.gradle.jvmargs=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006 22 | group=net.xkor.genaroid 23 | version=1.3.0 -------------------------------------------------------------------------------- /compiler/src/main/java/net/xkor/genaroid/wrap/ViewWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.wrap; 18 | 19 | import com.sun.tools.javac.model.JavacElements; 20 | 21 | public class ViewWrapper extends BaseClassWrapper { 22 | protected ViewWrapper(JavacElements utils, String classFullName) { 23 | super(utils, classFullName); 24 | } 25 | 26 | public ViewWrapper(JavacElements utils) { 27 | super(utils, "android.view.View"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | Genaroid 19 | MainActivity 20 | 21 | Hello world! 22 | Settings 23 | Password 24 | Login 25 | Sign In 26 | 27 | -------------------------------------------------------------------------------- /compiler/src/main/java/net/xkor/genaroid/wrap/FragmentWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.wrap; 18 | 19 | import com.sun.tools.javac.model.JavacElements; 20 | 21 | public class FragmentWrapper extends BaseFragmentWrapper { 22 | protected FragmentWrapper(JavacElements utils, String classFullName) { 23 | super(utils, classFullName); 24 | } 25 | 26 | public FragmentWrapper(JavacElements utils) { 27 | super(utils, "android.app.Fragment"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /compiler/src/main/java/net/xkor/genaroid/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid; 18 | 19 | import java.io.PrintWriter; 20 | import java.io.StringWriter; 21 | 22 | public final class Utils { 23 | public static String getStackTrace(Throwable error) { 24 | StringWriter stringWriter = new StringWriter(); 25 | PrintWriter printWriter = new PrintWriter(stringWriter); 26 | error.printStackTrace(printWriter); 27 | return stringWriter.toString(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /compiler/src/main/java/net/xkor/genaroid/wrap/SupportFragmentWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.wrap; 18 | 19 | import com.sun.tools.javac.model.JavacElements; 20 | 21 | public class SupportFragmentWrapper extends BaseFragmentWrapper { 22 | protected SupportFragmentWrapper(JavacElements utils, String classFullName) { 23 | super(utils, classFullName); 24 | } 25 | 26 | public SupportFragmentWrapper(JavacElements utils) { 27 | super(utils, "android.support.v4.app.Fragment"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /compiler/src/main/java/net/xkor/genaroid/wrap/InflatableWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.wrap; 18 | 19 | import com.sun.tools.javac.code.Symbol; 20 | import com.sun.tools.javac.model.JavacElements; 21 | 22 | public class InflatableWrapper extends BaseClassWrapper { 23 | public InflatableWrapper(JavacElements utils) { 24 | super(utils, "net.xkor.genaroid.internal.Inflatable"); 25 | } 26 | 27 | public Symbol.MethodSymbol getGetLayoutIdMethod() { 28 | return (Symbol.MethodSymbol) getMember("_gen_getLayoutId"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /example/src/main/java/net/xkor/genaroid/example/BaseFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.example; 18 | 19 | import android.os.Bundle; 20 | import android.support.v4.app.Fragment; 21 | 22 | import net.xkor.genaroid.annotations.BuilderParam; 23 | import net.xkor.genaroid.annotations.GFragment; 24 | import net.xkor.genaroid.annotations.InstanceState; 25 | 26 | @GFragment() 27 | public abstract class BaseFragment extends Fragment { 28 | @InstanceState 29 | private Bundle bundleField; 30 | 31 | @BuilderParam() 32 | private int testArg; 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/net/xkor/genaroid/annotations/GActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | import android.support.annotation.LayoutRes; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | @Retention(RetentionPolicy.SOURCE) 27 | @Target(ElementType.TYPE) 28 | public @interface GActivity { 29 | @LayoutRes int value() default 0; 30 | @InjectGenaroidCall int injectCalls() default InjectGenaroidCall.ALL; 31 | } 32 | -------------------------------------------------------------------------------- /common/src/main/java/net/xkor/genaroid/annotations/GFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | import android.support.annotation.LayoutRes; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | @Retention(RetentionPolicy.SOURCE) 27 | @Target(ElementType.TYPE) 28 | public @interface GFragment { 29 | @LayoutRes int value() default 0; 30 | @InjectGenaroidCall int injectCalls() default InjectGenaroidCall.ALL; 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/builders/FragmentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.builders; 18 | 19 | import android.app.Fragment; 20 | import android.os.Bundle; 21 | 22 | public class FragmentBuilder> extends BaseFragmentBuilder { 23 | protected FragmentBuilder(Class fragmentClass, Class builderClass) { 24 | super(fragmentClass, builderClass); 25 | } 26 | 27 | @Override 28 | protected void setArgs(F fragment, Bundle bundle) { 29 | fragment.setArguments(bundle); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/builders/SupportFragmentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.builders; 18 | 19 | import android.os.Bundle; 20 | import android.support.v4.app.Fragment; 21 | 22 | public class SupportFragmentBuilder> extends BaseFragmentBuilder { 23 | protected SupportFragmentBuilder(Class fragmentClass, Class builderClass) { 24 | super(fragmentClass, builderClass); 25 | } 26 | 27 | @Override 28 | protected void setArgs(F fragment, Bundle bundle) { 29 | fragment.setArguments(bundle); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid; 18 | 19 | import android.os.Parcelable; 20 | 21 | import java.lang.reflect.Array; 22 | 23 | public final class Utils { 24 | @SuppressWarnings("unchecked") 25 | public static T[] castParcelableArray(Class clazz, Parcelable[] parcelableArray) { 26 | final int length = parcelableArray.length; 27 | final T[] array = (T[]) Array.newInstance(clazz, length); 28 | for (int i = 0; i < length; i++) { 29 | array[i] = (T) parcelableArray[i]; 30 | } 31 | return array; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /compiler/src/main/java/net/xkor/genaroid/wrap/BindableWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.wrap; 18 | 19 | import com.sun.tools.javac.code.Symbol; 20 | import com.sun.tools.javac.model.JavacElements; 21 | 22 | public class BindableWrapper extends BaseClassWrapper { 23 | public BindableWrapper(JavacElements utils) { 24 | super(utils, "net.xkor.genaroid.internal.Bindable"); 25 | } 26 | 27 | public Symbol.MethodSymbol getBindMethod() { 28 | return (Symbol.MethodSymbol) getMember("_gen_bind"); 29 | } 30 | 31 | public Symbol.MethodSymbol getUnbindMethod() { 32 | return (Symbol.MethodSymbol) getMember("_gen_unbind"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/annotations/OnClick.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | 20 | import android.support.annotation.IdRes; 21 | import android.view.View; 22 | 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Retention(RetentionPolicy.SOURCE) 29 | @Target(ElementType.METHOD) 30 | @CustomListener( 31 | targetClass = View.class, 32 | listenerClass = View.OnClickListener.class, 33 | listenerSetterName = "setOnClickListener") 34 | public @interface OnClick { 35 | @IdRes int[] value(); 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/annotations/OnLongClick.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | 20 | import android.support.annotation.IdRes; 21 | import android.view.View; 22 | 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Retention(RetentionPolicy.SOURCE) 29 | @Target(ElementType.METHOD) 30 | @CustomListener( 31 | targetClass = View.class, 32 | listenerClass = View.OnLongClickListener.class, 33 | listenerSetterName = "setOnLongClickListener") 34 | public @interface OnLongClick { 35 | @IdRes int[] value(); 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/annotations/OnItemClick.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | 20 | import android.support.annotation.IdRes; 21 | import android.widget.AdapterView; 22 | 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Retention(RetentionPolicy.SOURCE) 29 | @Target(ElementType.METHOD) 30 | @CustomListener( 31 | targetClass = AdapterView.class, 32 | listenerClass = AdapterView.OnItemClickListener.class, 33 | listenerSetterName = "setOnItemClickListener") 34 | public @interface OnItemClick { 35 | @IdRes int[] value(); 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/annotations/OnItemLongClick.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | 20 | import android.support.annotation.IdRes; 21 | import android.widget.AdapterView; 22 | 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Retention(RetentionPolicy.SOURCE) 29 | @Target(ElementType.METHOD) 30 | @CustomListener( 31 | targetClass = AdapterView.class, 32 | listenerClass = AdapterView.OnItemLongClickListener.class, 33 | listenerSetterName = "setOnItemLongClickListener") 34 | public @interface OnItemLongClick { 35 | @IdRes int[] value(); 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/annotations/OnItemSelected.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | 20 | import android.support.annotation.IdRes; 21 | import android.widget.AdapterView; 22 | 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Retention(RetentionPolicy.SOURCE) 29 | @Target(ElementType.METHOD) 30 | @CustomListener( 31 | targetClass = AdapterView.class, 32 | listenerClass = AdapterView.OnItemSelectedListener.class, 33 | listenerSetterName = "setOnItemSelectedListener", 34 | listenerMethodName = "onItemSelected") 35 | public @interface OnItemSelected { 36 | @IdRes int[] value(); 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/annotations/OnNothingSelected.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | 20 | import android.support.annotation.IdRes; 21 | import android.widget.AdapterView; 22 | 23 | import java.lang.annotation.ElementType; 24 | import java.lang.annotation.Retention; 25 | import java.lang.annotation.RetentionPolicy; 26 | import java.lang.annotation.Target; 27 | 28 | @Retention(RetentionPolicy.SOURCE) 29 | @Target(ElementType.METHOD) 30 | @CustomListener( 31 | targetClass = AdapterView.class, 32 | listenerClass = AdapterView.OnItemSelectedListener.class, 33 | listenerSetterName = "setOnItemSelectedListener", 34 | listenerMethodName = "onNothingSelected") 35 | public @interface OnNothingSelected { 36 | @IdRes int[] value(); 37 | } 38 | -------------------------------------------------------------------------------- /common/src/main/java/net/xkor/genaroid/annotations/CustomListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Retention(RetentionPolicy.CLASS) 25 | @Target(ElementType.ANNOTATION_TYPE) 26 | public @interface CustomListener { 27 | Class listenerClass(); 28 | 29 | Class targetClass(); 30 | 31 | /** 32 | * The method name of a target class that sets listener. 33 | */ 34 | String listenerSetterName(); 35 | 36 | /** 37 | * The method name of a listener interface. Can be empty for listeners that have only one method. 38 | */ 39 | String listenerMethodName() default ""; 40 | } 41 | -------------------------------------------------------------------------------- /example/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 19 | 20 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /common/src/main/java/net/xkor/genaroid/annotations/BuilderParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Retention(RetentionPolicy.SOURCE) 25 | @Target(ElementType.FIELD) 26 | public @interface BuilderParam { 27 | /** 28 | * The key of the injected Fragment argument, Activity extra or other object with Bundle. 29 | * 30 | * @return the key, default value - name of field. 31 | */ 32 | String value() default ""; 33 | 34 | /** 35 | * The flag indicating a mandatory or not this parameter. 36 | * 37 | * @return true if optional, else false. 38 | */ 39 | boolean optional() default false; 40 | } 41 | -------------------------------------------------------------------------------- /common/src/main/java/net/xkor/genaroid/annotations/InjectGenaroidCall.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.annotations; 18 | 19 | import android.support.annotation.IntDef; 20 | 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | 24 | @IntDef(flag = true, value = { 25 | InjectGenaroidCall.NONE, 26 | InjectGenaroidCall.BIND, 27 | InjectGenaroidCall.INSTANCE_STATE, 28 | InjectGenaroidCall.READ_PARAMS, 29 | InjectGenaroidCall.INFLATE_LAYOUT, 30 | InjectGenaroidCall.ALL}) 31 | @Retention(RetentionPolicy.SOURCE) 32 | public @interface InjectGenaroidCall { 33 | int NONE = 0; 34 | int BIND = 1; 35 | int INSTANCE_STATE = 1 << 1; 36 | int READ_PARAMS = 1 << 2; 37 | int INFLATE_LAYOUT = 1 << 3; 38 | int ALL = BIND | INSTANCE_STATE | READ_PARAMS | INFLATE_LAYOUT; 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/net/xkor/genaroid/builders/IntentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Aleksei Skoriatin 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed To in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.xkor.genaroid.builders; 18 | 19 | import android.content.Context; 20 | import android.content.Intent; 21 | import android.net.Uri; 22 | 23 | public class IntentBuilder extends IntentBaseBuilder { 24 | 25 | public IntentBuilder(Intent intent) { 26 | super(intent, IntentBuilder.class); 27 | } 28 | 29 | public IntentBuilder(Context context, Class cls) { 30 | this(new Intent(context, cls)); 31 | } 32 | 33 | public IntentBuilder() { 34 | this(new Intent()); 35 | } 36 | 37 | public IntentBuilder(String action) { 38 | this(new Intent(action)); 39 | } 40 | 41 | public IntentBuilder(String action, Uri uri) { 42 | this(new Intent(action, uri)); 43 | } 44 | 45 | public IntentBuilder(String action, Uri uri, Context context, Class cls) { 46 | this(new Intent(action, uri, context, cls)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/src/main/res/layout/login_fragment.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 21 | 22 | 27 | 28 | 34 | 35 |