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; |
} |