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

Unified Diff: src/org/adblockplus/android/RefreshableListPreference.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Adressed first batch of review issues. Created April 16, 2014, 5:36 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 | « src/org/adblockplus/android/ProxySettings.java ('k') | src/org/adblockplus/android/Starter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/android/RefreshableListPreference.java
diff --git a/src/org/adblockplus/android/RefreshableListPreference.java b/src/org/adblockplus/android/RefreshableListPreference.java
index cb5023064f5c079c2a95dd1dfc62d4912e6c7070..a1cabd4ac7aeafd8295b7ee181bafdc91ce4134b 100644
--- a/src/org/adblockplus/android/RefreshableListPreference.java
+++ b/src/org/adblockplus/android/RefreshableListPreference.java
@@ -33,41 +33,44 @@ public class RefreshableListPreference extends ListPreference
{
private OnClickListener refreshClickListener;
- public RefreshableListPreference(Context context, AttributeSet attrs)
+ public RefreshableListPreference(final Context context, final AttributeSet attrs)
{
super(context, attrs);
}
@Override
- protected void onBindView(View view)
+ protected void onBindView(final View view)
{
super.onBindView(view);
final ImageView refreshImage = new ImageView(getContext());
- ViewGroup widgetFrameView = ((ViewGroup) view.findViewById(android.R.id.widget_frame));
+ final ViewGroup widgetFrameView = ((ViewGroup) view.findViewById(android.R.id.widget_frame));
if (widgetFrameView == null)
return;
widgetFrameView.setVisibility(View.VISIBLE);
- int rightPaddingDip = android.os.Build.VERSION.SDK_INT < 14 ? 8 : 5;
- float density = getContext().getResources().getDisplayMetrics().density;
+ final int rightPaddingDip = android.os.Build.VERSION.SDK_INT < 14 ? 8 : 5;
+ final float density = getContext().getResources().getDisplayMetrics().density;
if (widgetFrameView instanceof LinearLayout)
{
((LinearLayout) widgetFrameView).setOrientation(LinearLayout.HORIZONTAL);
}
widgetFrameView.addView(refreshImage, 0);
refreshImage.setImageResource(R.drawable.ic_menu_refresh);
- refreshImage.setPadding(refreshImage.getPaddingLeft(), refreshImage.getPaddingTop(), (int) (density * rightPaddingDip), refreshImage.getPaddingBottom());
+ refreshImage.setPadding(refreshImage.getPaddingLeft(), refreshImage.getPaddingTop(), (int) (density * rightPaddingDip),
+ refreshImage.getPaddingBottom());
refreshImage.setOnClickListener(new OnClickListener()
{
@Override
- public void onClick(View v)
+ public void onClick(final View v)
{
if (refreshClickListener != null)
+ {
refreshClickListener.onClick(refreshImage);
+ }
}
});
}
- public void setOnRefreshClickListener(OnClickListener l)
+ public void setOnRefreshClickListener(final OnClickListener l)
{
refreshClickListener = l;
}
« no previous file with comments | « src/org/adblockplus/android/ProxySettings.java ('k') | src/org/adblockplus/android/Starter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld