This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'kotlin-android' | |
kapt { | |
correctErrorTypes = true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@InjectPreference | |
public PreferenceComponent_UserProfileComponent component; | |
@InjectPreference | |
public Preference_UserProfile userProfile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
PreferenceComponent_UserProfileComponent.getInstance().inject(this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Component integrates entities. | |
*/ | |
@PreferenceComponent(entities = {Profile.class, Device.class}) | |
public interface UserProfileComponent { | |
/** | |
* declare dependency injection targets. | |
*/ | |
void inject(MainActivity __); | |
void inject(LoginActivity __); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Preference_UserProfile userProfile = PreferenceComponent_UserProfileComponent.getInstance().UserProfile(); | |
Preference_UserDevice userDevice = PreferenceComponent_UserProfileComponent.getInstance().UserDevice(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
PreferenceComponent_UserProfileComponent.init(this); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PreferenceComponent(entities = {Profile.class, Device.class}) | |
public interface UserProfileComponent { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PreferenceFunction(keyname = "uuid") | |
public String putUuidFunction(String uuid) { | |
return SecurityUtils.encrypt(uuid); | |
} | |
@PreferenceFunction(keyname = "uuid") | |
public String getUuidFunction(String uuid) { | |
return SecurityUtils.decrypt(uuid); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component.UserProfile().putVisits(component.UserProfile().getVisits()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PreferenceFunction(keyname = "visits") | |
public int putVisitCountFunction(int count) { | |
return ++count; | |
} |