adding more styling updates

This commit is contained in:
tibbi 2022-07-26 16:57:29 +02:00
parent ecbb2c68d5
commit 43ad599a5e
11 changed files with 143 additions and 122 deletions

View File

@ -70,7 +70,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:f8b1a5a510'
implementation 'com.github.SimpleMobileTools:Simple-Commons:d09ee0000e'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

View File

@ -22,7 +22,7 @@ class ExportEventsDialog(
init {
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_events, null) as ViewGroup).apply {
export_events_folder.text = activity.humanizePath(realPath)
export_events_folder.setText(activity.humanizePath(realPath))
export_events_filename.setText("${activity.getString(R.string.events)}_${activity.getCurrentFormattedDateTime()}")
export_past_events_checkbox.isChecked = config.exportPastEvents
export_past_events_checkbox_holder.setOnClickListener {
@ -30,13 +30,13 @@ class ExportEventsDialog(
}
if (hidePath) {
export_events_folder_label.beGone()
export_events_folder_hint.beGone()
export_events_folder.beGone()
} else {
export_events_folder.setOnClickListener {
activity.hideKeyboard(export_events_filename)
FilePickerDialog(activity, realPath, false, showFAB = true) {
export_events_folder.text = activity.humanizePath(it)
export_events_folder.setText(activity.humanizePath(it))
realPath = it
}
}

View File

@ -50,7 +50,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal
private fun initDialog() {
val view = (activity.layoutInflater.inflate(R.layout.dialog_import_events, null) as ViewGroup).apply {
updateEventType(this)
import_event_type_holder.setOnClickListener {
import_event_type_title.setOnClickListener {
SelectEventTypeDialog(activity, currEventTypeId, true, true, false, true) {
currEventTypeId = it.id!!
currEventTypeCalDAVCalendarId = it.caldavCalendarId
@ -90,7 +90,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal
ensureBackgroundThread {
val eventType = activity.eventTypesDB.getEventTypeWithId(currEventTypeId)
activity.runOnUiThread {
view.import_event_type_title.text = eventType!!.getDisplayTitle()
view.import_event_type_title.setText(eventType!!.getDisplayTitle())
view.import_event_type_color.setFillWithStroke(eventType.color, activity.getProperBackgroundColor())
}
}

View File

@ -21,7 +21,7 @@ class ReminderWarningDialog(val activity: Activity, val callback: () -> Unit) {
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
.setNeutralButton(R.string.settings, null)
.apply {
activity.setupDialogStuff(view, this, cancelOnTouchOutside = false) { alertDialog ->
activity.setupDialogStuff(view, this, R.string.disclaimer, cancelOnTouchOutside = false) { alertDialog ->
alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL).setOnClickListener {
redirectToSettings()
}

View File

@ -60,11 +60,12 @@ class RepeatLimitTypePickerDialog(val activity: Activity, var repeatLimit: Long,
}
private fun updateRepeatLimitText() {
if (repeatLimit <= 0)
if (repeatLimit <= 0) {
repeatLimit = getNowSeconds()
}
val repeatLimitDateTime = Formatter.getDateTimeFromTS(repeatLimit)
view.repeat_type_date.text = Formatter.getFullDate(activity, repeatLimitDateTime)
view.repeat_type_date.setText(Formatter.getFullDate(activity, repeatLimitDateTime))
}
private fun confirmRepetition() {
@ -102,7 +103,8 @@ class RepeatLimitTypePickerDialog(val activity: Activity, var repeatLimit: Long,
} else {
repeatLimitDateTime.seconds()
}
callback(repeatLimit)
dialog?.dismiss()
updateRepeatLimitText()
view.dialog_radio_view.check(R.id.repeat_type_till_date)
}
}

View File

@ -13,16 +13,23 @@
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/dialog_custom_repeat_interval_value"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/dialog_custom_repeat_interval_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:ems="3"
android:inputType="number"
android:maxLength="4"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size" />
android:hint="@string/value">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/dialog_custom_repeat_interval_value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:inputType="number"
android:maxLength="4"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<RadioGroup
android:id="@+id/dialog_radio_view"

View File

@ -13,16 +13,23 @@
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/dialog_custom_period_value"
android:layout_width="wrap_content"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/dialog_custom_period_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:ems="6"
android:inputType="number"
android:maxLength="5"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size" />
android:hint="@string/value">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/dialog_custom_period_value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:inputType="number"
android:maxLength="5"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<RadioGroup
android:id="@+id/dialog_radio_view"

View File

@ -8,23 +8,24 @@
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/type_title_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/small_margin"
android:text="@string/title" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/type_title"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/type_title_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:inputType="textCapSentences"
android:maxLength="80"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size" />
android:hint="@string/title">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/type_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapSentences"
android:maxLength="80"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/type_color_label"

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/export_events_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -13,43 +12,41 @@
android:orientation="vertical"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_folder_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/medium_margin"
android:paddingStart="@dimen/normal_margin"
android:text="@string/folder"
android:textSize="@dimen/smaller_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_folder"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/export_events_folder_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginBottom="@dimen/activity_margin"
android:padding="@dimen/small_margin"
tools:text="Internal/" />
android:hint="@string/folder">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_filename_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/small_margin"
android:paddingStart="@dimen/activity_margin"
android:text="@string/filename_without_ics"
android:textSize="@dimen/smaller_text_size" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/export_events_folder"
style="@style/UnclickableEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/export_events_filename"
</com.simplemobiletools.commons.views.MyTextInputLayout>
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/export_events_filename_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/big_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/normal_text_size" />
android:layout_marginEnd="@dimen/activity_margin"
android:hint="@string/filename_without_ics">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/export_events_filename"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<RelativeLayout
android:id="@+id/export_past_events_checkbox_holder"
@ -57,9 +54,9 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingTop="@dimen/medium_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
android:paddingBottom="@dimen/medium_margin">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/export_past_events_checkbox"
@ -85,7 +82,6 @@
android:id="@+id/export_events_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:background="@color/divider_grey"
android:importantForAccessibility="no" />

View File

@ -1,49 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/import_events_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/import_events_event_type_label"
android:layout_width="wrap_content"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/import_event_type_hint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/medium_margin"
android:paddingStart="@dimen/normal_margin"
android:text="@string/default_event_type"
android:textSize="@dimen/smaller_text_size" />
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_toStartOf="@+id/import_event_type_color"
android:hint="@string/default_event_type"
app:layout_constraintEnd_toStartOf="@+id/import_event_type_color"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:id="@+id/import_event_type_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/import_event_type_title"
style="@style/UnclickableEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/import_event_type_color"
android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/medium_margin"
tools:text="@string/regular_event" />
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/import_event_type_color"
android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size"
android:layout_alignParentEnd="true"
android:clickable="false" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
</RelativeLayout>
<ImageView
android:id="@+id/import_event_type_color"
android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size"
android:layout_marginEnd="@dimen/activity_margin"
android:clickable="false"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/import_event_type_hint"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/import_event_type_hint" />
<RelativeLayout
android:id="@+id/import_events_checkbox_holder"
@ -53,7 +45,8 @@
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
android:paddingBottom="@dimen/normal_margin"
app:layout_constraintTop_toBottomOf="@+id/import_event_type_hint">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/import_events_checkbox"
@ -66,4 +59,4 @@
android:text="@string/ignore_event_types" />
</RelativeLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/dialog_repeat_type_picker_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -17,14 +16,20 @@
android:layout_height="wrap_content"
android:text="@string/repeat_till_date" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/repeat_type_date"
android:layout_width="match_parent"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/repeat_type_date_hint"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/repeat_type_margin_start"
android:paddingTop="@dimen/medium_margin"
android:paddingBottom="@dimen/normal_margin"
tools:text="January 1 1970" />
android:hint="@string/value">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/repeat_type_date"
style="@style/UnclickableEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/repeat_type_x_times"
@ -33,14 +38,24 @@
android:layout_marginTop="@dimen/small_margin"
android:text="@string/stop_repeating_after_x" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/repeat_type_count"
android:layout_width="100dp"
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/repeat_type_count_hint"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/repeat_type_margin_start"
android:inputType="number"
android:maxLength="5"
android:textSize="@dimen/normal_text_size" />
android:hint="@string/value">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/repeat_type_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:inputType="number"
android:maxLength="5"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/repeat_type_forever"