Merge branch 'release/1.0.0' of https://bitbucket.org/fabian_zobrist/counter into release/1.0.0
This commit is contained in:
@@ -10,7 +10,7 @@ android {
|
||||
applicationId "me.zobrist.tichucounter"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
versionCode 6
|
||||
versionCode 5
|
||||
versionName "1.0.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -12,10 +12,6 @@ import android.widget.ScrollView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import com.google.android.play.core.review.ReviewInfo
|
||||
import com.google.android.play.core.review.ReviewManager
|
||||
import com.google.android.play.core.review.ReviewManagerFactory
|
||||
import com.google.android.play.core.review.testing.FakeReviewManager
|
||||
import com.google.gson.Gson
|
||||
import kotlinx.android.synthetic.main.content_main.*
|
||||
|
||||
@@ -26,9 +22,6 @@ class MainActivity : AppCompatActivity() {
|
||||
private lateinit var history: History
|
||||
private var currentRound = Round()
|
||||
|
||||
lateinit var manager: ReviewManager
|
||||
lateinit var reviewInfo: ReviewInfo
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
@@ -49,8 +42,6 @@ class MainActivity : AppCompatActivity() {
|
||||
nameTeamB.setText(this.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("nameTeamB", "TeamB"))
|
||||
updateView()
|
||||
|
||||
initReviews()
|
||||
|
||||
|
||||
inputTeamA.setOnFocusChangeListener { view, b ->
|
||||
if (b) {
|
||||
@@ -71,7 +62,7 @@ class MainActivity : AppCompatActivity() {
|
||||
currentRound = try {
|
||||
Round(text.toString().toInt(), true)
|
||||
|
||||
} catch (e: Exception) {
|
||||
} catch (e: java.lang.Exception) {
|
||||
Round(1, 1)
|
||||
}
|
||||
inputTeamB.setText(currentRound.scoreB.toString())
|
||||
@@ -100,7 +91,7 @@ class MainActivity : AppCompatActivity() {
|
||||
currentRound = try {
|
||||
Round(text.toString().toInt(), false)
|
||||
|
||||
} catch (e: Exception) {
|
||||
} catch (e: java.lang.Exception) {
|
||||
Round(1, 1)
|
||||
}
|
||||
inputTeamA.setText(currentRound.scoreA.toString())
|
||||
@@ -394,30 +385,6 @@ class MainActivity : AppCompatActivity() {
|
||||
scoreB.text = "0"
|
||||
|
||||
history.clearAll()
|
||||
|
||||
askForReview()
|
||||
|
||||
}
|
||||
|
||||
private fun initReviews() {
|
||||
manager = ReviewManagerFactory.create(this)
|
||||
manager.requestReviewFlow().addOnCompleteListener { request ->
|
||||
if (request.isSuccessful) {
|
||||
reviewInfo = request.result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Call this when you want to show the dialog
|
||||
private fun askForReview() {
|
||||
try{
|
||||
manager.launchReviewFlow(this, reviewInfo).addOnFailureListener {
|
||||
// Log error and continue with the flow
|
||||
}.addOnCompleteListener { _ ->
|
||||
// Log success and continue with the flow
|
||||
}
|
||||
} catch (e: Exception){
|
||||
}
|
||||
}
|
||||
|
||||
private fun appendToFocusedInput(toAppend: Char) {
|
||||
|
||||
Reference in New Issue
Block a user