warn before deleting a scheduled post (#2721)
This commit is contained in:
parent
2481bc0523
commit
532afaad2b
|
@ -19,6 +19,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.paging.LoadState
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
|
@ -134,7 +135,13 @@ class ScheduledStatusActivity : BaseActivity(), ScheduledStatusActionListener, I
|
|||
}
|
||||
|
||||
override fun delete(item: ScheduledStatus) {
|
||||
viewModel.deleteScheduledStatus(item)
|
||||
AlertDialog.Builder(this)
|
||||
.setMessage(R.string.delete_scheduled_post_warning)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||
viewModel.deleteScheduledStatus(item)
|
||||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -57,8 +57,7 @@ class ScheduledStatusAdapter(
|
|||
v.isEnabled = false
|
||||
listener.edit(item)
|
||||
}
|
||||
holder.binding.delete.setOnClickListener { v: View ->
|
||||
v.isEnabled = false
|
||||
holder.binding.delete.setOnClickListener {
|
||||
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="url_domain_notifier">%s (🔗 %s)</string>
|
||||
|
||||
<string name="delete_scheduled_post_warning">Delete this scheduled post?</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in New Issue