warn before deleting a scheduled post (#2721)
This commit is contained in:
parent
2481bc0523
commit
532afaad2b
3 changed files with 10 additions and 3 deletions
|
@ -19,6 +19,7 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.paging.LoadState
|
import androidx.paging.LoadState
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
|
@ -134,8 +135,14 @@ class ScheduledStatusActivity : BaseActivity(), ScheduledStatusActionListener, I
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun delete(item: ScheduledStatus) {
|
override fun delete(item: ScheduledStatus) {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setMessage(R.string.delete_scheduled_post_warning)
|
||||||
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
|
.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||||
viewModel.deleteScheduledStatus(item)
|
viewModel.deleteScheduledStatus(item)
|
||||||
}
|
}
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newIntent(context: Context) = Intent(context, ScheduledStatusActivity::class.java)
|
fun newIntent(context: Context) = Intent(context, ScheduledStatusActivity::class.java)
|
||||||
|
|
|
@ -57,8 +57,7 @@ class ScheduledStatusAdapter(
|
||||||
v.isEnabled = false
|
v.isEnabled = false
|
||||||
listener.edit(item)
|
listener.edit(item)
|
||||||
}
|
}
|
||||||
holder.binding.delete.setOnClickListener { v: View ->
|
holder.binding.delete.setOnClickListener {
|
||||||
v.isEnabled = false
|
|
||||||
listener.delete(item)
|
listener.delete(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -668,5 +668,6 @@
|
||||||
<string name="dialog_push_notification_migration_other_accounts">You have re-logged into your current account to grant push subscription permission to Tusky. However, you still have other accounts that have not been migrated this way. Switch to them and re-login one by one in order to enable UnifiedPush notifications support.</string>
|
<string name="dialog_push_notification_migration_other_accounts">You have re-logged into your current account to grant push subscription permission to Tusky. However, you still have other accounts that have not been migrated this way. Switch to them and re-login one by one in order to enable UnifiedPush notifications support.</string>
|
||||||
<string name="url_domain_notifier">%s (🔗 %s)</string>
|
<string name="url_domain_notifier">%s (🔗 %s)</string>
|
||||||
|
|
||||||
|
<string name="delete_scheduled_post_warning">Delete this scheduled post?</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue