Replace Contextual Rotation Button with Floating Action Button
When foldable is in 3 button, the rotation button is covered by the device’s camera cutout upon rotation. This CL replaces Contextual Rotation Button with Floating Action Button for taskbar and navbar. Flag: NONE Test: Manually tested on Felix & panther. Bug: 324070001 Change-Id: I8bd9acdeec8ade4c8183c42056bf67b1c825906c
This commit is contained in:
1 parent
1f2dabfb4e
commit
1187fd817e
11 files changed
+220
-239
No files matched your search
+22
-17
@@ -27,7 +27,6 @@ import android.widget.Space
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter
|
||||
import com.android.systemui.shared.rotation.RotationButton
|
||||
|
||||
/**
|
||||
* Meant to be a simple container for data subclasses will need
|
||||
@@ -41,14 +40,13 @@ import com.android.systemui.shared.rotation.RotationButton
|
||||
* @property startContextualContainer ViewGroup that holds the start contextual button (ex, A11y).
|
||||
*/
|
||||
abstract class AbstractNavButtonLayoutter(
|
||||
val resources: Resources,
|
||||
val navButtonContainer: LinearLayout,
|
||||
protected val endContextualContainer: ViewGroup,
|
||||
protected val startContextualContainer: ViewGroup,
|
||||
protected val imeSwitcher: ImageView?,
|
||||
protected val rotationButton: RotationButton?,
|
||||
protected val a11yButton: ImageView?,
|
||||
protected val space: Space?
|
||||
val resources: Resources,
|
||||
val navButtonContainer: LinearLayout,
|
||||
protected val endContextualContainer: ViewGroup,
|
||||
protected val startContextualContainer: ViewGroup,
|
||||
protected val imeSwitcher: ImageView?,
|
||||
protected val a11yButton: ImageView?,
|
||||
protected val space: Space?
|
||||
) : NavButtonLayoutter {
|
||||
protected val homeButton: ImageView? = navButtonContainer.findViewById(R.id.home)
|
||||
protected val recentsButton: ImageView? = navButtonContainer.findViewById(R.id.recent_apps)
|
||||
@@ -66,17 +64,24 @@ abstract class AbstractNavButtonLayoutter(
|
||||
}
|
||||
|
||||
fun getParamsToCenterView(): FrameLayout.LayoutParams {
|
||||
val params = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
|
||||
val params =
|
||||
FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
params.gravity = Gravity.CENTER
|
||||
return params;
|
||||
return params
|
||||
}
|
||||
|
||||
open fun repositionContextualContainer(contextualContainer: ViewGroup, buttonSize: Int,
|
||||
barAxisMarginStart: Int, barAxisMarginEnd: Int,
|
||||
gravity: Int) {
|
||||
val contextualContainerParams = FrameLayout.LayoutParams(
|
||||
buttonSize, ViewGroup.LayoutParams.MATCH_PARENT)
|
||||
open fun repositionContextualContainer(
|
||||
contextualContainer: ViewGroup,
|
||||
buttonSize: Int,
|
||||
barAxisMarginStart: Int,
|
||||
barAxisMarginEnd: Int,
|
||||
gravity: Int
|
||||
) {
|
||||
val contextualContainerParams =
|
||||
FrameLayout.LayoutParams(buttonSize, ViewGroup.LayoutParams.MATCH_PARENT)
|
||||
contextualContainerParams.apply {
|
||||
marginStart = barAxisMarginStart
|
||||
marginEnd = barAxisMarginEnd
|
||||
|
||||
Reference in new issue
Block a user