Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 842c2069 authored by narinder Rana's avatar narinder Rana
Browse files

Merge branch '143-crash-no-of-days' into 'main'

restricted to add empty number into field

See merge request !51
parents f8cf66fc 82fa9f28
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ package com.moez.QKSMS.feature.settings.autodelete
import android.app.Activity
import android.content.DialogInterface
import android.view.LayoutInflater
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import com.moez.QKSMS.R
import kotlinx.android.synthetic.main.settings_auto_delete_dialog.view.*
@@ -36,7 +37,11 @@ class AutoDeleteDialog(context: Activity, listener: (Int) -> Unit) : AlertDialog
        setButton(DialogInterface.BUTTON_NEUTRAL, context.getString(R.string.button_cancel)) { _, _ -> }
        setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.settings_auto_delete_never)) { _, _ -> listener(0) }
        setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.button_save)) { _, _ ->
            if (!layout.field.text.toString().trim().isEmpty()) {
                listener(layout.field.text.toString().toIntOrNull() ?: 0)
            } else {
                Toast.makeText(context, context.getString(R.string.not_able_to_add_empty_number), Toast.LENGTH_LONG).show()
            }
        }
    }

+4 −0
Original line number Diff line number Diff line
@@ -502,5 +502,9 @@
    <string name="rate_summary">Share some love and rate us on Google Play!</string>
    <string name="rate_okay">OKAY!</string>
    <string name="rate_dismiss">DISMISS</string>

    <string name="not_able_to_add_empty_number">Not able to add empty number ! please try again</string>

    <string name="not_able_to_add_empty_text">Not able to add empty text ! please try again</string>

</resources>