Loading libs/WindowManager/Shell/res/layout/desktop_header_maximize_menu_button_progress_indicator_layout.xml +2 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="44dp" android:layout_height="40dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:importantForAccessibility="noHideDescendants"> <ProgressBar android:id="@+id/progress_bar" Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt +25 −7 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co requireNotNull(backgroundDrawable) { "Background drawable must be non-null" } maximizeWindow.imageTintList = iconForegroundColor maximizeWindow.background = backgroundDrawable onProgressBarInflated { progressBar -> onProgressBarInflated { _, progressBar -> progressBar.progressTintList = ColorStateList.valueOf(baseForegroundColor).withAlpha(OPACITY_15) progressBar.progressBackgroundTintList = ColorStateList.valueOf(Color.TRANSPARENT) Loading Loading @@ -141,7 +141,7 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co R.color.desktop_mode_caption_button_color_selector_light, ) } onProgressBarInflated { progressBar -> progressBar.progressTintList = progressTint } onProgressBarInflated { _, progressBar -> progressBar.progressTintList = progressTint } maximizeWindow.background?.setTintList(backgroundTint) } } Loading @@ -153,13 +153,29 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co /** Sets the dimensions of the maximize button. */ fun setDimensions(width: Int, height: Int, padding: Rect) { this.layoutParams = this.layoutParams.apply { this.width = width this.height = height } maximizeWindow.layoutParams = maximizeWindow.layoutParams.apply { this.width = width this.height = height } maximizeWindow.setPadding(padding.left, padding.top, padding.right, padding.bottom) onProgressBarInflated { progressBar -> stubProgressBarContainer.layoutParams = stubProgressBarContainer.layoutParams.apply { this.width = width this.height = height } onProgressBarInflated { container, progressBar -> container.layoutParams = container.layoutParams.apply { this.width = width this.height = height } progressBar.layoutParams = progressBar.layoutParams.apply { this.width = width Loading @@ -168,11 +184,13 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co } } private fun onProgressBarInflated(onInflated: (ProgressBar) -> Unit) { private fun onProgressBarInflated( onInflated: (container: FrameLayout, progressBar: ProgressBar) -> Unit ) { stubProgressBarContainer.setOnInflateListener { _, inflated -> val progressBar = (inflated as FrameLayout).requireViewById<ProgressBar>(R.id.progress_bar) onInflated(progressBar) val container = inflated as FrameLayout val progressBar = container.requireViewById<ProgressBar>(R.id.progress_bar) onInflated(container, progressBar) } } Loading Loading
libs/WindowManager/Shell/res/layout/desktop_header_maximize_menu_button_progress_indicator_layout.xml +2 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="44dp" android:layout_height="40dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:importantForAccessibility="noHideDescendants"> <ProgressBar android:id="@+id/progress_bar" Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/MaximizeButtonView.kt +25 −7 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co requireNotNull(backgroundDrawable) { "Background drawable must be non-null" } maximizeWindow.imageTintList = iconForegroundColor maximizeWindow.background = backgroundDrawable onProgressBarInflated { progressBar -> onProgressBarInflated { _, progressBar -> progressBar.progressTintList = ColorStateList.valueOf(baseForegroundColor).withAlpha(OPACITY_15) progressBar.progressBackgroundTintList = ColorStateList.valueOf(Color.TRANSPARENT) Loading Loading @@ -141,7 +141,7 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co R.color.desktop_mode_caption_button_color_selector_light, ) } onProgressBarInflated { progressBar -> progressBar.progressTintList = progressTint } onProgressBarInflated { _, progressBar -> progressBar.progressTintList = progressTint } maximizeWindow.background?.setTintList(backgroundTint) } } Loading @@ -153,13 +153,29 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co /** Sets the dimensions of the maximize button. */ fun setDimensions(width: Int, height: Int, padding: Rect) { this.layoutParams = this.layoutParams.apply { this.width = width this.height = height } maximizeWindow.layoutParams = maximizeWindow.layoutParams.apply { this.width = width this.height = height } maximizeWindow.setPadding(padding.left, padding.top, padding.right, padding.bottom) onProgressBarInflated { progressBar -> stubProgressBarContainer.layoutParams = stubProgressBarContainer.layoutParams.apply { this.width = width this.height = height } onProgressBarInflated { container, progressBar -> container.layoutParams = container.layoutParams.apply { this.width = width this.height = height } progressBar.layoutParams = progressBar.layoutParams.apply { this.width = width Loading @@ -168,11 +184,13 @@ class MaximizeButtonView(context: Context, attrs: AttributeSet) : FrameLayout(co } } private fun onProgressBarInflated(onInflated: (ProgressBar) -> Unit) { private fun onProgressBarInflated( onInflated: (container: FrameLayout, progressBar: ProgressBar) -> Unit ) { stubProgressBarContainer.setOnInflateListener { _, inflated -> val progressBar = (inflated as FrameLayout).requireViewById<ProgressBar>(R.id.progress_bar) onInflated(progressBar) val container = inflated as FrameLayout val progressBar = container.requireViewById<ProgressBar>(R.id.progress_bar) onInflated(container, progressBar) } } Loading