Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: mobile/android/thirdparty/org/adblockplus/browser/StartPane.java

Issue 29325578: Issue 2938 - Hide the beta community first run slide (Closed)
Patch Set: Mentioned follow-up issue Created Sept. 2, 2015, 3:17 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mobile/android/thirdparty/org/adblockplus/browser/StartPane.java
diff --git a/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java b/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java
index fcd689c084f3a6fd73e9580655db1c591b41d1dd..91b15c495002fb2d24183e50ca65be2049b994f1 100644
--- a/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java
+++ b/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java
@@ -49,11 +49,30 @@ import android.widget.TextView;
public class StartPane extends DialogFragment implements OnClickListener, OnKeyListener
{
private static final String TAG = "AdblockBrowser.StartPane";
- private int currentStep = 1;
- private static final int NUMBER_OF_STEPS = 3;
+ private int currentStep = 0;
+ // For now we disable the beta community page,
+ // see https://issues.adblockplus.org/ticket/2937 for a follow-up issue
+ // for detecting whether we are on the beta channel or not
+ private static final boolean SKIP_BETA_COMMUNITY_PAGE = true;
private static final HashMap<String, Integer> FONTS = new HashMap<String, Integer>();
private HashMap<String, Typeface> loadedFonts = new HashMap<String, Typeface>();
+ private static final int[] BETA_RESOURCE_LIST =
+ {
+ R.layout.abb_start_pane_step_1, R.string.abb_frp_button_1,
+ R.layout.abb_start_pane_step_2, R.string.abb_frp_button_2,
+ R.layout.abb_start_pane_step_3, R.string.abb_frp_button_3
+ };
+
+ private static final int[] RELEASE_RESOURCE_LIST =
+ {
+ R.layout.abb_start_pane_step_1, R.string.abb_frp_button_2,
+ R.layout.abb_start_pane_step_2, R.string.abb_frp_button_3
+ };
+
+ private static final int[] PAGES_RESOURCE_LIST = SKIP_BETA_COMMUNITY_PAGE ?
+ RELEASE_RESOURCE_LIST : BETA_RESOURCE_LIST;
+
static
{
FONTS.put("ttf_opensans_light", R.raw.opensans_light);
@@ -138,9 +157,10 @@ public class StartPane extends DialogFragment implements OnClickListener, OnKeyL
@Override
public void onClick(View v)
{
- if (this.currentStep < NUMBER_OF_STEPS)
+ final int nextStep = this.currentStep + 1;
+ if (nextStep * 2 < PAGES_RESOURCE_LIST.length)
{
- this.currentStep++;
+ this.currentStep = nextStep;
this.updateContents(this.getView());
}
else
@@ -154,7 +174,7 @@ public class StartPane extends DialogFragment implements OnClickListener, OnKeyL
{
if (keyCode == KeyEvent.KEYCODE_BACK)
{
- if (event.getAction() == KeyEvent.ACTION_DOWN && this.currentStep > 1)
+ if (event.getAction() == KeyEvent.ACTION_DOWN && this.currentStep > 0)
{
this.currentStep--;
this.updateContents(this.getView());
@@ -192,15 +212,8 @@ public class StartPane extends DialogFragment implements OnClickListener, OnKeyL
final LayoutInflater inflater = (LayoutInflater) this.getActivity()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- inflater.inflate(
- this.getResources().getIdentifier("abb_start_pane_step_" + this.currentStep,
- "layout",
- this.getActivity().getPackageName()), ll, true);
-
- this.setButtonText(view, R.id.abb_frp_button,
- this.getResources().getIdentifier("abb_frp_button_" + this.currentStep,
- "string",
- this.getActivity().getPackageName()));
+ inflater.inflate(PAGES_RESOURCE_LIST[this.currentStep * 2], ll, true);
+ this.setButtonText(view, R.id.abb_frp_button, PAGES_RESOURCE_LIST[this.currentStep * 2 + 1]);
final List<View> views = listViews(view);
for (View v : views)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld