aboutsummaryrefslogtreecommitdiff
path: root/anastasis-ui/src
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2022-06-20 14:12:24 -0300
committerTorsten Grote <t@grobox.de>2022-06-20 14:12:24 -0300
commit0450b57c2d2104226196878a9e7217fe6eb3730e (patch)
treebdb498f62fb17b651effdda1df8038f3817564f2 /anastasis-ui/src
parent5b7bb5cf012fc41b2fbb6a41f6f858009c1ba092 (diff)
downloadtaler-android-0450b57c2d2104226196878a9e7217fe6eb3730e.tar.gz
taler-android-0450b57c2d2104226196878a9e7217fe6eb3730e.tar.bz2
taler-android-0450b57c2d2104226196878a9e7217fe6eb3730e.zip
Fix lint and CI issues
Note that I only fixes the most grave things that made things fail. I didn't address all issues introduces lately nor making sure the targetSdk bump to 32 has no unintented side-effects.
Diffstat (limited to 'anastasis-ui/src')
-rw-r--r--anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt10
1 files changed, 4 insertions, 6 deletions
diff --git a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt
index 413f472..2c35309 100644
--- a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt
+++ b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt
@@ -25,7 +25,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.RequiresPermission
-import androidx.core.content.ContextCompat
+import androidx.core.content.ContextCompat.checkSelfPermission
import androidx.core.content.getSystemService
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
@@ -35,7 +35,6 @@ import com.google.android.material.transition.MaterialContainerTransform.FADE_MO
import org.gnu.anastasis.ui.MainViewModel
import org.gnu.anastasis.ui.PERMISSION_REQUEST_CODE
import org.gnu.anastasis.ui.R
-import org.gnu.anastasis.ui.databinding.FragmentSecurityQuestionBinding
import org.gnu.anastasis.ui.databinding.FragmentSmsBinding
private const val PERMISSION = Manifest.permission.READ_PHONE_STATE
@@ -52,7 +51,7 @@ class SmsFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
- savedInstanceState: Bundle?
+ savedInstanceState: Bundle?,
): View? {
_binding = FragmentSmsBinding.inflate(inflater, container, false)
sharedElementEnterTransition = MaterialContainerTransform().apply {
@@ -79,8 +78,7 @@ class SmsFragment : Fragment() {
}
private fun checkPerm() = when {
- ContextCompat.checkSelfPermission(requireContext(), PERMISSION)
- == PERMISSION_GRANTED -> {
+ checkSelfPermission(requireContext(), PERMISSION) == PERMISSION_GRANTED -> {
// You can use the API that requires the permission.
fillPhoneNumber()
}
@@ -99,7 +97,7 @@ class SmsFragment : Fragment() {
override fun onRequestPermissionsResult(
requestCode: Int,
permissions: Array<String>,
- grantResults: IntArray
+ grantResults: IntArray,
) {
if (requestCode == PERMISSION_REQUEST_CODE && grantResults.isNotEmpty() &&
grantResults[0] == PERMISSION_GRANTED