SupportLeanbackShowcase: Provided context for calls to
GuidedAction.Builder
GuidedActions were created without the activity argument in the old
version; updated the API calls to use their context within the fragment.
Change-Id: I4b3433f9e0cdfe5fa84a56a78413c219fbc4d939
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample1stStepFragment.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample1stStepFragment.java
index b40cc82..c3623d0 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample1stStepFragment.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample1stStepFragment.java
@@ -43,20 +43,20 @@
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
- GuidedAction action = new GuidedAction.Builder()
+ GuidedAction action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_BUY_HD)
- .title(getString(R.string.wizard_example_rent_hd))
+ .title(R.string.wizard_example_rent_hd)
.editable(false)
.description(mMovie.getPriceHd() + " " +
getString(R.string.wizard_example_watch_hd))
.build();
actions.add(action);
- action = new GuidedAction.Builder()
+ action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_BUY_SD)
.title(getString(R.string.wizard_example_rent_sd))
.editable(false)
.description(mMovie.getPriceSd() + " " +
- getString(R.string.wizard_example_watch_sd))
+ R.string.wizard_example_watch_sd)
.build();
actions.add(action);
}
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample2ndStepFragment.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample2ndStepFragment.java
index c1df8a1..019af2f 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample2ndStepFragment.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample2ndStepFragment.java
@@ -60,18 +60,18 @@
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
boolean rentHighDefinition = getArguments().getBoolean(ARG_HD);
- GuidedAction action = new GuidedAction.Builder()
+ GuidedAction action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_CONFIRM)
- .title(getString(R.string.wizard_example_rent))
+ .title(R.string.wizard_example_rent)
.description(rentHighDefinition ? mMovie.getPriceHd() : mMovie.getPriceSd())
.editable(false)
.build();
actions.add(action);
- action = new GuidedAction.Builder()
+ action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_PAYMENT_METHOD)
- .title(getString(R.string.wizard_example_payment_method))
+ .title(R.string.wizard_example_payment_method)
.editTitle("")
- .description(getString(R.string.wizard_example_input_credit))
+ .description(R.string.wizard_example_input_credit)
.editable(true)
.build();
actions.add(action);
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample3rdStepFragment.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample3rdStepFragment.java
index 37f662f..27e9f98 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample3rdStepFragment.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample3rdStepFragment.java
@@ -78,9 +78,9 @@
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
- GuidedAction action = new GuidedAction.Builder()
+ GuidedAction action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_PROCESSING)
- .title(getString(R.string.wizard_example_processing))
+ .title(R.string.wizard_example_processing)
.infoOnly(true)
.build();
actions.add(action);
diff --git a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample4thStepFragment.java b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample4thStepFragment.java
index be5e645..ec29809 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample4thStepFragment.java
+++ b/samples/SupportLeanbackShowcase/app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/wizard/WizardExample4thStepFragment.java
@@ -44,16 +44,16 @@
@Override
public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {
- GuidedAction action = new GuidedAction.Builder()
+ GuidedAction action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_WATCH)
.editable(false)
- .title(getString(R.string.wizard_example_watch_now))
+ .title(R.string.wizard_example_watch_now)
.build();
actions.add(action);
- action = new GuidedAction.Builder()
+ action = new GuidedAction.Builder(getActivity())
.id(ACTION_ID_LATER)
.editable(false)
- .title(getString(R.string.wizard_example_later))
+ .title(R.string.wizard_example_later)
.build();
actions.add(action);
}
diff --git a/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml b/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml
index 4e866de..036d92d 100644
--- a/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml
+++ b/samples/SupportLeanbackShowcase/app/src/main/res/values/styles.xml
@@ -76,7 +76,7 @@
<item name="imageCardViewBadgeStyle">@style/MovieCardBadgeStyle</item>
<item name="imageCardViewContentStyle">@style/MovieCardContentStyle</item>
</style>
-
+
<!-- Theme corresponding to the MovieCardBasicStyle -->
<style name="MovieCardBasicTheme" parent="MovieCardCompleteTheme">
<item name="imageCardViewContentStyle">@style/MovieCardContentGoneStyle</item>