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

Commit bf11c2fa authored by Danesh Mondegarian's avatar Danesh Mondegarian
Browse files

PowerWidget : Indicator observer / Hide onLongClick

Register an observer for indicator visibility.
Collapse statusbar on longClick of buttons
Remove highlight

Change-Id: I334446ca3328aeb25c50fe25f65be5a341c7318b
parent f35dbb8a
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true"
        android:drawable="@drawable/stat_inner_press" />

    <item android:state_focused="true" android:state_enabled="true"
        android:state_window_focused="true"
        android:drawable="@drawable/stat_inner_focus" />

    <item
         android:drawable="@drawable/stat_power_background" />
</selector>
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
        android:orientation="vertical"
        android:clickable="true"
        android:focusable="true"
        android:background="@drawable/stat_power_bg">
        android:background="@drawable/stat_power_background">
    <ImageView android:id="@+id/power_widget_button_image"
           android:layout_width="match_parent"
            android:layout_height="0dip"
+6 −1
Original line number Diff line number Diff line
@@ -348,7 +348,12 @@ public class PhoneStatusBar extends StatusBar {
                        }
                    }
                });

        mPowerWidget.setGlobalButtonOnLongClickListener(new View.OnLongClickListener() {
            public boolean onLongClick(View v) {
                animateCollapse();
                return true;
            }
        });

        mTicker = new MyTicker(context, sb);

+5 −0
Original line number Diff line number Diff line
@@ -266,6 +266,11 @@ public class PowerWidget extends FrameLayout {
                    Settings.System.getUriFor(Settings.System.EXPANDED_VIEW_WIDGET_COLOR),
                            false, this);

            // watch for changes in indicator visibility
            resolver.registerContentObserver(
                    Settings.System.getUriFor(Settings.System.EXPANDED_HIDE_INDICATOR),
                            false, this);

            // watch for power-button specifc stuff that has been loaded
            for(Uri uri : PowerButton.getAllObservedUris()) {
                resolver.registerContentObserver(uri, false, this);