From d351f89cce722485033711f90edaf5a0f28e81ae Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 8 Sep 2020 16:49:28 -0300 Subject: Fix minor lint warnings --- anastasis-ui/src/main/java/org/gnu/anastasis/ui/IntroFragment.kt | 2 -- anastasis-ui/src/main/java/org/gnu/anastasis/ui/MainViewModel.kt | 2 +- .../org/gnu/anastasis/ui/authentication/AuthenticationFragment.kt | 6 +++--- .../main/java/org/gnu/anastasis/ui/authentication/SmsFragment.kt | 4 ++-- .../src/main/java/org/gnu/anastasis/ui/identity/IdentityFragment.kt | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'anastasis-ui/src/main/java/org') 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 -- cgit v1.2.3