aboutsummaryrefslogtreecommitdiff
path: root/anastasis-ui/src/main
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-09-08 16:49:28 -0300
committerTorsten Grote <t@grobox.de>2020-09-08 16:49:28 -0300
commitd351f89cce722485033711f90edaf5a0f28e81ae (patch)
tree50746414671125d5c35b3da8ae6799b8bc62c3c1 /anastasis-ui/src/main
parent310775d1cb7a177641c704efb1a98a7ccaac67b3 (diff)
downloadtaler-android-d351f89cce722485033711f90edaf5a0f28e81ae.tar.gz
taler-android-d351f89cce722485033711f90edaf5a0f28e81ae.tar.bz2
taler-android-d351f89cce722485033711f90edaf5a0f28e81ae.zip
Fix minor lint warnings
Diffstat (limited to 'anastasis-ui/src/main')
-rw-r--r--anastasis-ui/src/main/java/org/gnu/anastasis/ui/IntroFragment.kt2
-rw-r--r--anastasis-ui/src/main/java/org/gnu/anastasis/ui/MainViewModel.kt2
-rw-r--r--anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/AuthenticationFragment.kt6
-rw-r--r--anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt4
-rw-r--r--anastasis-ui/src/main/java/org/gnu/anastasis/ui/identity/IdentityFragment.kt2
-rw-r--r--anastasis-ui/src/main/res/drawable/ic_add_circle.xml10
-rw-r--r--anastasis-ui/src/main/res/layout/fragment_identity.xml6
7 files changed, 20 insertions, 12 deletions
diff --git a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/IntroFragment.kt b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/IntroFragment.kt
index c4b8e73..1e5a8d1 100644
--- a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/IntroFragment.kt
+++ b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/IntroFragment.kt
@@ -27,8 +27,6 @@ import kotlinx.android.synthetic.main.fragment_intro.*
class IntroFragment : Fragment() {
- private val model: MainViewModel by activityViewModels()
-
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
diff --git a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/MainViewModel.kt b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/MainViewModel.kt
index 3b97578..e2bf0c8 100644
--- a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/MainViewModel.kt
+++ b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/MainViewModel.kt
@@ -21,7 +21,7 @@ import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.MutableLiveData
import org.gnu.anastasis.ui.identity.LOCATIONS
-class MainViewModel(private val app: Application) : AndroidViewModel(app) {
+class MainViewModel(app: Application) : AndroidViewModel(app) {
val currentCountry = MutableLiveData(LOCATIONS[0])
diff --git a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/AuthenticationFragment.kt b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/AuthenticationFragment.kt
index fd770cb..5f7ab2e 100644
--- a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/AuthenticationFragment.kt
+++ b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/authentication/AuthenticationFragment.kt
@@ -79,17 +79,17 @@ class AuthenticationFragment : Fragment() {
)
}
- viewModel.securityQuestionChecked.observe(viewLifecycleOwner, Observer { checked ->
+ viewModel.securityQuestionChecked.observe(viewLifecycleOwner, { checked ->
passwordCard.isChecked = checked
updatePrice(checked, Amount.fromJSONString("KUDOS:0.5"))
updateNextButtonState()
})
- viewModel.smsChecked.observe(viewLifecycleOwner, Observer { checked ->
+ viewModel.smsChecked.observe(viewLifecycleOwner, { checked ->
smsCard.isChecked = checked
updatePrice(checked, Amount.fromJSONString("KUDOS:1.0"))
updateNextButtonState()
})
- viewModel.videoChecked.observe(viewLifecycleOwner, Observer { checked ->
+ viewModel.videoChecked.observe(viewLifecycleOwner, { checked ->
videoCard.isChecked = checked
updatePrice(checked, Amount.fromJSONString("KUDOS:2.25"))
updateNextButtonState()
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 f20fba5..2daf14a 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
@@ -97,8 +97,8 @@ class SmsFragment : Fragment() {
private fun fillPhoneNumber() {
val telephonyService = requireContext().getSystemService(TelephonyManager::class.java)
telephonyService?.line1Number?.let { phoneNumber ->
- smsView?.editText?.setText(phoneNumber)
- smsView?.editText?.setSelection(phoneNumber.length)
+ smsView.editText?.setText(phoneNumber)
+ smsView.editText?.setSelection(phoneNumber.length)
}
}
diff --git a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/identity/IdentityFragment.kt b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/identity/IdentityFragment.kt
index 40fa477..bcfbf24 100644
--- a/anastasis-ui/src/main/java/org/gnu/anastasis/ui/identity/IdentityFragment.kt
+++ b/anastasis-ui/src/main/java/org/gnu/anastasis/ui/identity/IdentityFragment.kt
@@ -52,7 +52,7 @@ class AnastasisIdentityFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
- model.currentCountry.observe(viewLifecycleOwner, Observer { country ->
+ model.currentCountry.observe(viewLifecycleOwner, { country ->
countryView.text = country.name
if (stub != null) {
stub.layoutResource = country.layoutRes
diff --git a/anastasis-ui/src/main/res/drawable/ic_add_circle.xml b/anastasis-ui/src/main/res/drawable/ic_add_circle.xml
new file mode 100644
index 0000000..76e1fcb
--- /dev/null
+++ b/anastasis-ui/src/main/res/drawable/ic_add_circle.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:tint="?attr/colorControlNormal"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z" />
+</vector>
diff --git a/anastasis-ui/src/main/res/layout/fragment_identity.xml b/anastasis-ui/src/main/res/layout/fragment_identity.xml
index 072414d..bcf6e4d 100644
--- a/anastasis-ui/src/main/res/layout/fragment_identity.xml
+++ b/anastasis-ui/src/main/res/layout/fragment_identity.xml
@@ -68,7 +68,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Change"
- android:textColor="@color/colorAccent"
+ android:textColor="?attr/colorAccent"
app:layout_constraintBaseline_toBaselineOf="@+id/countryView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -144,9 +144,9 @@
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:backgroundTint="@color/green"
- android:drawableLeft="@drawable/ic_baseline_lock"
- android:drawableTint="?attr/colorOnPrimarySurface"
+ android:drawableStart="@drawable/ic_baseline_lock"
android:text="Encrypt Identity"
+ app:drawableTint="?attr/colorOnPrimarySurface"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />