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..f24bd90bd46aed83f196f8562df29bf74733f6fd 100644 |
--- a/src/org/adblockplus/android/RefreshableListPreference.java |
+++ b/src/org/adblockplus/android/RefreshableListPreference.java |
@@ -33,42 +33,47 @@ 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 ImageView refreshImage = new ImageView(this.getContext()); |
+ 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 = this.getContext().getResources().getDisplayMetrics().density; |
if (widgetFrameView instanceof LinearLayout) |
{ |
- ((LinearLayout) widgetFrameView).setOrientation(LinearLayout.HORIZONTAL); |
+ ((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); |
+ if (RefreshableListPreference.this.refreshClickListener != null) |
+ { |
+ RefreshableListPreference.this.refreshClickListener.onClick(refreshImage); |
+ } |
} |
}); |
} |
- public void setOnRefreshClickListener(OnClickListener l) |
+ public void setOnRefreshClickListener(final OnClickListener l) |
{ |
- refreshClickListener = l; |
+ this.refreshClickListener = l; |
} |
} |