Skip to content

Commit d199f13

Browse files
committed
Backport transparent QsbConnector
1 parent 0664e5e commit d199f13

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
<gradient
5+
android:startColor="@android:color/transparent"
6+
android:endColor="@color/qsb_connector_gradient_end_color"
7+
android:angle="0.0"
8+
android:right="@dimen/qsb_connector_gradient_end_padding" />
9+
</shape>

res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@
5858

5959
<color name="qsb_connector">#fff2f2f2</color>
6060
<color name="qsb_background">#ffffffff</color>
61+
<color name="qsb_connector_gradient_end_color">#66ffffff</color>
6162
</resources>

res/values/dimens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,5 @@
224224
<dimen name="qsb_touch_extension">20.0dip</dimen>
225225
<dimen name="qsb_shadow_blur_radius">1.0dip</dimen>
226226
<dimen name="qsb_key_shadow_offset">1.0dip</dimen>
227+
<dimen name="qsb_connector_gradient_end_padding">20.0dip</dimen>
227228
</resources>

src/com/android/launcher3/pixel/QsbConnector.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,7 @@ private void stopRevealAnimation() {
5656
}
5757

5858
private void retrieveGoogleQsbBackground() {
59-
Drawable drawable = null;
60-
try {
61-
final Context context = this.getContext();
62-
final Resources resourcesForApplication = context.getPackageManager().getResourcesForApplication("com.google.android.googlequicksearchbox");
63-
final int identifier = resourcesForApplication.getIdentifier("bg_pixel_qsb_connector", "drawable", "com.google.android.googlequicksearchbox");
64-
if (identifier == 0) {
65-
return;
66-
}
67-
final Context context2 = this.getContext();
68-
try {
69-
drawable = resourcesForApplication.getDrawable(identifier, context2.getTheme());
70-
if (drawable == null) {
71-
this.setBackgroundResource(R.color.qsb_connector);
72-
return;
73-
}
74-
}
75-
catch (Exception ex) {
76-
Log.d("QsbConnector", "Error loading connector background", ex);
77-
}
78-
}
79-
catch (Exception ex3) {}
80-
this.setBackground(drawable);
59+
this.setBackground(getResources().getDrawable(R.drawable.bg_pixel_qsb_connector, getContext().getTheme()));
8160
}
8261

8362
private void updateAlpha(final int m) {

0 commit comments

Comments
 (0)