Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26083817 authored by Colin Cross's avatar Colin Cross
Browse files

Fix kotlin nullable errors in Launcher3

Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.

Bug: 294110802
Test: builds
Change-Id: I26edfec35dca14abe90b08e3c74de0446eda95d2
Merged-In: I26edfec35dca14abe90b08e3c74de0446eda95d2
parent 674b8d05
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -101,10 +101,10 @@ constructor(
    @SuppressLint("UseSwitchCompatOrMaterialCode")
    override fun onFinishInflate() {
        super.onFinishInflate()
        val taskbarSwitchOption = findViewById<LinearLayout>(R.id.taskbar_switch_option)
        val alwaysShowTaskbarSwitch = findViewById<Switch>(R.id.taskbar_pinning_switch)
        val taskbarSwitchOption = requireViewById<LinearLayout>(R.id.taskbar_switch_option)
        val alwaysShowTaskbarSwitch = requireViewById<Switch>(R.id.taskbar_pinning_switch)
        val navigationModeChangeOption =
            findViewById<LinearLayout>(R.id.navigation_mode_switch_option)
            requireViewById<LinearLayout>(R.id.navigation_mode_switch_option)
        alwaysShowTaskbarSwitch.isChecked = alwaysShowTaskbarOn
        taskbarSwitchOption.setOnClickListener {
            alwaysShowTaskbarSwitch.isClickable = true
+2 −2
Original line number Diff line number Diff line
@@ -97,8 +97,8 @@ constructor(
    override fun onFinishInflate() {
        super.onFinishInflate()

        content = findViewById(R.id.content)
        arrow = findViewById(R.id.arrow)
        content = requireViewById(R.id.content)
        arrow = requireViewById(R.id.arrow)
        arrow.background =
            RoundedArrowDrawable(
                arrowWidth,
+13 −13
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
        tooltipStep = TOOLTIP_STEP_FEATURES
        inflateTooltip(R.layout.taskbar_edu_swipe)
        tooltip?.run {
            findViewById<LottieAnimationView>(R.id.swipe_animation).supportLightTheme()
            requireViewById<LottieAnimationView>(R.id.swipe_animation).supportLightTheme()
            show()
        }
    }
@@ -112,10 +112,10 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
        tooltipStep = TOOLTIP_STEP_NONE
        inflateTooltip(R.layout.taskbar_edu_features)
        tooltip?.run {
            val splitscreenAnim = findViewById<LottieAnimationView>(R.id.splitscreen_animation)
            val suggestionsAnim = findViewById<LottieAnimationView>(R.id.suggestions_animation)
            val settingsAnim = findViewById<LottieAnimationView>(R.id.settings_animation)
            val settingsEdu = findViewById<View>(R.id.settings_edu)
            val splitscreenAnim = requireViewById<LottieAnimationView>(R.id.splitscreen_animation)
            val suggestionsAnim = requireViewById<LottieAnimationView>(R.id.suggestions_animation)
            val settingsAnim = requireViewById<LottieAnimationView>(R.id.settings_animation)
            val settingsEdu = requireViewById<View>(R.id.settings_edu)
            splitscreenAnim.supportLightTheme()
            suggestionsAnim.supportLightTheme()
            settingsAnim.supportLightTheme()
@@ -186,7 +186,7 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
    private fun createAccessibilityDelegate() =
        object : View.AccessibilityDelegate() {
            override fun performAccessibilityAction(
                host: View?,
                host: View,
                action: Int,
                args: Bundle?
            ): Boolean {
@@ -197,22 +197,22 @@ class TaskbarEduTooltipController(val activityContext: TaskbarActivityContext) :
                return super.performAccessibilityAction(host, action, args)
            }

            override fun onPopulateAccessibilityEvent(host: View?, event: AccessibilityEvent?) {
            override fun onPopulateAccessibilityEvent(host: View, event: AccessibilityEvent) {
                super.onPopulateAccessibilityEvent(host, event)
                if (event?.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
                    event.text?.add(host?.context?.getText(R.string.taskbar_edu_a11y_title))
                if (event.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
                    event.text.add(host.context?.getText(R.string.taskbar_edu_a11y_title))
                }
            }

            override fun onInitializeAccessibilityNodeInfo(
                host: View?,
                info: AccessibilityNodeInfo?
                host: View,
                info: AccessibilityNodeInfo
            ) {
                super.onInitializeAccessibilityNodeInfo(host, info)
                info?.addAction(
                info.addAction(
                    AccessibilityNodeInfo.AccessibilityAction(
                        R.id.close,
                        host?.context?.getText(R.string.taskbar_edu_close)
                        host.context?.getText(R.string.taskbar_edu_close)
                    )
                )
            }
+2 −2
Original line number Diff line number Diff line
@@ -192,13 +192,13 @@ class VoiceInteractionWindowController(val context: TaskbarActivityContext) :
        removeOnAttachStateChangeListener(pendingAttachedToWindowListener)
        pendingAttachedToWindowListener =
            object : View.OnAttachStateChangeListener {
                override fun onViewAttachedToWindow(v: View?) {
                override fun onViewAttachedToWindow(v: View) {
                    onAttachedToWindow()
                    removeOnAttachStateChangeListener(this)
                    pendingAttachedToWindowListener = null
                }

                override fun onViewDetachedFromWindow(v: View?) {}
                override fun onViewDetachedFromWindow(v: View) {}
            }
        addOnAttachStateChangeListener(pendingAttachedToWindowListener)
    }
+3 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ abstract class AbstractNavButtonLayoutter(
    protected val endContextualContainer: ViewGroup,
    protected val startContextualContainer: ViewGroup
) : NavButtonLayoutter {
    protected val homeButton: ImageView = navButtonContainer.findViewById(R.id.home)
    protected val recentsButton: ImageView = navButtonContainer.findViewById(R.id.recent_apps)
    protected val backButton: ImageView = navButtonContainer.findViewById(R.id.back)
    protected val homeButton: ImageView = navButtonContainer.requireViewById(R.id.home)
    protected val recentsButton: ImageView = navButtonContainer.requireViewById(R.id.recent_apps)
    protected val backButton: ImageView = navButtonContainer.requireViewById(R.id.back)
}
Loading