Reodering some drawables

> quantum_panel_shape is xml rectangle with no margin
  > quantum_panel_bitmap is 9-patch drawable with inbuild shadow and margin
  > quantum_panel uses xml-shape for lollipop and 9-patch image for lower
    devices. It includes margin. For shadow, use elevation on lollipop
  > All drawables have _dark variant
  > Using #f5f5f5 for panel background, instead of #ffffff

Change-Id: Ia7c6cea6d514ee3774fcf5fef6139650bdd53208
This commit is contained in:
Sunny Goyal
2015-05-13 13:06:11 -07:00
parent db1360dbbb
commit 5a92b2356f
32 changed files with 103 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/quantum_panel_shape"
android:insetBottom="@dimen/quantum_panel_outer_padding"
android:insetLeft="@dimen/quantum_panel_outer_padding"
android:insetRight="@dimen/quantum_panel_outer_padding"
android:insetTop="@dimen/quantum_panel_outer_padding" />

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/quantum_panel_shape_dark"
android:insetBottom="@dimen/quantum_panel_outer_padding"
android:insetLeft="@dimen/quantum_panel_outer_padding"
android:insetRight="@dimen/quantum_panel_outer_padding"
android:insetTop="@dimen/quantum_panel_outer_padding" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -16,7 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<solid android:color="@color/quantum_panel_bg_color" />
<corners
android:bottomLeftRadius="2dp"
android:bottomRightRadius="2dp" />

View File

@@ -16,7 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<solid android:color="@color/quantum_panel_bg_color" />
<corners
android:topLeftRadius="2dp"
android:topRightRadius="2dp" />

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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.
-->
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/quantum_panel_bitmap" />

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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.
-->
<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/quantum_panel_dark_bitmap" />

View File

@@ -16,7 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<solid android:color="@color/quantum_panel_bg_color" />
<corners
android:radius="2dp" />
</shape>

View File

@@ -16,6 +16,7 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<corners android:radius="2dp" />
<solid android:color="@color/quantum_panel_bg_color_dark" />
<corners
android:radius="2dp" />
</shape>

View File

@@ -14,11 +14,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<com.android.launcher3.Folder xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/quantum_panel"
android:elevation="5dp"
android:orientation="vertical" >

View File

@@ -30,15 +30,17 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:visibility="invisible"
android:focusable="false" />
android:elevation="15dp"
android:focusable="false"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/widgets_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:orientation="vertical">
android:elevation="15dp"
android:orientation="vertical" >
<com.android.launcher3.widget.WidgetsContainerRecyclerView
android:id="@+id/widgets_list_view"

View File

@@ -32,6 +32,9 @@
<color name="workspace_icon_text_color">#FFF</color>
<color name="quantum_panel_text_color">#FF666666</color>
<color name="quantum_panel_bg_color">#FFF5F5F5</color>
<color name="quantum_panel_bg_color_dark">#FF243036</color>
<color name="outline_color">#FFFFFFFF</color>
<color name="widget_text_panel">#FF374248</color>
@@ -39,7 +42,7 @@
<color name="apps_view_scrollbar_thumb_color">#009688</color>
<color name="apps_view_section_text_color">#009688</color>
<!-- Widgetss view -->
<!-- Widgets view -->
<color name="widgets_view_section_text_color">#FFFFFF</color>
<color name="widgets_view_item_text_color">#C4C4C4</color>
<color name="widgets_cell_color">#263238</color>

View File

@@ -103,11 +103,13 @@
<dimen name="shortcut_preview_padding_right">0dp</dimen>
<dimen name="shortcut_preview_padding_top">0dp</dimen>
<!-- Theme -->
<dimen name="quantum_panel_outer_padding">4dp</dimen>
<!-- Folders -->
<!-- The amount that the preview contents are inset from the preview background -->
<dimen name="folder_preview_padding">4dp</dimen>
<dimen name="folder_name_padding">10dp</dimen>
<dimen name="folder_shadow_padding">8dp</dimen>
<!-- Sizes for managed profile badges -->
<dimen name="profile_badge_size">24dp</dimen>

View File

@@ -35,6 +35,7 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.android.launcher3.util.Thunk;
import java.util.List;
@@ -380,12 +381,13 @@ public class AppsContainerView extends BaseContainerView implements DragSource,
// Update the background of the reveal view and list to be inset with the fixed bound
// insets instead of the default insets
// TODO: Use quantum_panel instead of quantum_panel_shape.
mAppsRecyclerView.setBackground(new InsetDrawable(
getContext().getResources().getDrawable(
hasSearchBar ? R.drawable.apps_list_search_bg : R.drawable.apps_list_bg),
hasSearchBar ? R.drawable.apps_list_search_bg : R.drawable.quantum_panel_shape),
inset, 0, inset, 0));
getRevealView().setBackground(new InsetDrawable(
getContext().getResources().getDrawable(R.drawable.apps_reveal_bg),
getContext().getResources().getDrawable(R.drawable.quantum_panel_shape),
inset, 0, inset, 0));
}

View File

@@ -27,7 +27,6 @@ import android.content.res.Resources;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.InsetDrawable;
import android.os.Build;
import android.text.InputType;
import android.text.Selection;
@@ -183,15 +182,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
// name is complete, we have something to focus on, thus hiding the cursor and giving
// reliable behavior when clicking the text field (since it will always gain focus on click).
setFocusableInTouchMode(true);
if (Utilities.isLmpOrAbove()) {
int padding = getResources().getDimensionPixelSize(R.dimen.folder_shadow_padding);
setBackground(new InsetDrawable(
getResources().getDrawable(R.drawable.apps_list_bg),
padding, padding, padding, padding));
} else {
setBackgroundResource(R.drawable.quantum_panel);
}
}
@Override