Skip to content

Commit d1a7ca6

Browse files
BAProductionsSirRGB
authored andcommitted
Trebuchet: Rework hot-seat.
* Make the hot-seat pop with a semi transparent background that look like its floating.
1 parent 4f319d9 commit d1a7ca6

File tree

7 files changed

+82
-2
lines changed

7 files changed

+82
-2
lines changed

res/color/hots_seat_bg.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2017 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
17+
<item android:color="@color/hot_seat_bg_color" android:alpha="?android:attr/disabledAlpha" />
18+
</selector>

res/drawable/bg_hot_seat.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
**
5+
** Copyright 2015, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
21+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
22+
<item
23+
android:left="@dimen/dynamic_grid_hotseat_bg_padding"
24+
android:right="@dimen/dynamic_grid_hotseat_bg_padding"
25+
android:top="@@dimen/dynamic_grid_hotseat_bg_padding"
26+
android:bottom="@@dimen/dynamic_grid_hotseat_bg_padding">
27+
<shape android:shape="rectangle">
28+
<solid android:color="@color/hots_seat_bg" />
29+
<strock android:width="5dp"
30+
android:color="@color/hot_seat_border_color" />
31+
<corners android:radius="@*android:dimen/config_dialogCornerRadius"/>
32+
</shape>
33+
</item>
34+
</layer-list>

res/layout/hotseat.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
xmlns:android="http://schemas.android.com/apk/res/android"
1818
xmlns:launcher="http://schemas.android.com/apk/res-auto"
1919
android:id="@+id/hotseat"
20-
android:layout_width="match_parent"
20+
android:layout_width="wrap_content"
2121
android:layout_height="match_parent"
22+
android:background="@drawable/bg_hot_seat"
2223
android:theme="@style/HomeScreenElementTheme"
2324
android:importantForAccessibility="no"
24-
launcher:containerType="hotseat" />
25+
launcher:containerType="hotseat" />

res/layout/launcher.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
<!-- DO NOT CHANGE THE ID -->
4242
<include
43+
android:layout_width="wrap_content"
4344
android:id="@+id/hotseat"
4445
layout="@layout/hotseat" />
4546

res/values-night-v26/color.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/* //device/apps/common/assets/res/any/colors.xml
4+
**
5+
** Copyright 2008, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
<resources>
21+
<color name="hot_seat_bg_color">#212121</color>
22+
<color name="hot_seat_border_color">#63656a</color>
23+
</resources>

res/values/colors.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@
3737

3838
<color name="all_apps_bg_hand_fill">#E5E5E5</color>
3939
<color name="all_apps_bg_hand_fill_dark">#9AA0A6</color>
40+
<color name="hot_seat_bg_color">#63656a</color>
41+
<color name="hot_seat_border_color">#212121</color>
4042
</resources>

res/values/dimens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<!-- Hotseat -->
3232
<dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen>
3333
<dimen name="dynamic_grid_hotseat_bottom_padding">2dp</dimen>
34+
<dimen name="dynamic_grid_hotseat_bg_padding">14dp</dimen>
3435
<!-- Extra bottom padding for non-tall devices. -->
3536
<dimen name="dynamic_grid_hotseat_bottom_non_tall_padding">0dp</dimen>
3637
<dimen name="dynamic_grid_hotseat_extra_vertical_size">34dp</dimen>

0 commit comments

Comments
 (0)