Merge "Fix some bugs in widget pickers." into sc-dev
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
**
|
||||||
|
** Copyright 2021, 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<selector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="?android:attr/colorAccent" />
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
**
|
||||||
|
** Copyright 2021, 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<selector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="@android:color/white" />
|
||||||
|
</selector>
|
||||||
@@ -14,6 +14,6 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
<solid android:color="?android:attr/colorAccent" />
|
<solid android:color="@color/arrow_tip_view_bg" />
|
||||||
<corners android:radius="8dp" />
|
<corners android:radius="8dp" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -14,6 +14,6 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
<solid android:color="?android:attr/textColorPrimaryInverse" />
|
<solid android:color="@color/widgets_picker_surface" />
|
||||||
<corners android:radius="24dp" />
|
<corners android:radius="24dp" />
|
||||||
</shape>
|
</shape>
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
style="@style/Widget.DeviceDefault.Button.Rounded.Colored"
|
style="@style/Widget.DeviceDefault.Button.Rounded.Colored"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
android:onClick="onCancelClick"
|
android:onClick="onCancelClick"
|
||||||
android:text="@android:string/cancel" />
|
android:text="@android:string/cancel" />
|
||||||
|
|
||||||
@@ -64,7 +65,8 @@
|
|||||||
style="@style/Widget.DeviceDefault.Button.Rounded.Colored"
|
style="@style/Widget.DeviceDefault.Button.Rounded.Colored"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingHorizontal="16dp"
|
||||||
android:onClick="onPlaceAutomaticallyClick"
|
android:onClick="onPlaceAutomaticallyClick"
|
||||||
android:text="@string/place_automatically" />
|
android:text="@string/add_to_home_screen" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<merge
|
<merge
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content">
|
android:layout_width="wrap_content">
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@color/arrow_tip_view_content"
|
||||||
android:textSize="16sp"/>
|
android:textSize="16sp"/>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/dismiss"
|
android:id="@+id/dismiss"
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:alpha="0.7"
|
android:alpha="0.7"
|
||||||
android:src="@drawable/ic_remove_no_shadow"
|
android:src="@drawable/ic_remove_no_shadow"
|
||||||
android:tint="@android:color/white"
|
android:tint="@color/arrow_tip_view_content"
|
||||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:contentDescription="@string/accessibility_close"/>
|
android:contentDescription="@string/accessibility_close"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
android:textColorHint="?android:attr/textColorTertiary"/>
|
android:textColorHint="?android:attr/textColorTertiary"/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
|
|||||||
@@ -57,8 +57,8 @@
|
|||||||
<string name="widget_accessible_dims_format">%1$d wide by %2$d high</string>
|
<string name="widget_accessible_dims_format">%1$d wide by %2$d high</string>
|
||||||
<!-- Message to tell the user to press and hold a widget/icon to add it -->
|
<!-- Message to tell the user to press and hold a widget/icon to add it -->
|
||||||
<string name="add_item_request_drag_hint">Touch & hold to place manually</string>
|
<string name="add_item_request_drag_hint">Touch & hold to place manually</string>
|
||||||
<!-- Button label to automatically add icon on home screen [CHAR_LIMIT=50] -->
|
<!-- Button label to automatically add a widget to home screen [CHAR_LIMIT=50] -->
|
||||||
<string name="place_automatically">Add automatically</string>
|
<string name="add_to_home_screen">Add to Home screen</string>
|
||||||
<!-- Label for showing the number of widgets an app has in the full widgets picker.
|
<!-- Label for showing the number of widgets an app has in the full widgets picker.
|
||||||
[CHAR_LIMIT=25] -->
|
[CHAR_LIMIT=25] -->
|
||||||
<plurals name="widgets_count">
|
<plurals name="widgets_count">
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import android.graphics.Paint;
|
|||||||
import android.graphics.drawable.ShapeDrawable;
|
import android.graphics.drawable.ShapeDrawable;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -108,10 +107,7 @@ public class ArrowTipView extends AbstractFloatingView {
|
|||||||
ShapeDrawable arrowDrawable = new ShapeDrawable(TriangleShape.create(
|
ShapeDrawable arrowDrawable = new ShapeDrawable(TriangleShape.create(
|
||||||
arrowLp.width, arrowLp.height, false));
|
arrowLp.width, arrowLp.height, false));
|
||||||
Paint arrowPaint = arrowDrawable.getPaint();
|
Paint arrowPaint = arrowDrawable.getPaint();
|
||||||
TypedValue typedValue = new TypedValue();
|
arrowPaint.setColor(ContextCompat.getColor(getContext(), R.color.arrow_tip_view_bg));
|
||||||
context.getTheme()
|
|
||||||
.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
|
|
||||||
arrowPaint.setColor(ContextCompat.getColor(getContext(), typedValue.resourceId));
|
|
||||||
// The corner path effect won't be reflected in the shadow, but shouldn't be noticeable.
|
// The corner path effect won't be reflected in the shadow, but shouldn't be noticeable.
|
||||||
arrowPaint.setPathEffect(new CornerPathEffect(
|
arrowPaint.setPathEffect(new CornerPathEffect(
|
||||||
context.getResources().getDimension(R.dimen.arrow_toast_corner_radius)));
|
context.getResources().getDimension(R.dimen.arrow_toast_corner_radius)));
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public class AddToHomeScreenPrompt {
|
public class AddToHomeScreenPrompt {
|
||||||
private static final Pattern ADD_AUTOMATICALLY =
|
private static final Pattern ADD_AUTOMATICALLY =
|
||||||
Pattern.compile("^Add automatically$", CASE_INSENSITIVE);
|
Pattern.compile("^Add to Home screen$", CASE_INSENSITIVE);
|
||||||
private final LauncherInstrumentation mLauncher;
|
private final LauncherInstrumentation mLauncher;
|
||||||
private final UiObject2 mWidgetCell;
|
private final UiObject2 mWidgetCell;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user