Commit 7d8b08bf authored by deregges's avatar deregges

Added confirmation dialog for btnClearHighscores

parent 4f2b7ff7
......@@ -6,6 +6,7 @@ import android.view.ViewGroup
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import com.xw.repo.BubbleSeekBar
import io.ender.pathchaser.R
......@@ -74,8 +75,15 @@ class Settings : AppCompatActivity() {
volume.visibility = View.GONE //TODO add music
btnClearHighscores.setOnClickListener {
Highscores.clearScores()
longToast(R.string.settings_highscoresCleared)
AlertDialog.Builder(this)
.setTitle(R.string.settings_btnClearHighscoresDialogTitle)
.setMessage(R.string.settings_btnClearHighscoresDialogMessage)
.setPositiveButton(android.R.string.yes) { _, _ ->
Highscores.clearScores()
longToast(R.string.settings_highscoresCleared)
}
.setNegativeButton(android.R.string.no) { _, _ -> }
.create().show()
}
inputMethod.adapter = object : ArrayAdapter<Constants.InputMethod>(
......
......@@ -29,4 +29,6 @@
<string name="inputMethodRotation">Neigung (3D)</string>
<string name="inputMethodRotation2D">Neigung (2D)</string>
<string name="version">Version: %s</string>
<string name="settings_btnClearHighscoresDialogTitle">Highscores entfernen</string>
<string name="settings_btnClearHighscoresDialogMessage">Damit werden alle highscores gelöscht. Fortfahren?</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment