| Index: mobile/android/thirdparty/org/adblockplus/browser/StartPane.java |
| =================================================================== |
| --- a/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java |
| +++ b/mobile/android/thirdparty/org/adblockplus/browser/StartPane.java |
| @@ -46,18 +46,18 @@ import android.view.Window; |
| import android.widget.Button; |
| import android.widget.LinearLayout; |
| import android.widget.TextView; |
| public class StartPane extends DialogFragment implements OnClickListener, OnKeyListener |
| { |
| private static final String TAG = "AdblockBrowser.StartPane"; |
| private int currentStep = 0; |
| - private static final HashMap<String, Integer> FONTS = new HashMap<String, Integer>(); |
| - private HashMap<String, Typeface> loadedFonts = new HashMap<String, Typeface>(); |
| + private static final HashMap<String, Integer> FONTS = new HashMap<>(); |
| + private final HashMap<String, Typeface> loadedFonts = new HashMap<>(); |
| 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 |
| }; |
| @@ -70,17 +70,17 @@ public class StartPane extends DialogFra |
| private int[] pagesResourceList; |
| static |
| { |
| FONTS.put("ttf_opensans_light", R.raw.opensans_light); |
| FONTS.put("ttf_opensans_semibold", R.raw.opensans_semibold); |
| } |
| - static Typeface typefaceFromResource(final Context context, final int resId) |
| + private static Typeface typefaceFromResource(final Context context, final int resId) |
| { |
| Typeface ret = null; |
| try |
| { |
| context.getCacheDir().mkdir(); |
| final File output = File.createTempFile("abb_font", ".ttf"); |
| final byte[] buffer = new byte[4096]; |
| final InputStream in = context.getResources().openRawResource(resId); |
| @@ -107,17 +107,17 @@ public class StartPane extends DialogFra |
| } |
| private void loadTypefaces() |
| { |
| final Context context = this.getActivity(); |
| this.loadedFonts.clear(); |
| for (Map.Entry<String, Integer> e : FONTS.entrySet()) |
| { |
| - final Typeface t = typefaceFromResource(context, e.getValue().intValue()); |
| + final Typeface t = typefaceFromResource(context, e.getValue()); |
| if (t != null) |
| { |
| this.loadedFonts.put(e.getKey(), t); |
| } |
| } |
| } |
| private void loadPagesResources() |
| @@ -139,17 +139,17 @@ public class StartPane extends DialogFra |
| @Override |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) |
| { |
| final View view = inflater.inflate(R.layout.abb_start_pane, container, false); |
| this.updateContents(view); |
| this.getDialog().setOnKeyListener(this); |
| - ((Button) view.findViewById(R.id.abb_frp_button)).setOnClickListener(this); |
| + view.findViewById(R.id.abb_frp_button).setOnClickListener(this); |
| return view; |
| } |
| @Override |
| public void onActivityCreated(Bundle savedInstanceState) |
| { |
| super.onActivityCreated(savedInstanceState); |
| @@ -185,17 +185,17 @@ public class StartPane extends DialogFra |
| } |
| return true; |
| } |
| return false; |
| } |
| private static List<View> listViews(final View parent) |
| { |
| - final List<View> views = new ArrayList<View>(); |
| + final List<View> views = new ArrayList<>(); |
| listViews(parent, views); |
| return views; |
| } |
| private static void listViews(final View parent, final List<View> views) |
| { |
| views.add(parent); |
| if (parent instanceof ViewGroup) |