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.models.Alarm
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.*
class ReminderActivity : SimpleActivity() {
@ -40,10 +43,12 @@ class ReminderActivity : SimpleActivity() {
private var dragDownX = 0f
override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_reminder)
showOverLockscreen()
updateTextColors(reminder_holder as ViewGroup)
updateStatusbarColor(getProperBackgroundColor())
val id = intent.getIntExtra(ALARM_ID, -1)
isAlarmReminder = id != -1
@ -73,11 +78,6 @@ class ReminderActivity : SimpleActivity() {
setupEffects()
}
override fun onResume() {
super.onResume()
setupToolbar(reminder_toolbar)
}
private fun setupButtons() {
if (isAlarmReminder) {
setupAlarmButtons()

View File

@ -1,30 +1,10 @@
<?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"
android:id="@+id/reminder_coordinator"
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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/reminder_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:layout_height="match_parent">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/reminder_title"
@ -145,5 +125,4 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.constraintlayout.widget.ConstraintLayout>