Skip to content
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

refactor: Hungarian Notation rename #16818

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions AnkiDroid/src/main/java/com/ichi2/widget/AnkiDroidWidgetSmall.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class AnkiDroidWidgetSmall : AnalyticsWidgetProvider() {
updateViews.setViewVisibility(R.id.widget_due, View.INVISIBLE)
updateViews.setViewVisibility(R.id.widget_eta, View.INVISIBLE)
updateViews.setViewVisibility(R.id.ankidroid_widget_small_finish_layout, View.GONE)
if (mMountReceiver == null) {
mMountReceiver = object : BroadcastReceiver() {
if (mountReceiver == null) {
mountReceiver = object : BroadcastReceiver() {
@KotlinCleanup("Change parameter context name below, should not be used")
override fun onReceive(context: Context, intent: Intent) {
// baseContext() is null, applicationContext() throws a NPE,
Expand All @@ -109,8 +109,8 @@ class AnkiDroidWidgetSmall : AnalyticsWidgetProvider() {
if (remounted) {
WidgetStatus.updateInBackground(AnkiDroidApp.instance)
remounted = false
if (mMountReceiver != null) {
AnkiDroidApp.instance.unregisterReceiver(mMountReceiver)
if (mountReceiver != null) {
AnkiDroidApp.instance.unregisterReceiver(mountReceiver)
}
} else {
remounted = true
Expand All @@ -121,7 +121,7 @@ class AnkiDroidWidgetSmall : AnalyticsWidgetProvider() {
val iFilter = IntentFilter()
iFilter.addAction(Intent.ACTION_MEDIA_MOUNTED)
iFilter.addDataScheme("file")
AnkiDroidApp.instance.registerReceiverCompat(mMountReceiver, iFilter, ContextCompat.RECEIVER_EXPORTED)
AnkiDroidApp.instance.registerReceiverCompat(mountReceiver, iFilter, ContextCompat.RECEIVER_EXPORTED)
}
} else {
// If we do not have a cached version, always update.
Expand Down Expand Up @@ -178,7 +178,7 @@ class AnkiDroidWidgetSmall : AnalyticsWidgetProvider() {
}

companion object {
private var mMountReceiver: BroadcastReceiver? = null
private var mountReceiver: BroadcastReceiver? = null
private var remounted = false
private fun updateWidgetDimensions(context: Context, updateViews: RemoteViews, cls: Class<*>) {
val manager = getAppWidgetManager(context) ?: return
Expand Down