From ae7e80a2f038cd60946dae3619398c006a4d8ab3 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 2 Aug 2013 00:25:35 -0500 Subject: [PATCH] Convert fields to local variables --- .../localytics/android/LocalyticsSession.java | 9 +--- .../astrid/calls/MissedCallActivity.java | 3 +- .../astrid/core/CustomFilterActivity.java | 5 +- .../todoroo/astrid/files/FilesControlSet.java | 3 +- .../astrid/opencrx/OpencrxControlSet.java | 17 +++---- .../reminders/NotificationFragment.java | 4 +- .../astrid/timers/TimerActionControlSet.java | 46 +++++++++---------- .../astrid/activity/BeastModePreferences.java | 3 +- .../astrid/activity/FilterListFragment.java | 4 +- .../astrid/activity/TaskEditFragment.java | 10 ++-- .../todoroo/astrid/adapter/TaskAdapter.java | 3 +- .../astrid/billing/BillingActivity.java | 3 +- .../com/todoroo/astrid/ui/CalendarDialog.java | 4 +- .../com/todoroo/astrid/ui/CalendarView.java | 9 ++-- .../todoroo/astrid/ui/DateAndTimeDialog.java | 6 +-- .../todoroo/astrid/ui/DateAndTimePicker.java | 4 +- .../com/todoroo/astrid/ui/NumberPicker.java | 6 +-- .../astrid/ui/RandomReminderControlSet.java | 8 ++-- .../welcome/tutorial/WelcomeWalkthrough.java | 3 +- 19 files changed, 57 insertions(+), 93 deletions(-) diff --git a/astrid/common-src/com/localytics/android/LocalyticsSession.java b/astrid/common-src/com/localytics/android/LocalyticsSession.java index b85c7a940..1ac3d476d 100755 --- a/astrid/common-src/com/localytics/android/LocalyticsSession.java +++ b/astrid/common-src/com/localytics/android/LocalyticsSession.java @@ -224,11 +224,6 @@ public final class LocalyticsSession { */ private final Context mContext; - /** - * Localytics application key - */ - private final String mLocalyticsKey; - /** * Keeps track of which Localytics clients are currently uploading, in order to allow only one upload for a given key at a * time. @@ -268,9 +263,9 @@ public final class LocalyticsSession { * and earlier. See for details. */ mContext = !(context.getClass().getName().equals("android.test.RenamingDelegatingContext")) && Constants.CURRENT_API_LEVEL >= 8 ? context.getApplicationContext() : context; //$NON-NLS-1$ - mLocalyticsKey = key; + String localyticsKey = key; - mSessionHandler = new SessionHandler(mContext, mLocalyticsKey, sSessionHandlerThread.getLooper()); + mSessionHandler = new SessionHandler(mContext, localyticsKey, sSessionHandlerThread.getLooper()); /* * Complete Handler initialization on a background thread. Note that this is not generally a good best practice, as the diff --git a/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java b/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java index d082eb264..8a7ba4873 100644 --- a/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/calls/MissedCallActivity.java @@ -98,7 +98,6 @@ public class MissedCallActivity extends Activity { private String name; private String number; - private String timeString; private TextView returnCallButton; private TextView callLaterButton; @@ -118,7 +117,7 @@ public class MissedCallActivity extends Activity { name = intent.getStringExtra(EXTRA_NAME); number = intent.getStringExtra(EXTRA_NUMBER); - timeString = intent.getStringExtra(EXTRA_TIME); + String timeString = intent.getStringExtra(EXTRA_TIME); long contactId = intent.getExtras().getLong(EXTRA_CONTACT_ID); int color = ThemeService.getThemeColor(); diff --git a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java index 358428335..cdb0c1771 100644 --- a/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/core/CustomFilterActivity.java @@ -146,7 +146,6 @@ public class CustomFilterActivity extends SherlockFragmentActivity { private ListView listView; private TextView filterName; - private boolean isDialog; private CustomFilterAdapter adapter; private final Map criteria = Collections.synchronizedMap(new LinkedHashMap()); @@ -189,8 +188,8 @@ public class CustomFilterActivity extends SherlockFragmentActivity { } private void setupForDialogOrFullscreen() { - isDialog = AstridPreferences.useTabletLayout(this); - if (isDialog) { + boolean dialog = AstridPreferences.useTabletLayout(this); + if (dialog) { setTheme(ThemeService.getDialogTheme()); } else { ThemeService.applyTheme(this); diff --git a/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java b/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java index ee446fa4c..24e0ab751 100644 --- a/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java @@ -59,7 +59,6 @@ public class FilesControlSet extends PopupControlSet { private final ArrayList files = new ArrayList(); private final LinearLayout fileDisplayList; - private LinearLayout fileList; private final LayoutInflater inflater; private final ImageView image; @@ -151,7 +150,7 @@ public class FilesControlSet extends PopupControlSet { @Override protected void afterInflate() { - fileList = (LinearLayout) getView().findViewById(R.id.files_list); + LinearLayout fileList = (LinearLayout) getView().findViewById(R.id.files_list); final LinearLayout finalList = fileList; fileList.removeAllViews(); LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); diff --git a/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java b/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java index 91a270662..23865d663 100644 --- a/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/opencrx/OpencrxControlSet.java @@ -214,9 +214,6 @@ public class OpencrxControlSet extends PopupControlSet { private AutoCompleteTextView assignedToTextInput; private AutoCompleteTextView creatorTextInput; - private ArrayList users = null; - private ArrayList dashboards = null; - @Autowired private MetadataService metadataService; @@ -259,7 +256,7 @@ public class OpencrxControlSet extends PopupControlSet { } StoreObject[] dashboardsData = readStoreObjects(OpencrxActivityCreator.TYPE); - dashboards = new ArrayList(dashboardsData.length); + ArrayList dashboards = new ArrayList(dashboardsData.length); int dashboardSpinnerIndex = -1; for (int i = 0; i < dashboardsData.length; i++) { @@ -314,20 +311,20 @@ public class OpencrxControlSet extends PopupControlSet { } StoreObject[] usersData = readStoreObjects(OpencrxContact.TYPE); - this.users = new ArrayList(); + ArrayList users = new ArrayList(); for (StoreObject user : usersData) { - this.users.add(new OpencrxContact(user)); + users.add(new OpencrxContact(user)); } ArrayAdapter usersAdapter = new ArrayAdapter(activity, - android.R.layout.simple_spinner_item, this.users); + android.R.layout.simple_spinner_item, users); usersAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); assignedToSelector.setAdapter(usersAdapter); int responsibleSpinnerIndex = 0; - for (int i = 0; i < this.users.size(); i++) { - if (this.users.get(i).getId() == responsibleId) { + for (int i = 0; i < users.size(); i++) { + if (users.get(i).getId() == responsibleId) { responsibleSpinnerIndex = i; break; } @@ -335,7 +332,7 @@ public class OpencrxControlSet extends PopupControlSet { assignedToSelector.setSelection(responsibleSpinnerIndex); ArrayAdapter contactAdapterTextInput = new ArrayAdapter(activity, - android.R.layout.simple_spinner_item, this.users); + android.R.layout.simple_spinner_item, users); assignedToTextInput.setAdapter(contactAdapterTextInput); assignedToTextInput.setOnItemClickListener(new OnItemClickListener() { diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java b/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java index aeccb16bd..e65774177 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationFragment.java @@ -50,8 +50,6 @@ public class NotificationFragment extends TaskListFragment { // --- implementation - private long taskId; - /* (non-Javadoc) * @see com.todoroo.astrid.activity.TaskListActivity#onActivityCreated(android.os.Bundle) */ @@ -80,7 +78,7 @@ public class NotificationFragment extends TaskListFragment { getView().findViewById(R.id.taskListFooter).setVisibility(View.GONE); String title = extras.getString(Notifications.EXTRAS_TEXT); - taskId = extras.getLong(TOKEN_ID); + long taskId = extras.getLong(TOKEN_ID); new ReminderDialog((AstridActivity) getActivity(), taskId, title).show(); } diff --git a/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java b/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java index 057315e5f..29452868e 100644 --- a/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/timers/TimerActionControlSet.java @@ -27,14 +27,34 @@ public class TimerActionControlSet extends TaskEditControlSet { private final ImageView timerButton; private final Chronometer chronometer; - private final LinearLayout timerContainer; private boolean timerActive; private final List listeners = new LinkedList(); public TimerActionControlSet(Activity activity, View parent) { super(activity, -1); - timerContainer = (LinearLayout) parent.findViewById(R.id.timer_container); + LinearLayout timerContainer = (LinearLayout) parent.findViewById(R.id.timer_container); timerButton = (ImageView) parent.findViewById(R.id.timer_button); + OnClickListener timerListener = new OnClickListener() { + @Override + public void onClick(View v) { + if (timerActive) { + TimerPlugin.updateTimer(activity, model, false); + + for (TimerActionListener listener : listeners) { + listener.timerStopped(model); + } + chronometer.stop(); + } else { + TimerPlugin.updateTimer(activity, model, true); + for (TimerActionListener listener : listeners) { + listener.timerStarted(model); + } + chronometer.start(); + } + timerActive = !timerActive; + updateDisplay(); + } + }; timerContainer.setOnClickListener(timerListener); chronometer = (Chronometer) parent.findViewById(R.id.timer); } @@ -61,28 +81,6 @@ public class TimerActionControlSet extends TaskEditControlSet { return null; } - private final OnClickListener timerListener = new OnClickListener() { - @Override - public void onClick(View v) { - if (timerActive) { - TimerPlugin.updateTimer(activity, model, false); - - for (TimerActionListener listener : listeners) { - listener.timerStopped(model); - } - chronometer.stop(); - } else { - TimerPlugin.updateTimer(activity, model, true); - for (TimerActionListener listener : listeners) { - listener.timerStarted(model); - } - chronometer.start(); - } - timerActive = !timerActive; - updateDisplay(); - } - }; - private void updateDisplay() { final int drawable; if (timerActive) { diff --git a/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java b/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java index 45358fa5a..20bb5a451 100644 --- a/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java +++ b/astrid/src/com/todoroo/astrid/activity/BeastModePreferences.java @@ -28,7 +28,6 @@ import java.util.HashMap; public class BeastModePreferences extends ListActivity { - private TouchListView touchList; private ArrayAdapter adapter; private ArrayList items; @@ -145,7 +144,7 @@ public class BeastModePreferences extends ListActivity { prefsToDescriptions = new HashMap(); buildDescriptionMap(getResources()); - touchList = (TouchListView) getListView(); + TouchListView touchList = (TouchListView) getListView(); items = constructOrderedControlList(this); adapter = new ArrayAdapter(this, R.layout.preference_draggable_row, R.id.text, items) { diff --git a/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java b/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java index 91d988cbc..cd656b747 100644 --- a/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/FilterListFragment.java @@ -94,8 +94,6 @@ public class FilterListFragment extends SherlockListFragment { private OnFilterItemClickedListener mListener; - private View newListButton; - /* ====================================================================== * ======================================================= initialization * ====================================================================== */ @@ -159,7 +157,7 @@ public class FilterListFragment extends SherlockListFragment { getActivity().setDefaultKeyMode(Activity.DEFAULT_KEYS_SEARCH_LOCAL); //ImageView backButton = (ImageView) getView().findViewById(R.id.back); - newListButton = getView().findViewById(R.id.new_list_button); + View newListButton = getView().findViewById(R.id.new_list_button); if (newListButton != null) { newListButton.setOnClickListener(new OnClickListener() { diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java index ec538cbbd..ebb95c121 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java @@ -225,12 +225,8 @@ public final class TaskEditFragment extends SherlockFragment implements // --- UI components - private ImageButton voiceAddNoteButton; - private EditPeopleControlSet peopleControlSet = null; private EditNotesControlSet notesControlSet = null; - private HideUntilControlSet hideUntilControls = null; - private TagsControlSet tagsControlSet = null; private FilesControlSet filesControlSet = null; private TimerActionControlSet timerAction; private EditText title; @@ -486,7 +482,7 @@ public final class TaskEditFragment extends SherlockFragment implements getActivity(), getView()); controls.add(timerAction); - tagsControlSet = new TagsControlSet(getActivity(), + TagsControlSet tagsControlSet = new TagsControlSet(getActivity(), R.layout.control_set_tags, R.layout.control_set_default_display, R.string.TEA_tags_label_long); controls.add(tagsControlSet); @@ -551,7 +547,7 @@ public final class TaskEditFragment extends SherlockFragment implements controlSetMap.put(getString(R.string.TEA_ctrl_reminders_pref), reminderControl); - hideUntilControls = new HideUntilControlSet(getActivity(), + HideUntilControlSet hideUntilControls = new HideUntilControlSet(getActivity(), R.layout.control_set_hide, R.layout.control_set_default_display, R.string.hide_until_prompt); @@ -717,7 +713,7 @@ public final class TaskEditFragment extends SherlockFragment implements // prepare and set listener for voice-button if (getActivity() != null) { if (VoiceRecognizer.voiceInputAvailable(getActivity())) { - voiceAddNoteButton = (ImageButton) notesControlSet.getView().findViewById( + ImageButton voiceAddNoteButton = (ImageButton) notesControlSet.getView().findViewById( R.id.voiceAddNoteButton); voiceAddNoteButton.setVisibility(View.VISIBLE); int prompt = R.string.voice_edit_note_prompt; diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 8bdf4ff5c..80ae06ce7 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -217,7 +217,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable { protected OnCompletedTaskListener onCompletedTaskListener = null; protected final int resource; protected final LayoutInflater inflater; - private DetailLoaderThread detailLoader; private int fontSize; protected int applyListeners = APPLY_LISTENERS_PARENT; private long mostRecentlyMade = -1; @@ -319,7 +318,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable { private void startDetailThread() { if (Preferences.getBoolean(R.string.p_showNotes, false) && !simpleLayout && !titleOnlyLayout) { - detailLoader = new DetailLoaderThread(); + DetailLoaderThread detailLoader = new DetailLoaderThread(); detailLoader.start(); } } diff --git a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java index 64b8d63b8..9b7250105 100644 --- a/astrid/src/com/todoroo/astrid/billing/BillingActivity.java +++ b/astrid/src/com/todoroo/astrid/billing/BillingActivity.java @@ -41,7 +41,6 @@ public class BillingActivity extends SherlockFragmentActivity implements AstridP private static final int DIALOG_BILLING_NOT_SUPPORTED_ID = 2; private static final int DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID = 3; - private Handler handler; private BillingService billingService; private AstridPurchaseObserver purchaseObserver; private Button buyMonth; @@ -67,7 +66,7 @@ public class BillingActivity extends SherlockFragmentActivity implements AstridP setupText(); - handler = new Handler(); + Handler handler = new Handler(); billingService = new BillingService(); billingService.setContext(this); purchaseObserver = new AstridPurchaseObserver(this, handler) { diff --git a/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java b/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java index 8f123a59e..b38164c5f 100644 --- a/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/CalendarDialog.java @@ -23,8 +23,6 @@ public class CalendarDialog extends Dialog implements OnClickListener, OnSelecte private final Button cancelButton; private Date calendarDate; - private final CalendarView calendarView; - public CalendarDialog(Context context, Date calendarDate) { super(context); this.calendarDate = calendarDate; @@ -40,7 +38,7 @@ public class CalendarDialog extends Dialog implements OnClickListener, OnSelecte cancelButton = (Button) findViewById(R.id.CancelButton); - calendarView = (CalendarView) findViewById(R.id.CalendarView); + CalendarView calendarView = (CalendarView) findViewById(R.id.CalendarView); calendarView.setCalendarDate(calendarDate); calendarView.setOnSelectedDateListener(this); diff --git a/astrid/src/com/todoroo/astrid/ui/CalendarView.java b/astrid/src/com/todoroo/astrid/ui/CalendarView.java index 19545d4ea..49cdc5bae 100644 --- a/astrid/src/com/todoroo/astrid/ui/CalendarView.java +++ b/astrid/src/com/todoroo/astrid/ui/CalendarView.java @@ -43,16 +43,13 @@ public class CalendarView extends View { private float deltaX; private boolean ignoreNextTouch; - private Paint borderPaint; private Paint calendarNumberRightAlignPaint; private Paint calendarSelectedNumberRightAlignPaint; private Paint backgroundColorPaint; private Paint monthCenterAlignLargePaint; - private Paint centerAlignPaint; private Paint rightAlignPaint; private Paint todayCalendarPaint; private Paint selectedCalendarPaint; - private Paint dayPaint; private float density; private int leftArrowHeight; @@ -110,7 +107,7 @@ public class CalendarView extends View { Resources r = context.getResources(); - borderPaint = new Paint(); + Paint borderPaint = new Paint(); borderPaint.setAntiAlias(true); borderPaint.setColor(r.getColor(R.color.task_edit_deadline_gray)); borderPaint.setStyle(Style.STROKE); @@ -127,7 +124,7 @@ public class CalendarView extends View { calendarSelectedNumberRightAlignPaint.setTextSize(TEXT_SIZE * density); calendarSelectedNumberRightAlignPaint.setTextAlign(Paint.Align.RIGHT); - dayPaint = new Paint(); + Paint dayPaint = new Paint(); dayPaint.setAntiAlias(true); dayPaint.setColor(Color.rgb(137, 135, 132)); @@ -137,7 +134,7 @@ public class CalendarView extends View { monthCenterAlignLargePaint.setTextAlign(Paint.Align.CENTER); monthCenterAlignLargePaint.setTextSize(MONTH_TEXT_SIZE * density); - centerAlignPaint = new Paint(); + Paint centerAlignPaint = new Paint(); centerAlignPaint.setAntiAlias(true); centerAlignPaint.setColor(r.getColor(R.color.task_edit_deadline_gray)); centerAlignPaint.setTextAlign(Paint.Align.CENTER); diff --git a/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java b/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java index ace3e3246..2c8f883e8 100644 --- a/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java +++ b/astrid/src/com/todoroo/astrid/ui/DateAndTimeDialog.java @@ -25,8 +25,6 @@ public class DateAndTimeDialog extends Dialog { } private final DateAndTimePicker dateAndTimePicker; - private final Button okButton; - private final Button cancelButton; private boolean cancelled = false; private DateAndTimeDialogListener listener; @@ -54,8 +52,8 @@ public class DateAndTimeDialog extends Dialog { dateAndTimePicker = (DateAndTimePicker) findViewById(R.id.date_and_time); dateAndTimePicker.initializeWithDate(startDate); - okButton = (Button) findViewById(R.id.ok); - cancelButton = (Button) findViewById(R.id.cancel); + Button okButton = (Button) findViewById(R.id.ok); + Button cancelButton = (Button) findViewById(R.id.cancel); okButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java b/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java index fb9ddd4e3..43e28f1a5 100644 --- a/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java +++ b/astrid/src/com/todoroo/astrid/ui/DateAndTimePicker.java @@ -35,8 +35,6 @@ public class DateAndTimePicker extends LinearLayout { private static final int SHORTCUT_PADDING = 8; - private ArrayList urgencyValues; - private class UrgencyValue { public String label; public int setting; @@ -158,7 +156,7 @@ public class DateAndTimePicker extends LinearLayout { } String[] labels = context.getResources().getStringArray(arrayResource); - urgencyValues = new ArrayList(); + ArrayList urgencyValues = new ArrayList(); todayUrgency = new UrgencyValue(labels[2], Task.URGENCY_TODAY); if (useShortcuts) { diff --git a/astrid/src/com/todoroo/astrid/ui/NumberPicker.java b/astrid/src/com/todoroo/astrid/ui/NumberPicker.java index d4a499201..43a4c4edc 100644 --- a/astrid/src/com/todoroo/astrid/ui/NumberPicker.java +++ b/astrid/src/com/todoroo/astrid/ui/NumberPicker.java @@ -81,9 +81,7 @@ public class NumberPicker extends LinearLayout implements OnClickListener, } }; - private final LayoutInflater mInflater; private final EditText mText; - private final InputFilter mInputFilter; private final InputFilter mNumberInputFilter; private final Animation mSlideUpOutAnimation; @@ -126,10 +124,10 @@ public class NumberPicker extends LinearLayout implements OnClickListener, public NumberPicker(Context context, AttributeSet attrs, int defStyle) { super(context, attrs); setOrientation(VERTICAL); - mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mInflater.inflate(getLayout(), this, true); mHandler = new Handler(); - mInputFilter = new NumberPickerInputFilter(); + InputFilter mInputFilter = new NumberPickerInputFilter(); mNumberInputFilter = new NumberRangeKeyListener(); mIncrementButton = (NumberPickerButton) findViewById(R.id.increment); mIncrementButton.setOnClickListener(this); diff --git a/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java b/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java index 25f68675e..2fd509159 100644 --- a/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java +++ b/astrid/src/com/todoroo/astrid/ui/RandomReminderControlSet.java @@ -26,10 +26,6 @@ import com.todoroo.astrid.service.StatisticsService; * @author Tim Su */ public class RandomReminderControlSet extends TaskEditControlSet { - /** - * default interval for spinner if date is unselected - */ - private final long DEFAULT_INTERVAL = DateUtilities.ONE_WEEK * 2; private final CheckBox settingCheckbox; private final Spinner periodSpinner; @@ -83,6 +79,10 @@ public class RandomReminderControlSet extends TaskEditControlSet { boolean enabled = time > 0; if (time <= 0) { + /* + default interval for spinner if date is unselected + */ + long DEFAULT_INTERVAL = DateUtilities.ONE_WEEK * 2; time = DEFAULT_INTERVAL; } diff --git a/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java b/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java index c90900642..4103c5ee7 100644 --- a/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java +++ b/astrid/src/com/todoroo/astrid/welcome/tutorial/WelcomeWalkthrough.java @@ -41,7 +41,6 @@ public class WelcomeWalkthrough extends ActFmLoginActivity { private Account[] accounts; private CirclePageIndicator mIndicator; private View currentView; - private int currentPage; private String authToken; private boolean onSuccess = false; @@ -210,7 +209,7 @@ public class WelcomeWalkthrough extends ActFmLoginActivity { } public void onPageChanged(View view, int position) { - currentPage = position; + int currentPage = position; currentView = view; findViewById(R.id.next).setVisibility( position == mAdapter.getCount() - 1 ? View.GONE : View.VISIBLE);