diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/blocking/numbers/BlockedNumbersController.kt b/presentation/src/main/java/com/moez/QKSMS/feature/blocking/numbers/BlockedNumbersController.kt index 7b1cbb93ca35273320619a88359d3a39691f203c..83f7bfe7095b0ced831200d6e4b2dc38a212a8c5 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/blocking/numbers/BlockedNumbersController.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/blocking/numbers/BlockedNumbersController.kt @@ -20,6 +20,8 @@ package com.moez.QKSMS.feature.blocking.numbers import android.view.LayoutInflater import android.view.View +import android.widget.Button +import android.widget.Toast import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat import com.jakewharton.rxbinding2.view.clicks @@ -38,11 +40,14 @@ import kotlinx.android.synthetic.main.blocked_numbers_controller.* import javax.inject.Inject class BlockedNumbersController : QkController(), - BlockedNumbersView { + BlockedNumbersView { - @Inject override lateinit var presenter: BlockedNumbersPresenter - @Inject lateinit var colors: Colors - @Inject lateinit var phoneNumberUtils: PhoneNumberUtils + @Inject + override lateinit var presenter: BlockedNumbersPresenter + @Inject + lateinit var colors: Colors + @Inject + lateinit var phoneNumberUtils: PhoneNumberUtils private val adapter = BlockedNumbersAdapter() private val saveAddressSubject: Subject = PublishSubject.create() @@ -80,7 +85,11 @@ class BlockedNumbersController : QkController - saveAddressSubject.onNext(layout.input.text.toString()) + if (!layout.input.text.toString().trim().isEmpty()) { + saveAddressSubject.onNext(layout.input.text.toString()) + } else { + Toast.makeText(activity, R.string.not_able_to_add_empty_text, Toast.LENGTH_LONG).show() + } } .setNegativeButton(R.string.button_cancel) { _, _ -> } .setOnDismissListener { textWatcher.dispose() } diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 3eba897cb7dda4c212e33c809cbbd1876795a0c9..954a814290e0a0a72bd9e12830afd14d986e9cb4 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -502,4 +502,5 @@ Share some love and rate us on Google Play! OKAY! DISMISS + Not able to add empty text ! please try again