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.setText(alarm.label)
edit_alarm.setText(alarm.label)
val dayLetters = activity.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList<String>
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
var alarmId = alarm.id

View File

@ -19,7 +19,7 @@ class EditTimeZoneDialog(val activity: SimpleActivity, val myTimeZone: MyTimeZon
init {
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_value.text = getDefaultTimeZoneTitle(myTimeZone.id)
edit_time_zone_label.setText(getDefaultTimeZoneTitle(myTimeZone.id))
}
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.setText(timer.label)
edit_timer.setText(timer.label)
}
activity.getAlertDialogBuilder()
@ -69,7 +68,7 @@ class EditTimerDialog(val activity: SimpleActivity, val timer: Timer, val callba
.apply {
activity.setupDialogStuff(view, this) { alertDialog ->
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
timer.label = view.edit_timer_label.value
timer.label = view.edit_timer.value
activity.timerHelper.insertOrUpdateTimer(timer) {
activity.config.timerLastConfig = timer
callback()

View File

@ -95,26 +95,31 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/edit_alarm_sound"
android:layout_alignTop="@+id/edit_alarm_label"
android:layout_alignBottom="@+id/edit_alarm_label"
android:layout_alignTop="@+id/edit_alarm_hint"
android:layout_alignBottom="@+id/edit_alarm_hint"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/tiny_margin"
android:scaleType="fitCenter"
android:src="@drawable/ic_label_vector" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/edit_alarm_label"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/edit_alarm_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/edit_alarm_sound"
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:hint="@string/label"
android:maxLines="1"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
android:hint="@string/label">
<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>
</ScrollView>

View File

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

View File

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