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

Commit 50f3e9cc authored by Caitlin Cassidy's avatar Caitlin Cassidy
Browse files

[Dagger] Add BatteryMeterViewController. Future CLs will move

Dependency.get calls from BatteryMeterView to this controller.

BatteryMeterView is used in QuickStatusBarHeader, KeyguardStatusBarView,
PhoneStatusBarView, and SplitShadeHeaderController, so
BatteryMeterViewController is added to the
controllers for those views.

Bug: 138786270
Test: atest and manual
Change-Id: I4d23a32d4ecda4f4327552b3703e9893ad544bdb
Merged-In: I4d23a32d4ecda4f4327552b3703e9893ad544bdb
parent 876cf97c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -76,7 +76,7 @@
            android:layout_height="match_parent"
            android:layout_height="match_parent"
            android:paddingEnd="@dimen/signal_cluster_battery_padding" />
            android:paddingEnd="@dimen/signal_cluster_battery_padding" />


        <com.android.systemui.BatteryMeterView
        <com.android.systemui.battery.BatteryMeterView
            android:id="@+id/batteryRemainingIcon"
            android:id="@+id/batteryRemainingIcon"
            android:layout_height="match_parent"
            android:layout_height="match_parent"
            android:layout_width="0dp"
            android:layout_width="0dp"
+1 −1
Original line number Original line Diff line number Diff line
@@ -78,7 +78,7 @@
                android:layout_height="match_parent"
                android:layout_height="match_parent"
                android:paddingEnd="@dimen/signal_cluster_battery_padding" />
                android:paddingEnd="@dimen/signal_cluster_battery_padding" />


            <com.android.systemui.BatteryMeterView
            <com.android.systemui.battery.BatteryMeterView
                android:id="@+id/batteryRemainingIcon"
                android:id="@+id/batteryRemainingIcon"
                android:layout_width="wrap_content"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_height="match_parent"
+1 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@
        android:gravity="center_vertical"
        android:gravity="center_vertical"
        android:orientation="horizontal"/>
        android:orientation="horizontal"/>


    <com.android.systemui.BatteryMeterView android:id="@+id/battery"
    <com.android.systemui.battery.BatteryMeterView android:id="@+id/battery"
        android:layout_height="match_parent"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:clipToPadding="false"
        android:clipToPadding="false"
+8 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.keyguard.dagger;


import com.android.keyguard.CarrierText;
import com.android.keyguard.CarrierText;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.battery.BatteryMeterView;
import com.android.systemui.statusbar.phone.KeyguardStatusBarView;
import com.android.systemui.statusbar.phone.KeyguardStatusBarView;


import dagger.Module;
import dagger.Module;
@@ -31,4 +32,11 @@ public abstract class KeyguardStatusBarViewModule {
    static CarrierText getCarrierText(KeyguardStatusBarView view) {
    static CarrierText getCarrierText(KeyguardStatusBarView view) {
        return view.findViewById(R.id.keyguard_carrier_text);
        return view.findViewById(R.id.keyguard_carrier_text);
    }
    }

    /** */
    @Provides
    @KeyguardStatusBarViewScope
    static BatteryMeterView getBatteryMeterView(KeyguardStatusBarView view) {
        return view.findViewById(R.id.battery);
    }
}
}
+5 −2
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (C) 2013 The Android Open Source Project
 * Copyright (C) 2021 The Android Open Source Project
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * limitations under the License.
 */
 */
package com.android.systemui;
package com.android.systemui.battery;


import static android.provider.Settings.System.SHOW_BATTERY_PERCENT;
import static android.provider.Settings.System.SHOW_BATTERY_PERCENT;


@@ -50,6 +50,9 @@ import android.widget.TextView;
import androidx.annotation.StyleRes;
import androidx.annotation.StyleRes;


import com.android.settingslib.graph.ThemedBatteryDrawable;
import com.android.settingslib.graph.ThemedBatteryDrawable;
import com.android.systemui.Dependency;
import com.android.systemui.DualToneHandler;
import com.android.systemui.R;
import com.android.systemui.animation.Interpolators;
import com.android.systemui.animation.Interpolators;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.plugins.DarkIconDispatcher;
import com.android.systemui.plugins.DarkIconDispatcher;
Loading