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

Commit f707f528 authored by narinder Rana's avatar narinder Rana
Browse files

restricted to add empty number into field

parent 497e0b2d
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().isEmpty()) {
                listener(layout.field.text.toString().toIntOrNull() ?: 0)
            } else {
                Toast.makeText(context, "Not able to add empty number ! please try again", Toast.LENGTH_LONG).show()
            }
        }
    }