diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2015-03-17 08:37:59 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-03-17 08:41:06 +0100 |
commit | b2ffc2581c6630e313c4e623d0a40c8846e1e975 (patch) | |
tree | 6859e456fdb42e6468558883761c1de40b458c80 /main/src/cgeo/geocaching/ui | |
parent | 9119639276a00ef17d3ffa1a5fad0c37c1bebd78 (diff) | |
download | cgeo-b2ffc2581c6630e313c4e623d0a40c8846e1e975.zip cgeo-b2ffc2581c6630e313c4e623d0a40c8846e1e975.tar.gz cgeo-b2ffc2581c6630e313c4e623d0a40c8846e1e975.tar.bz2 |
Add missing final qualifiers in main module
Diffstat (limited to 'main/src/cgeo/geocaching/ui')
15 files changed, 45 insertions, 45 deletions
diff --git a/main/src/cgeo/geocaching/ui/AbstractCachingListViewPageViewCreator.java b/main/src/cgeo/geocaching/ui/AbstractCachingListViewPageViewCreator.java index 06fa1fa..40d077e 100644 --- a/main/src/cgeo/geocaching/ui/AbstractCachingListViewPageViewCreator.java +++ b/main/src/cgeo/geocaching/ui/AbstractCachingListViewPageViewCreator.java @@ -30,10 +30,10 @@ public abstract class AbstractCachingListViewPageViewCreator extends AbstractCac if (view == null) { return null; } - int position = view.getFirstVisiblePosition(); - View child = view.getChildAt(0); - int positionFromTop = (child == null) ? 0 : child.getTop(); - Bundle state = new Bundle(); + final int position = view.getFirstVisiblePosition(); + final View child = view.getChildAt(0); + final int positionFromTop = (child == null) ? 0 : child.getTop(); + final Bundle state = new Bundle(); state.putInt(STATE_POSITION, position); state.putInt(STATE_POSITION_FROM_TOP, positionFromTop); return state; @@ -44,12 +44,12 @@ public abstract class AbstractCachingListViewPageViewCreator extends AbstractCac * */ @Override - public void setViewState(@NonNull Bundle state) { + public void setViewState(@NonNull final Bundle state) { if (view == null) { return; } - int logViewPosition = state.getInt(STATE_POSITION); - int logViewPositionFromTop = state.getInt(STATE_POSITION_FROM_TOP); + final int logViewPosition = state.getInt(STATE_POSITION); + final int logViewPositionFromTop = state.getInt(STATE_POSITION_FROM_TOP); view.setSelectionFromTop(logViewPosition, logViewPositionFromTop); } diff --git a/main/src/cgeo/geocaching/ui/AbstractImageAdapter.java b/main/src/cgeo/geocaching/ui/AbstractImageAdapter.java index 075bfe6..22ec603 100644 --- a/main/src/cgeo/geocaching/ui/AbstractImageAdapter.java +++ b/main/src/cgeo/geocaching/ui/AbstractImageAdapter.java @@ -48,7 +48,7 @@ public abstract class AbstractImageAdapter extends BaseAdapter { // create a new ImageView for each item referenced by the Adapter @Override public View getView(final int position, final View convertView, final ViewGroup parent) { - ImageView imageView; + final ImageView imageView; if (convertView == null) { // if it's not recycled, initialize some attributes imageView = (ImageView) LayoutInflater.from(context).inflate(R.layout.grid_image, null); } else { diff --git a/main/src/cgeo/geocaching/ui/AbstractUserClickListener.java b/main/src/cgeo/geocaching/ui/AbstractUserClickListener.java index f26cb53..1efa15e 100644 --- a/main/src/cgeo/geocaching/ui/AbstractUserClickListener.java +++ b/main/src/cgeo/geocaching/ui/AbstractUserClickListener.java @@ -24,7 +24,7 @@ abstract class AbstractUserClickListener implements View.OnClickListener { } @Override - public void onClick(View view) { + public void onClick(final View view) { if (view == null) { return; } @@ -45,8 +45,8 @@ abstract class AbstractUserClickListener implements View.OnClickListener { final AbstractActivity activity = (AbstractActivity) view.getContext(); final Resources res = activity.getResources(); - ArrayList<String> labels = new ArrayList<>(userActions.size()); - for (UserAction action : userActions) { + final ArrayList<String> labels = new ArrayList<>(userActions.size()); + for (final UserAction action : userActions) { labels.add(res.getString(action.displayResourceId)); } final CharSequence[] items = labels.toArray(new String[labels.size()]); @@ -55,7 +55,7 @@ abstract class AbstractUserClickListener implements View.OnClickListener { builder.setTitle(res.getString(R.string.user_menu_title) + " " + userName); builder.setItems(items, new DialogInterface.OnClickListener() { @Override - public void onClick(DialogInterface dialog, int item) { + public void onClick(final DialogInterface dialog, final int item) { userActions.get(item).run(new Context(userName, activity)); } }); diff --git a/main/src/cgeo/geocaching/ui/AbstractViewHolder.java b/main/src/cgeo/geocaching/ui/AbstractViewHolder.java index b1cb719..0233bf0 100644 --- a/main/src/cgeo/geocaching/ui/AbstractViewHolder.java +++ b/main/src/cgeo/geocaching/ui/AbstractViewHolder.java @@ -11,7 +11,7 @@ import android.view.View; */ public abstract class AbstractViewHolder { - protected AbstractViewHolder(View view) { + protected AbstractViewHolder(final View view) { ButterKnife.inject(this, view); view.setTag(this); } diff --git a/main/src/cgeo/geocaching/ui/AnchorAwareLinkMovementMethod.java b/main/src/cgeo/geocaching/ui/AnchorAwareLinkMovementMethod.java index 870eef1..57c9db0 100644 --- a/main/src/cgeo/geocaching/ui/AnchorAwareLinkMovementMethod.java +++ b/main/src/cgeo/geocaching/ui/AnchorAwareLinkMovementMethod.java @@ -26,10 +26,10 @@ public class AnchorAwareLinkMovementMethod extends LinkMovementMethod { } @Override - public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) { + public boolean onTouchEvent(final TextView widget, final Spannable buffer, final MotionEvent event) { try { return super.onTouchEvent(widget, buffer, event); - } catch (Exception ignored) { + } catch (final Exception ignored) { // local links to anchors don't work } return false; diff --git a/main/src/cgeo/geocaching/ui/CoordinatesFormatSwitcher.java b/main/src/cgeo/geocaching/ui/CoordinatesFormatSwitcher.java index 581942a..db299a2 100644 --- a/main/src/cgeo/geocaching/ui/CoordinatesFormatSwitcher.java +++ b/main/src/cgeo/geocaching/ui/CoordinatesFormatSwitcher.java @@ -13,7 +13,7 @@ import android.widget.TextView; */ public class CoordinatesFormatSwitcher implements OnClickListener { - private static GeopointFormatter.Format[] availableFormats = new GeopointFormatter.Format[] { + private static final GeopointFormatter.Format[] availableFormats = new GeopointFormatter.Format[] { GeopointFormatter.Format.LAT_LON_DECMINUTE, GeopointFormatter.Format.LAT_LON_DECSECOND, GeopointFormatter.Format.LAT_LON_DECDEGREE @@ -28,10 +28,10 @@ public class CoordinatesFormatSwitcher implements OnClickListener { } @Override - public void onClick(View view) { + public void onClick(final View view) { assert view instanceof TextView; position = (position + 1) % availableFormats.length; - TextView textView = (TextView) view; + final TextView textView = (TextView) view; // rotate coordinate formats on click textView.setText(coordinates.format(availableFormats[position])); } diff --git a/main/src/cgeo/geocaching/ui/DecryptTextClickListener.java b/main/src/cgeo/geocaching/ui/DecryptTextClickListener.java index 421d7aa..30b0e5a 100644 --- a/main/src/cgeo/geocaching/ui/DecryptTextClickListener.java +++ b/main/src/cgeo/geocaching/ui/DecryptTextClickListener.java @@ -24,7 +24,7 @@ public class DecryptTextClickListener implements View.OnClickListener { return; } - CharSequence text = targetView.getText(); + final CharSequence text = targetView.getText(); if (text instanceof Spannable) { targetView.setText(CryptUtils.rot13((Spannable) text)); } else { diff --git a/main/src/cgeo/geocaching/ui/DistanceView.java b/main/src/cgeo/geocaching/ui/DistanceView.java index b5e47e1..fb40ab4 100644 --- a/main/src/cgeo/geocaching/ui/DistanceView.java +++ b/main/src/cgeo/geocaching/ui/DistanceView.java @@ -12,15 +12,15 @@ import android.widget.TextView; public class DistanceView extends TextView { private Geopoint cacheCoords = null; - public DistanceView(Context context) { + public DistanceView(final Context context) { super(context); } - public DistanceView(Context context, AttributeSet attrs) { + public DistanceView(final Context context, final AttributeSet attrs) { super(context, attrs); } - public DistanceView(Context context, AttributeSet attrs, int defStyle) { + public DistanceView(final Context context, final AttributeSet attrs, final int defStyle) { super(context, attrs, defStyle); } @@ -35,7 +35,7 @@ public class DistanceView extends TextView { setText(Units.getDistanceFromKilometers(coords.distanceTo(cacheCoords))); } - public void setDistance(Float distance) { + public void setDistance(final Float distance) { setText("~" + Units.getDistanceFromKilometers(distance)); } }
\ No newline at end of file diff --git a/main/src/cgeo/geocaching/ui/FileSelectionListAdapter.java b/main/src/cgeo/geocaching/ui/FileSelectionListAdapter.java index e07bbc3..6f7f587 100644 --- a/main/src/cgeo/geocaching/ui/FileSelectionListAdapter.java +++ b/main/src/cgeo/geocaching/ui/FileSelectionListAdapter.java @@ -40,7 +40,7 @@ public class FileSelectionListAdapter extends ArrayAdapter<File> { View v = rowView; - ViewHolder holder; + final ViewHolder holder; if (v == null) { v = inflater.inflate(R.layout.mapfile_item, parent, false); holder = new ViewHolder(v); diff --git a/main/src/cgeo/geocaching/ui/IndexOutOfBoundsAvoidingTextView.java b/main/src/cgeo/geocaching/ui/IndexOutOfBoundsAvoidingTextView.java index 30778a1..4727bf9 100644 --- a/main/src/cgeo/geocaching/ui/IndexOutOfBoundsAvoidingTextView.java +++ b/main/src/cgeo/geocaching/ui/IndexOutOfBoundsAvoidingTextView.java @@ -12,43 +12,43 @@ import android.widget.TextView; */ public class IndexOutOfBoundsAvoidingTextView extends TextView { - public IndexOutOfBoundsAvoidingTextView(Context context, AttributeSet attrs, int defStyle) { + public IndexOutOfBoundsAvoidingTextView(final Context context, final AttributeSet attrs, final int defStyle) { super(context, attrs, defStyle); } - public IndexOutOfBoundsAvoidingTextView(Context context, AttributeSet attrs) { + public IndexOutOfBoundsAvoidingTextView(final Context context, final AttributeSet attrs) { super(context, attrs); } - public IndexOutOfBoundsAvoidingTextView(Context context) { + public IndexOutOfBoundsAvoidingTextView(final Context context) { super(context); } @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) { try{ super.onMeasure(widthMeasureSpec, heightMeasureSpec); - } catch (IndexOutOfBoundsException ignored) { + } catch (final IndexOutOfBoundsException ignored) { setText(getText().toString()); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } @Override - public void setGravity(int gravity){ + public void setGravity(final int gravity){ try{ super.setGravity(gravity); - } catch (IndexOutOfBoundsException ignored) { + } catch (final IndexOutOfBoundsException ignored) { setText(getText().toString()); super.setGravity(gravity); } } @Override - public void setText(CharSequence text, BufferType type) { + public void setText(final CharSequence text, final BufferType type) { try{ super.setText(text, type); - } catch (IndexOutOfBoundsException ignored) { + } catch (final IndexOutOfBoundsException ignored) { setText(text.toString()); } } diff --git a/main/src/cgeo/geocaching/ui/OwnerActionsClickListener.java b/main/src/cgeo/geocaching/ui/OwnerActionsClickListener.java index acd43cb..9aa6bec 100644 --- a/main/src/cgeo/geocaching/ui/OwnerActionsClickListener.java +++ b/main/src/cgeo/geocaching/ui/OwnerActionsClickListener.java @@ -15,13 +15,13 @@ public class OwnerActionsClickListener extends AbstractUserClickListener { private final Geocache cache; - public OwnerActionsClickListener(Geocache cache) { + public OwnerActionsClickListener(final Geocache cache) { super(ConnectorFactory.getConnector(cache).getUserActions()); this.cache = cache; } @Override - protected String getUserName(View view) { + protected String getUserName(final View view) { // Use real owner name vice the one owner chose to display if (StringUtils.isNotBlank(cache.getOwnerUserId())) { return cache.getOwnerUserId(); diff --git a/main/src/cgeo/geocaching/ui/UrlPopup.java b/main/src/cgeo/geocaching/ui/UrlPopup.java index 5a8dba4..18d57d5 100644 --- a/main/src/cgeo/geocaching/ui/UrlPopup.java +++ b/main/src/cgeo/geocaching/ui/UrlPopup.java @@ -17,20 +17,20 @@ public class UrlPopup { } public void show(final String title, final String message, final String url, final String urlButtonTitle) { - AlertDialog.Builder builder = new AlertDialog.Builder(context); + final AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(message) .setIcon(android.R.drawable.ic_dialog_info) .setTitle(title) .setPositiveButton(R.string.err_none, new DialogInterface.OnClickListener() { @Override - public void onClick(DialogInterface dialog, int id) { + public void onClick(final DialogInterface dialog, final int id) { dialog.cancel(); } }) .setNegativeButton(urlButtonTitle, new DialogInterface.OnClickListener() { @Override - public void onClick(DialogInterface dialog, int id) { - Intent i = new Intent(Intent.ACTION_VIEW); + public void onClick(final DialogInterface dialog, final int id) { + final Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); context.startActivity(i); } diff --git a/main/src/cgeo/geocaching/ui/UserActionsClickListener.java b/main/src/cgeo/geocaching/ui/UserActionsClickListener.java index 19946bc..68c5493 100644 --- a/main/src/cgeo/geocaching/ui/UserActionsClickListener.java +++ b/main/src/cgeo/geocaching/ui/UserActionsClickListener.java @@ -12,16 +12,16 @@ import android.widget.TextView; */ public class UserActionsClickListener extends AbstractUserClickListener { - public UserActionsClickListener(Geocache cache) { + public UserActionsClickListener(final Geocache cache) { super(ConnectorFactory.getConnector(cache).getUserActions()); } - public UserActionsClickListener(Trackable trackable) { + public UserActionsClickListener(final Trackable trackable) { super(ConnectorFactory.getConnector(trackable).getUserActions()); } @Override - protected String getUserName(View view) { + protected String getUserName(final View view) { return ((TextView) view).getText().toString(); } } diff --git a/main/src/cgeo/geocaching/ui/dialog/LiveMapInfoDialogBuilder.java b/main/src/cgeo/geocaching/ui/dialog/LiveMapInfoDialogBuilder.java index 9858c28..d4720bf 100644 --- a/main/src/cgeo/geocaching/ui/dialog/LiveMapInfoDialogBuilder.java +++ b/main/src/cgeo/geocaching/ui/dialog/LiveMapInfoDialogBuilder.java @@ -15,7 +15,7 @@ import android.view.View; public class LiveMapInfoDialogBuilder { - public static AlertDialog create(Activity activity) { + public static AlertDialog create(final Activity activity) { final AlertDialog.Builder builder = new AlertDialog.Builder(activity); final Context themedContext; @@ -32,7 +32,7 @@ public class LiveMapInfoDialogBuilder { builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override - public void onClick(DialogInterface dialog, int which) { + public void onClick(final DialogInterface dialog, final int which) { dialog.dismiss(); CgeoApplication.getInstance().setLiveMapHintShownInThisSession(); } diff --git a/main/src/cgeo/geocaching/ui/logs/LogViewHolder.java b/main/src/cgeo/geocaching/ui/logs/LogViewHolder.java index 16f5537..302f86c 100644 --- a/main/src/cgeo/geocaching/ui/logs/LogViewHolder.java +++ b/main/src/cgeo/geocaching/ui/logs/LogViewHolder.java @@ -20,7 +20,7 @@ public class LogViewHolder extends AbstractViewHolder { private int position; - public LogViewHolder(View rowView) { + public LogViewHolder(final View rowView) { super(rowView); } |