change name from cutomise to customize, check in onResume
This commit is contained in:
parent
23f0010a10
commit
82e7b499c3
|
@ -351,10 +351,10 @@ class SettingsActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun setupAllowCustomiseDayCount() {
|
||||
settings_allow_customise_day_count.isChecked = config.allowCustomiseDayCount
|
||||
settings_allow_customise_day_count_holder.setOnClickListener {
|
||||
settings_allow_customise_day_count.toggle()
|
||||
config.allowCustomiseDayCount = settings_allow_customise_day_count.isChecked
|
||||
settings_allow_customize_day_count.isChecked = config.allowCustomizeDayCount
|
||||
settings_allow_customize_day_count_holder.setOnClickListener {
|
||||
settings_allow_customize_day_count.toggle()
|
||||
config.allowCustomizeDayCount = settings_allow_customize_day_count.isChecked
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
|||
private var currentWeekTS = 0L
|
||||
private var isGoToTodayVisible = false
|
||||
private var weekScrollY = 0
|
||||
lateinit var mConfig: Config
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
@ -54,7 +53,6 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
weekHolder = inflater.inflate(R.layout.fragment_week_holder, container, false) as ViewGroup
|
||||
weekHolder!!.background = ColorDrawable(context!!.config.backgroundColor)
|
||||
mConfig = requireContext().config
|
||||
val itemHeight = context!!.getWeeklyViewItemHeight().toInt()
|
||||
weekHolder!!.week_view_hours_holder.setPadding(0, 0, 0, itemHeight)
|
||||
|
||||
|
@ -66,9 +64,10 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
week_view_days_count_divider.beVisibleIf(mConfig.allowCustomiseDayCount)
|
||||
week_view_seekbar.beVisibleIf(mConfig.allowCustomiseDayCount)
|
||||
week_view_days_count.beVisibleIf(mConfig.allowCustomiseDayCount)
|
||||
context?.config?.allowCustomizeDayCount?.let { allow->
|
||||
week_view_days_count.beVisibleIf(allow)
|
||||
week_view_seekbar.beVisibleIf(allow)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupFragment() {
|
||||
|
|
|
@ -27,9 +27,9 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
get() = prefs.getBoolean(SHOW_MIDNIGHT_SPANNING_EVENTS_AT_TOP, true)
|
||||
set(midnightSpanning) = prefs.edit().putBoolean(SHOW_MIDNIGHT_SPANNING_EVENTS_AT_TOP, midnightSpanning).apply()
|
||||
|
||||
var allowCustomiseDayCount: Boolean
|
||||
get() = prefs.getBoolean(ALLOW_CUSTOMISE_DAY_COUNT, true)
|
||||
set(allow) = prefs.edit().putBoolean(ALLOW_CUSTOMISE_DAY_COUNT, allow).apply()
|
||||
var allowCustomizeDayCount: Boolean
|
||||
get() = prefs.getBoolean(ALLOW_CUSTOMIZE_DAY_COUNT, true)
|
||||
set(allow) = prefs.edit().putBoolean(ALLOW_CUSTOMIZE_DAY_COUNT, allow).apply()
|
||||
|
||||
var vibrateOnReminder: Boolean
|
||||
get() = prefs.getBoolean(VIBRATE, false)
|
||||
|
|
|
@ -46,7 +46,7 @@ const val YEAR = 31536000
|
|||
const val WEEK_NUMBERS = "week_numbers"
|
||||
const val START_WEEKLY_AT = "start_weekly_at"
|
||||
const val SHOW_MIDNIGHT_SPANNING_EVENTS_AT_TOP = "show_midnight_spanning_events_at_top"
|
||||
const val ALLOW_CUSTOMISE_DAY_COUNT = "allow_customise_day_count"
|
||||
const val ALLOW_CUSTOMIZE_DAY_COUNT = "allow_customise_day_count"
|
||||
const val VIBRATE = "vibrate"
|
||||
const val REMINDER_SOUND_URI = "reminder_sound_uri"
|
||||
const val REMINDER_SOUND_TITLE = "reminder_sound_title"
|
||||
|
|
|
@ -723,7 +723,7 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_allow_customise_day_count_holder"
|
||||
android:id="@+id/settings_allow_customize_day_count_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_margin"
|
||||
|
@ -734,7 +734,7 @@
|
|||
android:paddingBottom="@dimen/activity_margin">
|
||||
|
||||
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||
android:id="@+id/settings_allow_customise_day_count"
|
||||
android:id="@+id/settings_allow_customize_day_count"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
layout="@layout/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_above="@+id/week_view_seekbar" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MySeekBar
|
||||
|
|
Loading…
Reference in New Issue