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

Commit 0dc24bb7 authored by Anthony Chen's avatar Anthony Chen Committed by Android (Google) Code Review
Browse files

Merge "Move hard-coded dimens to dimens.xml."

parents c080f112 55e8e1ee
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@
    </FrameLayout>
    <View
        android:id="@+id/wifi_signal_spacer"
        android:layout_width="4dp"
        android:layout_width="@dimen/status_bar_wifi_signal_spacer_width"
        android:layout_height="4dp"
        android:visibility="gone"
        />
@@ -112,7 +112,7 @@
    </FrameLayout>
    <View
        android:id="@+id/wifi_airplane_spacer"
        android:layout_width="4dp"
        android:layout_width="@dimen/status_bar_airplane_spacer_width"
        android:layout_height="4dp"
        android:visibility="gone"
        />
+2 −1
Original line number Diff line number Diff line
@@ -70,7 +70,8 @@
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:singleLine="true"
                android:paddingStart="7dp"
                android:paddingStart="@dimen/status_bar_clock_starting_padding"
                android:paddingEnd="@dimen/status_bar_clock_end_padding"
                android:gravity="center_vertical|start"
                />
        </com.android.keyguard.AlphaOptimizedLinearLayout>
+3 −3
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@
        android:id="@+id/signal_cluster"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="2.5dp"/>
        android:layout_marginStart="@dimen/signal_cluster_margin_start"/>

    <!-- battery must be padded below to match assets -->
    <com.android.systemui.BatteryMeterView android:id="@+id/battery"
        android:layout_height="14.5dp"
        android:layout_width="9.5dp"
        android:layout_height="@dimen/status_bar_battery_icon_height"
        android:layout_width="@dimen/status_bar_battery_icon_width"
        android:layout_marginBottom="@dimen/battery_margin_bottom"/>
</LinearLayout>
 No newline at end of file
+25 −1
Original line number Diff line number Diff line
@@ -33,9 +33,30 @@
    <!-- Height of notification icons in the status bar -->
    <dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>

    <!-- The font size for the clock -->
    <!-- Height of the battery icon in the status bar. -->
    <dimen name="status_bar_battery_icon_height">14.5dp</dimen>

    <!-- Width of the battery icon in the status bar. -->
    <dimen name="status_bar_battery_icon_width">9.5dp</dimen>

    <!-- The font size for the clock in the status bar. -->
    <dimen name="status_bar_clock_size">14sp</dimen>

    <!-- The starting padding for the clock in the status bar. -->
    <dimen name="status_bar_clock_starting_padding">7dp</dimen>

    <!-- The end padding for the clock in the status bar. -->
    <dimen name="status_bar_clock_end_padding">0dp</dimen>

    <!-- Spacing after the wifi signals that is present if there are any icons following it. -->
    <dimen name="status_bar_wifi_signal_spacer_width">4dp</dimen>

    <!-- Spacing before the airplane mode icon if there are any icons preceding it. -->
    <dimen name="status_bar_airplane_spacer_width">4dp</dimen>

    <!-- The amount to scale each of the status bar icons by. A value of 1 means no scaling. -->
    <item name="status_bar_icon_scale_factor" format="float" type="dimen">1.0</item>

    <!-- Height of a small notification in the status bar-->
    <dimen name="notification_min_height">84dp</dimen>

@@ -516,6 +537,9 @@

    <dimen name="fake_shadow_size">8dp</dimen>

    <!-- Starting margin before the signal cluster -->
    <dimen name="signal_cluster_margin_start">2.5dp</dimen>

    <!-- Padding between signal cluster and battery icon -->
    <dimen name="signal_cluster_battery_padding">7dp</dimen>

+43 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar;

import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableWrapper;

/**
 * An extension of {@link DrawableWrapper} that will take a given Drawable and scale it by
 * the given factor.
 */
class ScalingDrawableWrapper extends DrawableWrapper {
    private float mScaleFactor;

    public ScalingDrawableWrapper(Drawable drawable, float scaleFactor) {
        super(drawable);
        mScaleFactor = scaleFactor;
    }

    @Override
    public int getIntrinsicWidth() {
        return (int) (super.getIntrinsicWidth() * mScaleFactor);
    }

    @Override
    public int getIntrinsicHeight() {
        return (int) (super.getIntrinsicHeight() * mScaleFactor);
    }
}
Loading