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..0f7383dace19af6aaaa17fef33a97f29a3814203 100644 |
--- a/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java |
+++ b/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java |
@@ -49,11 +49,27 @@ 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; |
+ 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 +154,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 +171,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 +209,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) |