Преглед изворни кода

wip

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky пре 4 година
родитељ
комит
7d7a80af34

+ 36 - 0
src/main/java/com/nextcloud/ui/ClearStatusTask.kt

@@ -0,0 +1,36 @@
+/*
+ *
+ * Nextcloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * Copyright (C) 2020 Tobias Kaminsky
+ * Copyright (C) 2020 Nextcloud GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.ui
+
+import android.accounts.Account
+import android.content.Context
+import com.owncloud.android.lib.common.OwnCloudClientFactory
+import com.owncloud.android.lib.resources.users.ClearStatusMessageRemoteOperation
+
+public class ClearStatusTask(val account: Account?, val context: Context?) : Function0<Boolean> {
+    override fun invoke(): Boolean {
+        val client = OwnCloudClientFactory.createNextcloudClient(account, context)
+
+        return ClearStatusMessageRemoteOperation().execute(client).isSuccess
+    }
+}

+ 39 - 0
src/main/java/com/nextcloud/ui/SetPredefinedCustomStatusTask.kt

@@ -0,0 +1,39 @@
+/*
+ *
+ * Nextcloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * Copyright (C) 2020 Tobias Kaminsky
+ * Copyright (C) 2020 Nextcloud GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.ui
+
+import android.accounts.Account
+import android.content.Context
+import com.owncloud.android.lib.common.OwnCloudClientFactory
+import com.owncloud.android.lib.resources.users.SetPredefinedCustomStatusMessageRemoteOperation
+
+public class SetPredefinedCustomStatusTask(val messageId: String,
+                                           val clearAt: Long?,
+                                           val account: Account?,
+                                           val context: Context?) : Function0<Boolean> {
+    override fun invoke(): Boolean {
+        val client = OwnCloudClientFactory.createNextcloudClient(account, context)
+
+        return SetPredefinedCustomStatusMessageRemoteOperation(messageId, clearAt).execute(client).isSuccess
+    }
+}

+ 161 - 59
src/main/java/com/nextcloud/ui/SetStatusDialogFragment.kt

@@ -20,16 +20,17 @@
 
 
 package com.nextcloud.ui
 package com.nextcloud.ui
 
 
-import android.accounts.Account
 import android.annotation.SuppressLint
 import android.annotation.SuppressLint
 import android.app.Dialog
 import android.app.Dialog
 import android.content.Context
 import android.content.Context
-import android.graphics.Color
 import android.os.Bundle
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.LayoutInflater
 import android.view.View
 import android.view.View
 import android.view.ViewGroup
 import android.view.ViewGroup
 import android.view.inputmethod.InputMethodManager
 import android.view.inputmethod.InputMethodManager
+import android.widget.AdapterView
+import android.widget.AdapterView.OnItemSelectedListener
+import android.widget.ArrayAdapter
 import androidx.annotation.VisibleForTesting
 import androidx.annotation.VisibleForTesting
 import androidx.appcompat.app.AlertDialog
 import androidx.appcompat.app.AlertDialog
 import androidx.emoji.bundled.BundledEmojiCompatConfig
 import androidx.emoji.bundled.BundledEmojiCompatConfig
@@ -46,23 +47,22 @@ import com.nextcloud.client.network.ClientFactory
 import com.owncloud.android.R
 import com.owncloud.android.R
 import com.owncloud.android.databinding.DialogSetStatusBinding
 import com.owncloud.android.databinding.DialogSetStatusBinding
 import com.owncloud.android.datamodel.ArbitraryDataProvider
 import com.owncloud.android.datamodel.ArbitraryDataProvider
-import com.owncloud.android.lib.common.OwnCloudClientFactory
-import com.owncloud.android.lib.resources.users.ClearStatusMessageRemoteOperation
+import com.owncloud.android.lib.resources.users.ClearAt
 import com.owncloud.android.lib.resources.users.PredefinedStatus
 import com.owncloud.android.lib.resources.users.PredefinedStatus
-import com.owncloud.android.lib.resources.users.SetPredefinedCustomStatusMessageRemoteOperation
-import com.owncloud.android.lib.resources.users.SetStatusRemoteOperation
-import com.owncloud.android.lib.resources.users.SetUserDefinedCustomStatusMessageRemoteOperation
 import com.owncloud.android.lib.resources.users.Status
 import com.owncloud.android.lib.resources.users.Status
 import com.owncloud.android.lib.resources.users.StatusType
 import com.owncloud.android.lib.resources.users.StatusType
 import com.owncloud.android.ui.activity.BaseActivity
 import com.owncloud.android.ui.activity.BaseActivity
 import com.owncloud.android.ui.adapter.PredefinedStatusClickListener
 import com.owncloud.android.ui.adapter.PredefinedStatusClickListener
 import com.owncloud.android.ui.adapter.PredefinedStatusListAdapter
 import com.owncloud.android.ui.adapter.PredefinedStatusListAdapter
+import com.owncloud.android.utils.DisplayUtils
 import com.owncloud.android.utils.ThemeUtils
 import com.owncloud.android.utils.ThemeUtils
 import com.vanniktech.emoji.EmojiManager
 import com.vanniktech.emoji.EmojiManager
 import com.vanniktech.emoji.EmojiPopup
 import com.vanniktech.emoji.EmojiPopup
 import com.vanniktech.emoji.googlecompat.GoogleCompatEmojiProvider
 import com.vanniktech.emoji.googlecompat.GoogleCompatEmojiProvider
 import kotlinx.android.synthetic.main.dialog_set_status.*
 import kotlinx.android.synthetic.main.dialog_set_status.*
 import java.util.ArrayList
 import java.util.ArrayList
+import java.util.Calendar
+import java.util.Locale
 import javax.inject.Inject
 import javax.inject.Inject
 
 
 private const val ARG_CURRENT_USER_PARAM = "currentUser"
 private const val ARG_CURRENT_USER_PARAM = "currentUser"
@@ -80,6 +80,7 @@ class SetStatusDialogFragment : DialogFragment(),
     private lateinit var predefinedStatus: ArrayList<PredefinedStatus>
     private lateinit var predefinedStatus: ArrayList<PredefinedStatus>
     private lateinit var adapter: PredefinedStatusListAdapter
     private lateinit var adapter: PredefinedStatusListAdapter
     private var selectedPredefinedMessageId: String? = null
     private var selectedPredefinedMessageId: String? = null
+    private var clearAt: Long? = -1
     private lateinit var popup: EmojiPopup
     private lateinit var popup: EmojiPopup
 
 
     @Inject
     @Inject
@@ -129,6 +130,23 @@ class SetStatusDialogFragment : DialogFragment(),
             emoji.setText(it.icon)
             emoji.setText(it.icon)
             customStatusInput.text.clear()
             customStatusInput.text.clear()
             customStatusInput.setText(it.message)
             customStatusInput.setText(it.message)
+            visualizeStatus(it.status)
+
+            if (it.clearAt > 0) {
+                clearStatusAfterSpinner.visibility = View.GONE
+                remainingClearTime.apply {
+                    clearStatusMessageTextView.text = getString(R.string.clear_status_message)
+                    visibility = View.VISIBLE
+                    text = DisplayUtils.getRelativeTimestamp(context, it.clearAt * 1000, true)
+                        .toString()
+                        .decapitalize(Locale.getDefault())
+                    setOnClickListener {
+                        visibility = View.GONE
+                        clearStatusAfterSpinner.visibility = View.VISIBLE
+                        clearStatusMessageTextView.text = getString(R.string.clear_status_message_after)
+                    }
+                }
+            }
         }
         }
 
 
         adapter = PredefinedStatusListAdapter(this, requireContext())
         adapter = PredefinedStatusListAdapter(this, requireContext())
@@ -159,6 +177,96 @@ class SetStatusDialogFragment : DialogFragment(),
             .build(emoji)
             .build(emoji)
         emoji.disableKeyboardInput(popup)
         emoji.disableKeyboardInput(popup)
         emoji.forceSingleEmoji()
         emoji.forceSingleEmoji()
+
+        val adapter = ArrayAdapter<String>(requireContext(), android.R.layout.simple_spinner_item)
+        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
+        adapter.add(getString(R.string.dontClear))
+        adapter.add(getString(R.string.thirtyMinutes))
+        adapter.add(getString(R.string.oneHour))
+        adapter.add(getString(R.string.fourHours))
+        adapter.add(getString(R.string.today))
+        adapter.add(getString(R.string.thisWeek))
+
+        clearStatusAfterSpinner.apply {
+            this.adapter = adapter
+            onItemSelectedListener = object : OnItemSelectedListener {
+                override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
+                    setClearStatusAfterValue(position)
+                }
+
+                override fun onNothingSelected(parent: AdapterView<*>?) {
+                    // nothing to do
+                }
+            }
+        }
+    }
+
+    private fun setClearStatusAfterValue(item: Int) {
+        when (item) {
+            0 -> {
+                // don't clear
+                clearAt = null
+            }
+
+            1 -> {
+                // 30 minutes
+                clearAt = System.currentTimeMillis() / 1000 + 30 * 60
+            }
+
+            2 -> {
+                // one hour
+                clearAt = System.currentTimeMillis() / 1000 + 60 * 60
+            }
+
+            3 -> {
+                // four hours
+                clearAt = System.currentTimeMillis() / 1000 + 4 * 60 * 60
+            }
+
+            4 -> {
+                // today
+                val date = Calendar.getInstance().apply {
+                    set(Calendar.HOUR_OF_DAY, 23)
+                    set(Calendar.MINUTE, 59)
+                    set(Calendar.SECOND, 59)
+                }
+                clearAt = date.timeInMillis / 1000
+            }
+
+            5 -> {
+                // end of week
+                val date = Calendar.getInstance().apply {
+                    set(Calendar.HOUR_OF_DAY, 23)
+                    set(Calendar.MINUTE, 59)
+                    set(Calendar.SECOND, 59)
+                }
+
+                while (date.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) {
+                    date.add(Calendar.DAY_OF_YEAR, 1)
+                }
+
+                clearAt = date.timeInMillis / 1000
+            }
+        }
+    }
+
+    private fun clearAtToUnixTime(clearAt: ClearAt?): Long {
+        if (clearAt != null) {
+            if (clearAt.type.equals("period")) {
+                return System.currentTimeMillis() / 1000 + clearAt.time.toLong()
+            } else if (clearAt.type.equals("end-of")) {
+                if (clearAt.time.equals("day")) {
+                    val date = Calendar.getInstance().apply {
+                        set(Calendar.HOUR_OF_DAY, 23)
+                        set(Calendar.MINUTE, 59)
+                        set(Calendar.SECOND, 59)
+                    }
+                    return date.timeInMillis / 1000
+                }
+            }
+        }
+
+        return -1
     }
     }
 
 
     private fun openEmojiPopup() {
     private fun openEmojiPopup() {
@@ -171,12 +279,19 @@ class SetStatusDialogFragment : DialogFragment(),
     }
     }
 
 
     private fun setStatus(statusType: StatusType) {
     private fun setStatus(statusType: StatusType) {
+        visualizeStatus(statusType)
+
         asyncRunner.postQuickTask(
         asyncRunner.postQuickTask(
             SetStatusTask(
             SetStatusTask(
                 statusType,
                 statusType,
                 accountManager.currentOwnCloudAccount?.savedAccount,
                 accountManager.currentOwnCloudAccount?.savedAccount,
                 context),
                 context),
-            onResult = { visualizeStatus(statusType) }
+            {
+                if (!it) {
+                    clearTopStatus()
+                }
+            },
+            { clearTopStatus() }
         )
         )
     }
     }
 
 
@@ -184,29 +299,31 @@ class SetStatusDialogFragment : DialogFragment(),
         when (statusType) {
         when (statusType) {
             StatusType.ONLINE -> {
             StatusType.ONLINE -> {
                 clearTopStatus()
                 clearTopStatus()
-                onlineStatus.strokeColor = ThemeUtils.primaryColor(context)
+                onlineStatus.setBackgroundColor(ThemeUtils.primaryColor(context))
             }
             }
             StatusType.AWAY -> {
             StatusType.AWAY -> {
                 clearTopStatus()
                 clearTopStatus()
-                awayStatus.strokeColor = ThemeUtils.primaryColor(context)
+                awayStatus.setBackgroundColor(ThemeUtils.primaryColor(context))
             }
             }
             StatusType.DND -> {
             StatusType.DND -> {
                 clearTopStatus()
                 clearTopStatus()
-                dndStatus.strokeColor = ThemeUtils.primaryColor(context)
+                dndStatus.setBackgroundColor(ThemeUtils.primaryColor(context))
             }
             }
             StatusType.INVISIBLE -> {
             StatusType.INVISIBLE -> {
                 clearTopStatus()
                 clearTopStatus()
-                invisibleStatus.strokeColor = ThemeUtils.primaryColor(context)
+                invisibleStatus.setBackgroundColor(ThemeUtils.primaryColor(context))
             }
             }
             else -> clearTopStatus()
             else -> clearTopStatus()
         }
         }
     }
     }
 
 
     private fun clearTopStatus() {
     private fun clearTopStatus() {
-        onlineStatus.strokeColor = Color.TRANSPARENT
-        awayStatus.strokeColor = Color.TRANSPARENT
-        dndStatus.strokeColor = Color.TRANSPARENT
-        invisibleStatus.strokeColor = Color.TRANSPARENT
+        val grey = resources.getColor(R.color.grey_200)
+
+        onlineStatus.setBackgroundColor(grey)
+        awayStatus.setBackgroundColor(grey)
+        dndStatus.setBackgroundColor(grey)
+        invisibleStatus.setBackgroundColor(grey)
     }
     }
 
 
     private fun setStatusMessage() {
     private fun setStatusMessage() {
@@ -214,7 +331,7 @@ class SetStatusDialogFragment : DialogFragment(),
             asyncRunner.postQuickTask(
             asyncRunner.postQuickTask(
                 SetPredefinedCustomStatusTask(
                 SetPredefinedCustomStatusTask(
                     selectedPredefinedMessageId!!,
                     selectedPredefinedMessageId!!,
-                    1603719631,
+                    clearAt,
                     accountManager.currentOwnCloudAccount?.savedAccount,
                     accountManager.currentOwnCloudAccount?.savedAccount,
                     context),
                     context),
                 { dismiss(it) }
                 { dismiss(it) }
@@ -224,7 +341,7 @@ class SetStatusDialogFragment : DialogFragment(),
                 SetUserDefinedCustomStatusTask(
                 SetUserDefinedCustomStatusTask(
                     customStatusInput.text.toString(),
                     customStatusInput.text.toString(),
                     emoji.text.toString(),
                     emoji.text.toString(),
-                    1603719631,
+                    clearAt,
                     accountManager.currentOwnCloudAccount?.savedAccount,
                     accountManager.currentOwnCloudAccount?.savedAccount,
                     context),
                     context),
                 { dismiss(it) }
                 { dismiss(it) }
@@ -238,47 +355,6 @@ class SetStatusDialogFragment : DialogFragment(),
         }
         }
     }
     }
 
 
-    private class SetPredefinedCustomStatusTask(val messageId: String,
-                                                val clearAt: Long,
-                                                val account: Account?,
-                                                val context: Context?) : Function0<Boolean> {
-        override fun invoke(): Boolean {
-            val client = OwnCloudClientFactory.createNextcloudClient(account, context)
-
-            return SetPredefinedCustomStatusMessageRemoteOperation(messageId, clearAt).execute(client).isSuccess
-        }
-    }
-
-    private class SetUserDefinedCustomStatusTask(val message: String,
-                                                 val icon: String,
-                                                 val clearAt: Long,
-                                                 val account: Account?,
-                                                 val context: Context?) : Function0<Boolean> {
-        override fun invoke(): Boolean {
-            val client = OwnCloudClientFactory.createNextcloudClient(account, context)
-
-            return SetUserDefinedCustomStatusMessageRemoteOperation(message, icon, clearAt).execute(client).isSuccess
-        }
-    }
-
-    private class SetStatusTask(val statusType: StatusType,
-                                val account: Account?,
-                                val context: Context?) : Function0<Boolean> {
-        override fun invoke(): Boolean {
-            val client = OwnCloudClientFactory.createNextcloudClient(account, context)
-
-            return SetStatusRemoteOperation(statusType).execute(client).isSuccess
-        }
-    }
-
-    private class ClearStatusTask(val account: Account?, val context: Context?) : Function0<Boolean> {
-        override fun invoke(): Boolean {
-            val client = OwnCloudClientFactory.createNextcloudClient(account, context)
-
-            return ClearStatusMessageRemoteOperation().execute(client).isSuccess
-        }
-    }
-
     /**
     /**
      * Fragment creator
      * Fragment creator
      */
      */
@@ -301,9 +377,35 @@ class SetStatusDialogFragment : DialogFragment(),
 
 
     override fun onClick(predefinedStatus: PredefinedStatus) {
     override fun onClick(predefinedStatus: PredefinedStatus) {
         selectedPredefinedMessageId = predefinedStatus.id
         selectedPredefinedMessageId = predefinedStatus.id
+        clearAt = clearAtToUnixTime(predefinedStatus.clearAt)
         emoji.setText(predefinedStatus.icon)
         emoji.setText(predefinedStatus.icon)
         customStatusInput.text.clear()
         customStatusInput.text.clear()
         customStatusInput.text.append(predefinedStatus.message)
         customStatusInput.text.append(predefinedStatus.message)
+
+        remainingClearTime.visibility = View.GONE
+        clearStatusAfterSpinner.visibility = View.VISIBLE
+        clearStatusMessageTextView.text = getString(R.string.clear_status_message_after)
+
+        if (predefinedStatus.clearAt == null) {
+            clearStatusAfterSpinner.setSelection(0)
+        } else {
+            val clearAt = predefinedStatus.clearAt!!
+            if (clearAt.type.equals("period")) {
+                when (clearAt.time) {
+                    "1800" -> clearStatusAfterSpinner.setSelection(1)
+                    "3600" -> clearStatusAfterSpinner.setSelection(2)
+                    "14400" -> clearStatusAfterSpinner.setSelection(3)
+                    else -> clearStatusAfterSpinner.setSelection(0)
+                }
+            } else if (clearAt.type.equals("end-of")) {
+                when (clearAt.time) {
+                    "day" -> clearStatusAfterSpinner.setSelection(4)
+                    "week" -> clearStatusAfterSpinner.setSelection(5)
+                    else -> clearStatusAfterSpinner.setSelection(0)
+                }
+            }
+        }
+        setClearStatusAfterValue(clearStatusAfterSpinner.selectedItemPosition)
     }
     }
 
 
     @VisibleForTesting
     @VisibleForTesting

+ 39 - 0
src/main/java/com/nextcloud/ui/SetStatusTask.kt

@@ -0,0 +1,39 @@
+/*
+ *
+ * Nextcloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * Copyright (C) 2020 Tobias Kaminsky
+ * Copyright (C) 2020 Nextcloud GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.ui
+
+import android.accounts.Account
+import android.content.Context
+import com.owncloud.android.lib.common.OwnCloudClientFactory
+import com.owncloud.android.lib.resources.users.SetStatusRemoteOperation
+import com.owncloud.android.lib.resources.users.StatusType
+
+class SetStatusTask(val statusType: StatusType,
+                    val account: Account?,
+                    val context: Context?) : Function0<Boolean> {
+    override fun invoke(): Boolean {
+        val client = OwnCloudClientFactory.createNextcloudClient(account, context)
+
+        return SetStatusRemoteOperation(statusType).execute(client).isSuccess
+    }
+}

+ 40 - 0
src/main/java/com/nextcloud/ui/SetUserDefinedCustomStatusTask.kt

@@ -0,0 +1,40 @@
+/*
+ *
+ * Nextcloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * Copyright (C) 2020 Tobias Kaminsky
+ * Copyright (C) 2020 Nextcloud GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.ui
+
+import android.accounts.Account
+import android.content.Context
+import com.owncloud.android.lib.common.OwnCloudClientFactory
+import com.owncloud.android.lib.resources.users.SetUserDefinedCustomStatusMessageRemoteOperation
+
+public class SetUserDefinedCustomStatusTask(val message: String,
+                                            val icon: String,
+                                            val clearAt: Long?,
+                                            val account: Account?,
+                                            val context: Context?) : Function0<Boolean> {
+    override fun invoke(): Boolean {
+        val client = OwnCloudClientFactory.createNextcloudClient(account, context)
+
+        return SetUserDefinedCustomStatusMessageRemoteOperation(message, icon, clearAt).execute(client).isSuccess
+    }
+}

+ 10 - 5
src/main/res/layout/dialog_set_status.xml

@@ -62,7 +62,6 @@
                 android:layout_weight="1"
                 android:layout_weight="1"
                 android:orientation="horizontal"
                 android:orientation="horizontal"
                 app:cardBackgroundColor="@color/grey_200"
                 app:cardBackgroundColor="@color/grey_200"
-                app:strokeWidth="2dp"
                 app:cardElevation="0dp">
                 app:cardElevation="0dp">
 
 
                 <RelativeLayout
                 <RelativeLayout
@@ -128,7 +127,6 @@
                 android:layout_gravity="center_vertical"
                 android:layout_gravity="center_vertical"
                 android:layout_marginStart="@dimen/standard_half_margin"
                 android:layout_marginStart="@dimen/standard_half_margin"
                 android:layout_weight="1"
                 android:layout_weight="1"
-                app:strokeWidth="2dp"
                 android:orientation="horizontal"
                 android:orientation="horizontal"
                 app:cardBackgroundColor="@color/grey_200"
                 app:cardBackgroundColor="@color/grey_200"
                 app:cardElevation="0dp">
                 app:cardElevation="0dp">
@@ -205,7 +203,6 @@
                 android:layout_gravity="center_vertical"
                 android:layout_gravity="center_vertical"
                 android:layout_marginEnd="@dimen/standard_half_margin"
                 android:layout_marginEnd="@dimen/standard_half_margin"
                 android:layout_weight="1"
                 android:layout_weight="1"
-                app:strokeWidth="2dp"
                 android:orientation="horizontal"
                 android:orientation="horizontal"
                 app:cardBackgroundColor="@color/grey_200"
                 app:cardBackgroundColor="@color/grey_200"
                 app:cardElevation="0dp">
                 app:cardElevation="0dp">
@@ -393,17 +390,25 @@
         android:orientation="horizontal">
         android:orientation="horizontal">
 
 
         <TextView
         <TextView
-            android:id="@+id/textView3"
+            android:id="@+id/clearStatusMessageTextView"
             android:layout_width="wrap_content"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/clear_status_message_after"
             android:text="@string/clear_status_message_after"
             android:textColor="@color/text_color" />
             android:textColor="@color/text_color" />
 
 
         <Spinner
         <Spinner
-            android:id="@+id/spinner"
+            android:id="@+id/clearStatusAfterSpinner"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content" />
             android:layout_height="wrap_content" />
 
 
+        <TextView
+            android:id="@+id/remainingClearTime"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textColor="@color/text_color"
+            android:layout_marginStart="4dp"
+            android:visibility="gone" />
+
     </LinearLayout>
     </LinearLayout>
 
 
     <LinearLayout
     <LinearLayout

+ 4 - 0
src/main/res/values/strings.xml

@@ -954,4 +954,8 @@
     <string translatable="false" name="default_emoji">😃</string>
     <string translatable="false" name="default_emoji">😃</string>
     <string name="dontClear">Don\'t clear</string>
     <string name="dontClear">Don\'t clear</string>
     <string name="today">Today</string>
     <string name="today">Today</string>
+    <string name="thirtyMinutes">30 minutes</string>
+    <string name="oneHour">1 hour</string>
+    <string name="fourHours">4 hour</string>
+    <string name="thisWeek">This week</string>
 </resources>
 </resources>