Merge "Shrink the nav buttons some" into oc-dr1-dev
This commit is contained in:
@@ -22,8 +22,10 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
systemui:keyCode="4"
|
||||
android:scaleType="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:contentDescription="@string/accessibility_back"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:paddingStart="@dimen/navigation_key_padding"
|
||||
android:paddingEnd="@dimen/navigation_key_padding"
|
||||
/>
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
systemui:keyCode="3"
|
||||
android:scaleType="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:contentDescription="@string/accessibility_home"
|
||||
android:paddingTop="13dp"
|
||||
android:paddingBottom="13dp"
|
||||
android:paddingStart="@dimen/navigation_key_padding"
|
||||
android:paddingEnd="@dimen/navigation_key_padding"
|
||||
/>
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
android:layout_width="@dimen/navigation_key_width"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0"
|
||||
android:scaleType="center"
|
||||
android:scaleType="fitCenter"
|
||||
android:contentDescription="@string/accessibility_recent"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:paddingStart="@dimen/navigation_key_padding"
|
||||
android:paddingEnd="@dimen/navigation_key_padding"
|
||||
/>
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.PluginListener;
|
||||
import com.android.systemui.plugins.PluginManager;
|
||||
import com.android.systemui.plugins.statusbar.phone.NavBarButtonProvider;
|
||||
import com.android.systemui.statusbar.phone.ReverseLinearLayout.ReverseFrameLayout;
|
||||
import com.android.systemui.statusbar.policy.KeyButtonView;
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
import com.android.systemui.tuner.TunerService.Tunable;
|
||||
@@ -285,7 +286,7 @@ public class NavigationBarInflaterView extends FrameLayout
|
||||
|
||||
if (sizeStr.contains(WEIGHT_SUFFIX)) {
|
||||
float weight = Float.parseFloat(sizeStr.substring(0, sizeStr.indexOf(WEIGHT_SUFFIX)));
|
||||
FrameLayout frame = new FrameLayout(mContext);
|
||||
FrameLayout frame = new ReverseFrameLayout(mContext);
|
||||
LayoutParams childParams = new LayoutParams(v.getLayoutParams());
|
||||
if (sizeStr.endsWith(WEIGHT_CENTERED_SUFFIX)) {
|
||||
childParams.gravity = Gravity.CENTER;
|
||||
|
||||
@@ -16,10 +16,10 @@ package com.android.systemui.statusbar.phone;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -48,7 +48,7 @@ public class ReverseLinearLayout extends LinearLayout {
|
||||
|
||||
@Override
|
||||
public void addView(View child) {
|
||||
reversParams(child.getLayoutParams());
|
||||
reverseParams(child.getLayoutParams(), child);
|
||||
if (mIsLayoutReverse) {
|
||||
super.addView(child, 0);
|
||||
} else {
|
||||
@@ -58,7 +58,7 @@ public class ReverseLinearLayout extends LinearLayout {
|
||||
|
||||
@Override
|
||||
public void addView(View child, ViewGroup.LayoutParams params) {
|
||||
reversParams(params);
|
||||
reverseParams(params, child);
|
||||
if (mIsLayoutReverse) {
|
||||
super.addView(child, 0, params);
|
||||
} else {
|
||||
@@ -100,7 +100,15 @@ public class ReverseLinearLayout extends LinearLayout {
|
||||
}
|
||||
}
|
||||
|
||||
private void reversParams(ViewGroup.LayoutParams params) {
|
||||
private static void reverseParams(ViewGroup.LayoutParams params, View child) {
|
||||
if (child instanceof Reversable) {
|
||||
((Reversable) child).reverse();
|
||||
}
|
||||
if (child.getPaddingLeft() == child.getPaddingRight()
|
||||
&& child.getPaddingTop() == child.getPaddingBottom()) {
|
||||
child.setPadding(child.getPaddingTop(), child.getPaddingLeft(),
|
||||
child.getPaddingTop(), child.getPaddingLeft());
|
||||
}
|
||||
if (params == null) {
|
||||
return;
|
||||
}
|
||||
@@ -109,4 +117,23 @@ public class ReverseLinearLayout extends LinearLayout {
|
||||
params.height = width;
|
||||
}
|
||||
|
||||
public interface Reversable {
|
||||
void reverse();
|
||||
}
|
||||
|
||||
public static class ReverseFrameLayout extends FrameLayout implements Reversable {
|
||||
|
||||
public ReverseFrameLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reverse() {
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View child = getChildAt(i);
|
||||
reverseParams(child.getLayoutParams(), child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user