updating the style of some dialogs

This commit is contained in:
tibbi
2022-08-31 20:05:30 +02:00
parent 47a2b0c040
commit cb6dcafe0c
6 changed files with 61 additions and 49 deletions

View File

@ -66,7 +66,7 @@ class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callba
} }
edit_alarm_label_image.applyColorFilter(textColor) edit_alarm_label_image.applyColorFilter(textColor)
edit_alarm_label.setText(alarm.label) edit_alarm.setText(alarm.label)
val dayLetters = activity.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList<String> val dayLetters = activity.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList<String>
val dayIndexes = arrayListOf(0, 1, 2, 3, 4, 5, 6) val dayIndexes = arrayListOf(0, 1, 2, 3, 4, 5, 6)
@ -126,7 +126,7 @@ class EditAlarmDialog(val activity: SimpleActivity, val alarm: Alarm, val callba
} }
} }
alarm.label = view.edit_alarm_label.value alarm.label = view.edit_alarm.value
alarm.isEnabled = true alarm.isEnabled = true
var alarmId = alarm.id var alarmId = alarm.id

View File

@ -19,7 +19,7 @@ class EditTimeZoneDialog(val activity: SimpleActivity, val myTimeZone: MyTimeZon
init { init {
val view = activity.layoutInflater.inflate(R.layout.dialog_edit_time_zone, null).apply { val view = activity.layoutInflater.inflate(R.layout.dialog_edit_time_zone, null).apply {
edit_time_zone_title.setText(activity.getModifiedTimeZoneTitle(myTimeZone.id)) edit_time_zone_title.setText(activity.getModifiedTimeZoneTitle(myTimeZone.id))
edit_time_zone_value.text = getDefaultTimeZoneTitle(myTimeZone.id) edit_time_zone_label.setText(getDefaultTimeZoneTitle(myTimeZone.id))
} }
activity.getAlertDialogBuilder() activity.getAlertDialogBuilder()

View File

@ -59,8 +59,7 @@ class EditTimerDialog(val activity: SimpleActivity, val timer: Timer, val callba
} }
edit_timer_label_image.applyColorFilter(textColor) edit_timer_label_image.applyColorFilter(textColor)
edit_timer_label.setText(timer.label) edit_timer.setText(timer.label)
} }
activity.getAlertDialogBuilder() activity.getAlertDialogBuilder()
@ -69,7 +68,7 @@ class EditTimerDialog(val activity: SimpleActivity, val timer: Timer, val callba
.apply { .apply {
activity.setupDialogStuff(view, this) { alertDialog -> activity.setupDialogStuff(view, this) { alertDialog ->
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
timer.label = view.edit_timer_label.value timer.label = view.edit_timer.value
activity.timerHelper.insertOrUpdateTimer(timer) { activity.timerHelper.insertOrUpdateTimer(timer) {
activity.config.timerLastConfig = timer activity.config.timerLastConfig = timer
callback() callback()

View File

@ -95,26 +95,31 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/edit_alarm_sound" android:layout_below="@+id/edit_alarm_sound"
android:layout_alignTop="@+id/edit_alarm_label" android:layout_alignTop="@+id/edit_alarm_hint"
android:layout_alignBottom="@+id/edit_alarm_label" android:layout_alignBottom="@+id/edit_alarm_hint"
android:layout_marginStart="@dimen/activity_margin" android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/tiny_margin" android:layout_marginEnd="@dimen/tiny_margin"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@drawable/ic_label_vector" /> android:src="@drawable/ic_label_vector" />
<com.simplemobiletools.commons.views.MyEditText <com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/edit_alarm_label" android:id="@+id/edit_alarm_hint"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/edit_alarm_sound" android:layout_below="@+id/edit_alarm_sound"
android:layout_marginStart="@dimen/medium_margin" android:layout_marginStart="@dimen/medium_margin"
android:layout_marginTop="@dimen/small_margin" android:layout_marginEnd="@dimen/bigger_margin"
android:layout_toEndOf="@+id/edit_alarm_label_image" android:layout_toEndOf="@+id/edit_alarm_label_image"
android:hint="@string/label" android:hint="@string/label">
android:maxLines="1"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_alarm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="@dimen/normal_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
</RelativeLayout> </RelativeLayout>
</ScrollView> </ScrollView>

View File

@ -7,36 +7,38 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/activity_margin"> android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/edit_time_zone_title_label" android:id="@+id/edit_time_zone_title_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/tiny_margin"
android:text="@string/title" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/edit_time_zone_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin" android:layout_marginBottom="@dimen/activity_margin"
android:singleLine="true" android:hint="@string/title">
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size" />
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_time_zone_label" android:id="@+id/edit_time_zone_title"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="@dimen/normal_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/edit_time_zone_label_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/tiny_margin" android:hint="@string/time_zone">
android:text="@string/time_zone" />
<com.simplemobiletools.commons.views.MyTextView <com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_time_zone_value" android:id="@+id/edit_time_zone_label"
android:layout_width="wrap_content" style="@style/UnclickableEditText"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginStart="@dimen/tiny_margin" android:layout_height="wrap_content"
android:paddingTop="@dimen/small_margin" android:maxLines="1"
android:textSize="@dimen/normal_text_size" android:singleLine="true"
tools:text="GMT-11:00 Midway" /> android:textSize="@dimen/normal_text_size"
tools:text="GMT-11:00 Midway" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
</LinearLayout> </LinearLayout>

View File

@ -89,17 +89,23 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_label_vector" /> android:src="@drawable/ic_label_vector" />
<com.simplemobiletools.commons.views.MyEditText <com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/edit_timer_label" android:id="@+id/edit_timer_hint"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="@dimen/medium_margin"
android:hint="@string/label" android:layout_marginEnd="@dimen/medium_margin"
android:maxLines="1" android:hint="@string/label">
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edit_timer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:singleLine="true"
android:textSize="@dimen/normal_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>