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

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

Issue 29572644: Noissue - Lint adjustments
Patch Set: Removing shared prefs editor commit() to apply() change Created Oct. 12, 2017, 9:14 a.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
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)

Powered by Google App Engine
This is Rietveld