diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-07-09 20:00:20 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-07-09 20:00:20 +0200 |
| commit | 39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b (patch) | |
| tree | c16fb9a6910842b6d77f45a241e70bc9076bd239 /main/src/cgeo/geocaching/settings/WpThresholdPreference.java | |
| parent | d958893efe7f492ebe909ba74f6e27ea2cb1532c (diff) | |
| download | cgeo-39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b.zip cgeo-39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b.tar.gz cgeo-39c1a333586fc0cbe61b9f18f5abe33c5f7bba2b.tar.bz2 | |
remove some findbugs issues
* unused code
* convert explicit type casts to generic method invocations
Diffstat (limited to 'main/src/cgeo/geocaching/settings/WpThresholdPreference.java')
| -rw-r--r-- | main/src/cgeo/geocaching/settings/WpThresholdPreference.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/main/src/cgeo/geocaching/settings/WpThresholdPreference.java b/main/src/cgeo/geocaching/settings/WpThresholdPreference.java index 4c43acf..37edafa 100644 --- a/main/src/cgeo/geocaching/settings/WpThresholdPreference.java +++ b/main/src/cgeo/geocaching/settings/WpThresholdPreference.java @@ -1,5 +1,7 @@ package cgeo.geocaching.settings; +import butterknife.ButterKnife; + import cgeo.geocaching.R; import android.content.Context; @@ -15,17 +17,17 @@ public class WpThresholdPreference extends Preference { private TextView valueView; - public WpThresholdPreference(Context context) { + public WpThresholdPreference(final Context context) { super(context); init(); } - public WpThresholdPreference(Context context, AttributeSet attrs) { + public WpThresholdPreference(final Context context, final AttributeSet attrs) { super(context, attrs); init(); } - public WpThresholdPreference(Context context, AttributeSet attrs, int defStyle) { + public WpThresholdPreference(final Context context, final AttributeSet attrs, final int defStyle) { super(context, attrs, defStyle); init(); } @@ -35,33 +37,33 @@ public class WpThresholdPreference extends Preference { } @Override - protected View onCreateView(ViewGroup parent) { - View v = super.onCreateView(parent); + protected View onCreateView(final ViewGroup parent) { + final View v = super.onCreateView(parent); // get views - SeekBar seekBar = (SeekBar) v.findViewById(R.id.wp_threshold_seekbar); - valueView = (TextView) v.findViewById(R.id.wp_threshold_value_view); + final SeekBar seekBar = ButterKnife.findById(v, R.id.wp_threshold_seekbar); + valueView = ButterKnife.findById(v, R.id.wp_threshold_value_view); // init seekbar seekBar.setMax(Settings.SHOW_WP_THRESHOLD_MAX); // set initial value - int threshold = Settings.getWayPointsThreshold(); + final int threshold = Settings.getWayPointsThreshold(); valueView.setText(String.valueOf(threshold)); seekBar.setProgress(threshold); seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override - public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + public void onProgressChanged(final SeekBar seekBar, final int progress, final boolean fromUser) { if (fromUser) { valueView.setText(String.valueOf(progress)); } } @Override - public void onStartTrackingTouch(SeekBar seekBar) { + public void onStartTrackingTouch(final SeekBar seekBar) { } @Override - public void onStopTrackingTouch(SeekBar seekBar) { + public void onStopTrackingTouch(final SeekBar seekBar) { Settings.setShowWaypointsThreshold(seekBar.getProgress()); } }); |
