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

Commit be8407c5 authored by mxyyiyi's avatar mxyyiyi Committed by Xinyi Mao
Browse files

Implement the battery tips cards.(1/2)

- Implement a tips card UI in Battery Usage.

[Screenshot]:
- Tips Card with thumbs-up/down feedback in dark mode
https://screenshot.googleplex.com/3nRCFYvLTWfiYYT
- Tips Card without feedback
https://screenshot.googleplex.com/B7QGRJZAHzgWpCP
- Tips Card in Force RTL layout
https://screenshot.googleplex.com/8crQdj8ao26pKpH
- Tips Card in light mode
https://screenshot.googleplex.com/885aVvZm8xmhK2S

[TODO]:
- Add accessibility
- Localization

Bug: 291689623
Test: Manual
Change-Id: I4443cdb21b3ba30900fc2f6fcc21c4c56dc1293f
Merged-In: I4443cdb21b3ba30900fc2f6fcc21c4c56dc1293f
parent 99d99c1e
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2023 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/settingslib_dialog_background" />
    <corners android:radius="@dimen/battery_tips_card_corner_radius_normal" />
</shape>
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2023 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/settingslib_dialog_background"/>
    <corners
        android:topLeftRadius="@dimen/battery_tips_card_corner_radius_small"
        android:topRightRadius="@dimen/battery_tips_card_corner_radius_small"
        android:bottomLeftRadius="@dimen/battery_tips_card_corner_radius_normal"
        android:bottomRightRadius="@dimen/battery_tips_card_corner_radius_normal"
        />
</shape>
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2023 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/settingslib_dialog_background"/>
    <corners
        android:topLeftRadius="@dimen/battery_tips_card_corner_radius_normal"
        android:topRightRadius="@dimen/battery_tips_card_corner_radius_normal"
        android:bottomLeftRadius="@dimen/battery_tips_card_corner_radius_small"
        android:bottomRightRadius="@dimen/battery_tips_card_corner_radius_small"
        />
</shape>
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
<!--
  Copyright (C) 2023 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="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="?android:attr/textColorSecondary"
        android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12 19,6.41z"/>
</vector>
+32 −0
Original line number Diff line number Diff line
<!--
  Copyright (C) 2023 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.
  -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp">
    <item>
        <shape android:shape="oval">
            <size
                android:width="24dp"
                android:height="24dp" />
            <solid android:color="?android:attr/colorBackground" />
        </shape>
    </item>
    <item android:drawable="@drawable/ic_battery_tips_close"
        android:gravity="center"
        android:width="16dp"
        android:height="16dp"/>
</layer-list>
 No newline at end of file
Loading