flattening the reminder activity

This commit is contained in:
tibbi
2022-12-25 22:26:20 +01:00
parent 1d1a887073
commit 2542d6fa59
2 changed files with 119 additions and 140 deletions

View File

@ -21,7 +21,10 @@ import com.simplemobiletools.clock.helpers.ALARM_ID
import com.simplemobiletools.clock.helpers.getPassedSeconds import com.simplemobiletools.clock.helpers.getPassedSeconds
import com.simplemobiletools.clock.models.Alarm import com.simplemobiletools.clock.models.Alarm
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.helpers.MINUTE_SECONDS
import com.simplemobiletools.commons.helpers.SILENT
import com.simplemobiletools.commons.helpers.isOreoMr1Plus
import com.simplemobiletools.commons.helpers.isOreoPlus
import kotlinx.android.synthetic.main.activity_reminder.* import kotlinx.android.synthetic.main.activity_reminder.*
class ReminderActivity : SimpleActivity() { class ReminderActivity : SimpleActivity() {
@ -40,10 +43,12 @@ class ReminderActivity : SimpleActivity() {
private var dragDownX = 0f private var dragDownX = 0f
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_reminder) setContentView(R.layout.activity_reminder)
showOverLockscreen() showOverLockscreen()
updateTextColors(reminder_holder as ViewGroup) updateTextColors(reminder_holder as ViewGroup)
updateStatusbarColor(getProperBackgroundColor())
val id = intent.getIntExtra(ALARM_ID, -1) val id = intent.getIntExtra(ALARM_ID, -1)
isAlarmReminder = id != -1 isAlarmReminder = id != -1
@ -73,11 +78,6 @@ class ReminderActivity : SimpleActivity() {
setupEffects() setupEffects()
} }
override fun onResume() {
super.onResume()
setupToolbar(reminder_toolbar)
}
private fun setupButtons() { private fun setupButtons() {
if (isAlarmReminder) { if (isAlarmReminder) {
setupAlarmButtons() setupAlarmButtons()

View File

@ -1,30 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/reminder_coordinator" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/reminder_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/reminder_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/color_primary"
app:title="@string/app_launcher_name"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/reminder_holder" android:id="@+id/reminder_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.simplemobiletools.commons.views.MyTextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/reminder_title" android:id="@+id/reminder_title"
@ -146,4 +126,3 @@
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>