Merge branch 'master' into fix/weekly-view-missing-days

This commit is contained in:
Tibor Kaputa 2021-08-17 09:25:06 +02:00 committed by GitHub
commit 1b3e8911b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 1 deletions

View File

@ -57,6 +57,7 @@ class SettingsActivity : SimpleActivity() {
setupShowGrid()
setupWeeklyStart()
setupMidnightSpanEvents()
setupAllowCustomiseDayCount()
setupVibrate()
setupReminderSound()
setupReminderAudioStream()
@ -349,6 +350,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupAllowCustomiseDayCount() {
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
}
}
private fun setupWeekNumbers() {
settings_week_numbers.isChecked = config.showWeekNumbers
settings_week_numbers_holder.setOnClickListener {

View File

@ -59,6 +59,14 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
return weekHolder
}
override fun onResume() {
super.onResume()
context?.config?.allowCustomizeDayCount?.let { allow ->
weekHolder!!.week_view_days_count.beVisibleIf(allow)
weekHolder!!.week_view_seekbar.beVisibleIf(allow)
}
}
private fun setupFragment() {
addHours()
setupWeeklyViewPager()

View File

@ -27,6 +27,10 @@ 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 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)
set(vibrate) = prefs.edit().putBoolean(VIBRATE, vibrate).apply()

View File

@ -46,6 +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_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"

View File

@ -722,6 +722,28 @@
</RelativeLayout>
<RelativeLayout
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"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_allow_customize_day_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/medium_margin"
android:text="@string/allow_customizing_day_count" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/monthly_view_label"
android:layout_width="wrap_content"

View File

@ -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

View File

@ -177,7 +177,7 @@
<string name="replace_description_with_location">Remplacer la description de l\événement par l\emplacement</string>
<string name="delete_all_events">Supprimer tous les événements</string>
<string name="delete_all_events_confirmation">Êtes-vous certain de vouloir supprimer tous les événements? Les types d\événements et vos autres paramètres ne seront pas modifiés.</string>
<string name="show_a_grid">Afficher une grille</string>
<string name="show_a_grid">Affichage en grille</string>
<string name="loop_reminders">Répéter les rappels jusqu\’à ce qu\ils soient rejetés</string>
<string name="dim_past_events">Estomper les événements passés</string>
<string name="events">Événements</string>