Commit 54872cab authored by Yusuke Iwaki's avatar Yusuke Iwaki

introduce Icepick.

parent 2ae619c8
......@@ -72,6 +72,7 @@ repositories {
maven { url 'https://github.com/lijingle1/stetho-realm/raw/master/maven-repo' }
maven { url 'https://github.com/RocketChat/Android-DDP/raw/master/repository' }
maven { url 'http://dl.bintray.com/amulyakhare/maven' }
maven {url "https://clojars.org/repo/"} //for icepick.
}
dependencies {
......@@ -97,4 +98,7 @@ dependencies {
compile 'com.trello:rxlifecycle-components:1.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'frankiesardo:icepick:3.2.0'
provided 'frankiesardo:icepick-processor:3.2.0'
}
......@@ -15,3 +15,13 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Icepick
-dontwarn icepick.**
-keep class icepick.** { *; }
-keep class **$$Icepick { *; }
-keepclasseswithmembernames class * {
@icepick.* <fields>;
}
-keepnames class * { @icepick.State *;}
\ No newline at end of file
package chat.rocket.android.activity;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import chat.rocket.android.helper.OnBackPressListener;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
import icepick.Icepick;
abstract class AbstractFragmentActivity extends RxAppCompatActivity {
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
}
@Override protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
protected abstract @IdRes int getLayoutContainerForFragment();
@Override public final void onBackPressed() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment