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

Commit b42553dc authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Some minor additions (icons, sorting) to modes

Test: manually viewing pages
Flag: android.app.modes_ui
Fixes: 331429435
Fixes: 308819461
Bug: 322373473
Change-Id: I17e6df82e17a4cfadc2948258829746cdb5473db
parent 66b69fbb
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2024 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24.0dp"
        android:height="24.0dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0"
        android:tint="?android:attr/colorControlNormal">

    <path android:fillColor="@android:color/white"
          android:pathData="M17.0,12.0l-5.0,0.0l0.0,5.0l5.0,0.0l0.0,-5.0zM16.0,1.0l0.0,2.0L8.0,3.0L8.0,1.0L6.0,1.0l0.0,2.0L5.0,3.0c-1.11,0.0 -1.9,0.9 -1.99,2.0L3.0,19.0c0.0,1.0 0.89,2.0 2.0,2.0l14.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L21.0,5.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0l-1.0,0.0L18.0,1.0l-2.0,0.0zm3.0,18.0L5.0,19.0L5.0,8.0l14.0,0.0l0.0,11.0z"/>
</vector>
+26 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2024 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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24.0dp"
        android:height="24.0dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0"
        android:tint="?android:attr/colorControlNormal">

    <path android:fillColor="@android:color/white"
          android:pathData="M612,668L668,612L520,464L520,280L440,280L440,496L612,668ZM480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480ZM480,800Q613,800 706.5,706.5Q800,613 800,480Q800,347 706.5,253.5Q613,160 480,160Q347,160 253.5,253.5Q160,347 160,480Q160,613 253.5,706.5Q347,800 480,800Z"/>
</vector>
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  android:title="@string/zen_modes_list_title" >

    <!-- TODO: b/308819292 - implement page, delete this test preference -->
    <Preference
        android:key="zen_mode_test" />
    <com.android.settingslib.widget.LayoutPreference
            android:key="header"
            android:layout="@layout/settings_entity_header" />

</PreferenceScreen>
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -155,8 +155,8 @@ class ZenMode {
        int iconResIdFromType = switch (mRule.getType()) {
            case AutomaticZenRule.TYPE_UNKNOWN -> R.drawable.ic_do_not_disturb_on_24dp;
            case AutomaticZenRule.TYPE_OTHER -> R.drawable.ic_do_not_disturb_on_24dp;
            case AutomaticZenRule.TYPE_SCHEDULE_TIME -> R.drawable.ic_do_not_disturb_on_24dp;
            case AutomaticZenRule.TYPE_SCHEDULE_CALENDAR -> R.drawable.ic_do_not_disturb_on_24dp;
            case AutomaticZenRule.TYPE_SCHEDULE_TIME -> R.drawable.ic_modes_time;
            case AutomaticZenRule.TYPE_SCHEDULE_CALENDAR -> R.drawable.ic_modes_event;
            case AutomaticZenRule.TYPE_BEDTIME -> R.drawable.ic_do_not_disturb_on_24dp;
            case AutomaticZenRule.TYPE_DRIVING -> R.drawable.ic_do_not_disturb_on_24dp;
            case AutomaticZenRule.TYPE_IMMERSIVE -> R.drawable.ic_do_not_disturb_on_24dp;
+1 −13
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ public class ZenModeFragment extends ZenModeFragmentBase {
        // TODO: fill in with all the elements of this page. Each should be an instance of
        //       {@link AbstractZenModePreferenceController}.
        List<AbstractPreferenceController> prefControllers = new ArrayList<>();
        prefControllers.add(new ZenModeHeaderController(context, "header", this, mBackend));
        return prefControllers;
    }

@@ -55,19 +56,6 @@ public class ZenModeFragment extends ZenModeFragmentBase {
            return;
        }
        getActivity().setTitle(azr.getName());

        // TODO: b/308819292 - implement the real screen!
        final PreferenceScreen screen = getPreferenceScreen();
        if (screen == null) {
            return;
        }

        Preference tmpPref = screen.findPreference("zen_mode_test");
        if (tmpPref == null) {
            return;
        }
        tmpPref.setTitle(azr.getTriggerDescription());
        tmpPref.setSummary("active?: " + mode.isActive());
    }

    @Override
Loading