renaming a function

This commit is contained in:
tibbi 2016-11-01 22:45:52 +01:00
parent 9a1d9d6b3b
commit 2bd5a6dce4
3 changed files with 6 additions and 6 deletions

View file

@ -57,11 +57,11 @@ public class Config {
mPrefs.edit().putInt(Constants.LAST_OTHER_REMINDER_MINS, lastMins).apply(); mPrefs.edit().putInt(Constants.LAST_OTHER_REMINDER_MINS, lastMins).apply();
} }
public int getView() { public int getStoredView() {
return mPrefs.getInt(Constants.VIEW, Constants.MONTHLY_VIEW); return mPrefs.getInt(Constants.VIEW, Constants.MONTHLY_VIEW);
} }
public void setView(int view) { public void setStoredView(int view) {
mPrefs.edit().putInt(Constants.VIEW, view).apply(); mPrefs.edit().putInt(Constants.VIEW, view).apply();
} }
} }

View file

@ -76,7 +76,7 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener, ChangeV
} }
override fun onBackPressed() { override fun onBackPressed() {
if (mIsMonthSelected && mConfig.view == Constants.YEARLY_VIEW) { if (mIsMonthSelected && mConfig.storedView == Constants.YEARLY_VIEW) {
updateView(Constants.YEARLY_VIEW) updateView(Constants.YEARLY_VIEW)
} else { } else {
super.onBackPressed() super.onBackPressed()
@ -98,9 +98,9 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener, ChangeV
} }
private fun updateViewPager() { private fun updateViewPager() {
if (mConfig.view == Constants.YEARLY_VIEW) { if (mConfig.storedView == Constants.YEARLY_VIEW) {
fillYearlyViewPager() fillYearlyViewPager()
} else if (mConfig.view == Constants.EVENTS_LIST_VIEW) { } else if (mConfig.storedView == Constants.EVENTS_LIST_VIEW) {
fillEventsList() fillEventsList()
} else { } else {
val targetDay = DateTime().toString(Formatter.DAYCODE_PATTERN) val targetDay = DateTime().toString(Formatter.DAYCODE_PATTERN)

View file

@ -38,7 +38,7 @@ class ChangeViewDialog(val activity: Activity) : AlertDialog.Builder(activity),
} }
fun getSavedItem(): Int { fun getSavedItem(): Int {
return when (Config.newInstance(activity).view) { return when (Config.newInstance(activity).storedView) {
Constants.YEARLY_VIEW -> R.id.dialog_radio_yearly Constants.YEARLY_VIEW -> R.id.dialog_radio_yearly
Constants.EVENTS_LIST_VIEW -> R.id.dialog_radio_events_list Constants.EVENTS_LIST_VIEW -> R.id.dialog_radio_events_list
else -> R.id.dialog_radio_monthly else -> R.id.dialog_radio_monthly