am 8ab0d48a: Merge "Showcase: Update SDK to 23 and support lib to 23.0.1" into mnc-ub-dev
* commit '8ab0d48a61987446c782d2d5816c522b2768adc6': Showcase: Update SDK to 23 and support lib to 23.0.1
This commit is contained in:
@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion 'android-MNC'
|
||||
buildToolsVersion "22.0.1"
|
||||
compileSdkVersion 'android-23'
|
||||
buildToolsVersion "23.0.1"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "android.support.v17.leanback.supportleanbackshowcase"
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 'MNC'
|
||||
targetSdkVersion '23'
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
}
|
||||
@@ -22,15 +22,15 @@ android {
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:recyclerview-v7:23.0.0-rc1'
|
||||
compile 'com.android.support:leanback-v17:23.0.0-rc1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.0-rc1'
|
||||
compile 'com.android.support:recyclerview-v7:23.0.1'
|
||||
compile 'com.android.support:leanback-v17:23.0.1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.1'
|
||||
|
||||
compile 'com.android.support:preference-v7:23.0.0-rc1'
|
||||
compile 'com.android.support:preference-leanback-v17:23.0.0-rc1'
|
||||
compile 'com.android.support:preference-v14:23.0.0-rc1'
|
||||
compile 'com.android.support:preference-v7:23.0.1'
|
||||
compile 'com.android.support:preference-leanback-v17:23.0.1'
|
||||
compile 'com.android.support:preference-v14:23.0.1'
|
||||
|
||||
compile 'com.google.code.gson:gson:1.7.2'
|
||||
compile 'com.squareup.picasso:picasso:2.3.2'
|
||||
compile 'com.android.support:palette-v7:23.0.0-rc1'
|
||||
compile 'com.android.support:palette-v7:23.0.1'
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ public class DialogExampleActivity extends Activity {
|
||||
getWindow().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#21272A")));
|
||||
|
||||
GuidedStepFragment fragment = new DialogExampleFragment();
|
||||
GuidedStepFragment.add(getFragmentManager(), fragment);
|
||||
GuidedStepFragment.addAsRoot(this, fragment, android.R.id.content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,12 +32,6 @@ public class WizardExample1stStepFragment extends WizardExampleBaseStepFragment
|
||||
private static final int ACTION_ID_BUY_HD = 1;
|
||||
private static final int ACTION_ID_BUY_SD = ACTION_ID_BUY_HD + 1;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWizardActivity().setStep(1);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GuidanceStylist.Guidance onCreateGuidance(Bundle savedInstanceState) {
|
||||
|
||||
@@ -45,12 +45,6 @@ public class WizardExample2ndStepFragment extends WizardExampleBaseStepFragment
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWizardActivity().setStep(2);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GuidanceStylist.Guidance onCreateGuidance(Bundle savedInstanceState) {
|
||||
|
||||
@@ -35,12 +35,6 @@ public class WizardExample3rdStepFragment extends WizardExampleBaseStepFragment
|
||||
private static final int ACTION_ID_PROCESSING = 1;
|
||||
private final Handler mFakeHttpHandler = new Handler();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWizardActivity().setStep(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
@@ -33,12 +33,6 @@ public class WizardExample4thStepFragment extends WizardExampleBaseStepFragment
|
||||
private static final int ACTION_ID_WATCH = 1;
|
||||
private static final int ACTION_ID_LATER = ACTION_ID_WATCH + 1;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWizardActivity().setStep(4);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GuidanceStylist.Guidance onCreateGuidance(Bundle savedInstanceState) {
|
||||
|
||||
@@ -25,46 +25,23 @@ import android.support.v17.leanback.supportleanbackshowcase.R;
|
||||
*/
|
||||
public class WizardExampleActivity extends Activity {
|
||||
|
||||
// When the user 'bought' the product and presses back, we don't want to show the 'Processing..'
|
||||
// screen again, instead we want to go back to the very first step or close the wizard. Thus, we
|
||||
// have to save the current step of the wizard and make it accessible to it's children.
|
||||
private int mStep = 0;
|
||||
|
||||
@Override public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getWindow().setBackgroundDrawableResource(R.drawable.wizard_background_blackned);
|
||||
|
||||
// Recover old step state.
|
||||
if (savedInstanceState != null) {
|
||||
mStep = savedInstanceState.getInt("step");
|
||||
}
|
||||
|
||||
GuidedStepFragment fragment = new WizardExample1stStepFragment();
|
||||
fragment.setArguments(getIntent().getExtras()); // Delegate Movie to first step.
|
||||
GuidedStepFragment.add(getFragmentManager(), fragment);
|
||||
}
|
||||
|
||||
public int getStep() {
|
||||
return mStep;
|
||||
}
|
||||
|
||||
public void setStep(int step) {
|
||||
mStep = step;
|
||||
GuidedStepFragment.addAsRoot(this, fragment, android.R.id.content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (4 == getStep()) {
|
||||
if (GuidedStepFragment.getCurrentGuidedStepFragment(getFragmentManager())
|
||||
instanceof WizardExample4thStepFragment) {
|
||||
// The user 'bought' the product. When he presses 'Back' the Wizard will be closed and
|
||||
// he will not be send back to 'Processing Payment...'-Screen.
|
||||
finish();
|
||||
} else super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
|
||||
// Save current step persitently.
|
||||
outPersistentState.putInt("step", mStep);
|
||||
super.onSaveInstanceState(outState, outPersistentState);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user