-
Notifications
You must be signed in to change notification settings - Fork 428
AC-821 Fix Java and Kotlin deprecation warnings #938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
26df304
b9bb900
525c0e0
e062a95
47fbca6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,9 +11,11 @@ | |
| * | ||
| * Copyright (C) OpenMRS, LLC. All Rights Reserved. | ||
| */ | ||
| @file:Suppress("DEPRECATION") | ||
|
|
||
| package org.openmrs.mobile.activities.dashboard | ||
|
|
||
| import android.content.Intent | ||
| import android.annotation.SuppressLint | ||
| import android.graphics.Bitmap | ||
| import android.os.Bundle | ||
| import android.util.SparseArray | ||
|
|
@@ -31,7 +33,6 @@ import com.github.amlcurran.showcaseview.ShowcaseView | |
| import com.github.amlcurran.showcaseview.targets.Target | ||
| import com.github.amlcurran.showcaseview.targets.ViewTarget | ||
| import org.openmrs.mobile.R | ||
| import org.openmrs.mobile.activities.ACBaseActivity | ||
| import org.openmrs.mobile.activities.ACBaseFragment | ||
| import org.openmrs.mobile.databinding.FragmentDashboardBinding | ||
| import org.openmrs.mobile.utilities.ThemeUtils | ||
|
|
@@ -52,6 +53,7 @@ class DashboardFragment : ACBaseFragment<DashboardContract.Presenter>(), Dashboa | |
| private var mProviderManagementView: RelativeLayout? = null | ||
| private var mBitmapCache: SparseArray<Bitmap?>? = null | ||
|
|
||
| @SuppressLint("CommitPrefEdits") | ||
| override fun onActivityCreated(savedInstanceState: Bundle?) { | ||
| super.onActivityCreated(savedInstanceState) | ||
|
|
||
|
|
@@ -109,14 +111,12 @@ class DashboardFragment : ACBaseFragment<DashboardContract.Presenter>(), Dashboa | |
| } | ||
|
|
||
| override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
| savedInstanceState: Bundle?): View? { | ||
| savedInstanceState: Bundle?): View { | ||
|
|
||
| _binding = FragmentDashboardBinding.inflate(inflater, container, false) | ||
| val root = binding.root | ||
| if (root != null) { | ||
| initFragmentFields(binding) | ||
| setListeners() | ||
| } | ||
| initFragmentFields(binding) | ||
| setListeners() | ||
| return root | ||
| } | ||
|
|
||
|
|
@@ -193,14 +193,6 @@ class DashboardFragment : ACBaseFragment<DashboardContract.Presenter>(), Dashboa | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Starts new Activity depending on which ImageView triggered it | ||
| */ | ||
| private fun startNewActivity(clazz: Class<out ACBaseActivity?>) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Anshul-9923 As I can see, this PR is about fixing Java & Kotlin deprecation warnings but I see some deletions for the redundant code (which is not wrong). @LuGO0 Shouldn't a separate PR be opened for removing redundant code?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or better remove all the redundant code under this PR only? @LuGO0 |
||
| val intent = Intent(activity, clazz) | ||
| startActivity(intent) | ||
| } | ||
|
|
||
| override fun onClick(v: View) { | ||
| val directionToRegister = DashboardFragmentDirections.actionDashboardFragmentToAddEditPatientActivity() | ||
| val directionToFindPatent = DashboardFragmentDirections.actionDashboardFragmentToSyncedPatientsActivity() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ import com.openmrs.android_sdk.library.api.repository.ProviderRepository | |
| import org.openmrs.mobile.application.OpenMRS | ||
| import com.openmrs.android_sdk.library.listeners.retrofitcallbacks.DefaultResponseCallback | ||
|
|
||
| @Suppress("UNREACHABLE_CODE") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to suppress this warning. It can be resolved. |
||
| class FormAdmissionPresenter : BasePresenter, FormAdmissionContract.Presenter { | ||
| private var view: FormAdmissionContract.View | ||
| private var patientID: Long? = null | ||
|
|
@@ -60,7 +61,7 @@ class FormAdmissionPresenter : BasePresenter, FormAdmissionContract.Presenter { | |
| this.restApi = restApi | ||
| view.setPresenter(this) | ||
| mContext = context | ||
| providerRepository = ProviderRepository(restApi, logger); | ||
| providerRepository = ProviderRepository(restApi, logger) | ||
| } | ||
|
|
||
| override fun subscribe() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ import android.widget.EditText | |
| import com.openmrs.android_sdk.utilities.ApplicationConstants | ||
| import com.openmrs.android_sdk.utilities.StringUtils.notEmpty | ||
|
|
||
| @Suppress("UNREACHABLE_CODE") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this too. Can be resolved. |
||
| class PatientBirthdateValidatorWatcher(private val eddob: EditText, | ||
| private val edmonth: EditText, | ||
| private val edyr: EditText) : TextWatcher { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.