Snap for 8889107 from dc9e869d98 to udc-release
Change-Id: I84bd24050684c21ace297137c8d84c31e676bbb0
This commit is contained in:
commit
dcc3d7524a
43 files changed
+317
-748
No files matched your search
@@ -14,16 +14,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<!-- Applies to small tablet screens -->
|
||||
<resources>
|
||||
<dimen name="navigation_key_padding">25dp</dimen>
|
||||
|
||||
<!-- Task View -->
|
||||
<!-- Overview Task Views -->
|
||||
<!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
|
||||
<dimen name="task_thumbnail_icon_size">48dp</dimen>
|
||||
<!-- The icon size for the focused task, placed in center of touch target -->
|
||||
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
|
||||
<!-- The space under the focused task icon -->
|
||||
<dimen name="overview_task_margin">12dp</dimen>
|
||||
<!-- The icon size of all non-focused task icons, placed in center of touch target -->
|
||||
<dimen name="task_thumbnail_icon_drawable_size_grid">44dp</dimen>
|
||||
<dimen name="overview_task_margin_grid">12dp</dimen>
|
||||
<!-- The space between grid rows (when there's 2 rows of thumbnails) -->
|
||||
<dimen name="overview_grid_row_spacing">28dp</dimen>
|
||||
<!-- The horizontal space between tasks -->
|
||||
<dimen name="overview_page_spacing">36dp</dimen>
|
||||
<!-- The space to the left and to the right of the "Clear all" button -->
|
||||
<dimen name="overview_grid_side_margin">64dp</dimen>
|
||||
</resources>
|
||||
@@ -14,14 +14,23 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<!-- Applies to large tablet screens -->
|
||||
<resources>
|
||||
<!-- Task View -->
|
||||
<!-- Overview Task Views -->
|
||||
<!-- The primary task thumbnail uses up to this much of the total screen height/width -->
|
||||
<item name="overview_max_scale" format="float" type="dimen">0.7</item>
|
||||
<!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
|
||||
<dimen name="task_thumbnail_icon_size">48dp</dimen>
|
||||
<!-- The icon size for the focused task, placed in center of touch target -->
|
||||
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
|
||||
<!-- The space under the focused task icon -->
|
||||
<dimen name="overview_task_margin">16dp</dimen>
|
||||
<!-- The icon size of all non-focused task icons, placed in center of touch target -->
|
||||
<dimen name="task_thumbnail_icon_drawable_size_grid">44dp</dimen>
|
||||
<dimen name="overview_task_margin_grid">16dp</dimen>
|
||||
<!-- The space between grid rows (when there's 2 rows of thumbnails) -->
|
||||
<dimen name="overview_grid_row_spacing">36dp</dimen>
|
||||
<!-- The horizontal space between tasks -->
|
||||
<dimen name="overview_page_spacing">44dp</dimen>
|
||||
<!-- The space to the left and to the right of the "Clear all" button -->
|
||||
<dimen name="overview_grid_side_margin">64dp</dimen>
|
||||
</resources>
|
||||
@@ -31,14 +31,19 @@
|
||||
|
||||
<dimen name="overview_minimum_next_prev_size">50dp</dimen>
|
||||
|
||||
<!-- Task View -->
|
||||
<dimen name="task_thumbnail_icon_size">48dp</dimen>
|
||||
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
|
||||
<dimen name="overview_task_margin">16dp</dimen>
|
||||
<dimen name="overview_page_spacing">16dp</dimen>
|
||||
<dimen name="task_icon_cache_default_icon_size">72dp</dimen>
|
||||
|
||||
<!-- Overview Task Views -->
|
||||
<!-- The primary task thumbnail uses up to this much of the total screen height/width -->
|
||||
<item name="overview_max_scale" format="float" type="dimen">0.7</item>
|
||||
<!-- A touch target for icons, sometimes slightly larger than the icons themselves -->
|
||||
<dimen name="task_thumbnail_icon_size">48dp</dimen>
|
||||
<!-- The icon size for the focused task, placed in center of touch target -->
|
||||
<dimen name="task_thumbnail_icon_drawable_size">44dp</dimen>
|
||||
<!-- The space under the focused task icon -->
|
||||
<dimen name="overview_task_margin">16dp</dimen>
|
||||
<!-- The horizontal space between tasks -->
|
||||
<dimen name="overview_page_spacing">16dp</dimen>
|
||||
|
||||
<dimen name="task_icon_cache_default_icon_size">72dp</dimen>
|
||||
<item name="overview_modal_max_scale" format="float" type="dimen">1.1</item>
|
||||
|
||||
<!-- Overrideable in overlay that provides the Overview Actions. -->
|
||||
|
||||
@@ -23,16 +23,22 @@ import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.BAD_STATE;
|
||||
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
|
||||
import static com.android.quickstep.views.RecentsView.FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN;
|
||||
import static com.android.quickstep.views.RecentsView.OVERVIEW_PROGRESS;
|
||||
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
|
||||
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
|
||||
import static com.android.quickstep.views.RecentsView.SPLIT_INSTRUCTIONS_FADE;
|
||||
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.util.FloatProperty;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -40,9 +46,12 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.launcher3.BaseQuickstepLauncher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.dragndrop.DragLayer;
|
||||
import com.android.launcher3.statemanager.StateManager.StateHandler;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.quickstep.views.FloatingTaskView;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
|
||||
/**
|
||||
@@ -106,6 +115,49 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
|
||||
setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f,
|
||||
config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR));
|
||||
|
||||
if (mRecentsView.isSplitSelectionActive()) {
|
||||
// TODO (b/238651489): Refactor state management to avoid need for double check
|
||||
FloatingTaskView floatingTask = mRecentsView.getFirstFloatingTaskView();
|
||||
if (floatingTask != null) {
|
||||
DragLayer dragLayer = mLauncher.getDragLayer();
|
||||
RectF onScreenRectF = new RectF();
|
||||
Utilities.getBoundsForViewInDragLayer(mLauncher.getDragLayer(), floatingTask,
|
||||
new Rect(0, 0, floatingTask.getWidth(), floatingTask.getHeight()),
|
||||
false, null, onScreenRectF);
|
||||
// Get the part of the floatingTask that intersects with the DragLayer (i.e. the
|
||||
// on-screen portion)
|
||||
onScreenRectF.intersect(
|
||||
dragLayer.getLeft(),
|
||||
dragLayer.getTop(),
|
||||
dragLayer.getRight(),
|
||||
dragLayer.getBottom()
|
||||
);
|
||||
|
||||
setter.setFloat(
|
||||
mRecentsView,
|
||||
FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN,
|
||||
mRecentsView.getPagedOrientationHandler()
|
||||
.getFloatingTaskOffscreenTranslationTarget(
|
||||
floatingTask,
|
||||
onScreenRectF,
|
||||
floatingTask.getStagePosition(),
|
||||
mLauncher.getDeviceProfile()
|
||||
),
|
||||
config.getInterpolator(
|
||||
ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
|
||||
LINEAR
|
||||
));
|
||||
setter.setFloat(
|
||||
mRecentsView,
|
||||
SPLIT_INSTRUCTIONS_FADE,
|
||||
1,
|
||||
config.getInterpolator(
|
||||
ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE,
|
||||
LINEAR
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
float recentsAlpha = toState.overviewUi ? 1 : 0;
|
||||
Log.d(BAD_STATE, "BaseRecentsViewStateController setStateWithAnimationInternal toState="
|
||||
+ toState + ", alpha=" + recentsAlpha);
|
||||
|
||||
@@ -37,6 +37,10 @@ import com.android.quickstep.views.TaskView;
|
||||
*/
|
||||
public class OverviewState extends LauncherState {
|
||||
|
||||
private static final int OVERVIEW_SLIDE_IN_DURATION = 380;
|
||||
private static final int OVERVIEW_POP_IN_DURATION = 250;
|
||||
private static final int OVERVIEW_EXIT_DURATION = 250;
|
||||
|
||||
protected static final Rect sTempRect = new Rect();
|
||||
|
||||
private static final int STATE_FLAGS = FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
|
||||
@@ -57,8 +61,15 @@ public class OverviewState extends LauncherState {
|
||||
|
||||
@Override
|
||||
public int getTransitionDuration(Context context, boolean isToState) {
|
||||
// In gesture modes, overview comes in all the way from the side, so give it more time.
|
||||
return DisplayController.getNavigationMode(context).hasGestures ? 380 : 250;
|
||||
if (isToState) {
|
||||
// In gesture modes, overview comes in all the way from the side, so give it more time.
|
||||
return DisplayController.getNavigationMode(context).hasGestures
|
||||
? OVERVIEW_SLIDE_IN_DURATION
|
||||
: OVERVIEW_POP_IN_DURATION;
|
||||
} else {
|
||||
// When exiting Overview, exit quickly.
|
||||
return OVERVIEW_EXIT_DURATION;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+15
-5
@@ -22,13 +22,15 @@ import static com.android.launcher3.LauncherState.HINT_STATE;
|
||||
import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
|
||||
import static com.android.launcher3.WorkspaceStateTransitionAnimation.getWorkspaceSpringScaleAnimator;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
|
||||
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
|
||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE;
|
||||
import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE;
|
||||
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
@@ -39,6 +41,8 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
|
||||
@@ -87,9 +91,16 @@ public class QuickstepAtomicAnimationFactory extends
|
||||
public void prepareForAtomicAnimation(LauncherState fromState, LauncherState toState,
|
||||
StateAnimationConfig config) {
|
||||
RecentsView overview = mActivity.getOverviewPanel();
|
||||
if (toState == NORMAL && fromState == OVERVIEW) {
|
||||
if ((fromState == OVERVIEW || fromState == OVERVIEW_SPLIT_SELECT) && toState == NORMAL) {
|
||||
if (fromState == OVERVIEW_SPLIT_SELECT) {
|
||||
config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
|
||||
clampToProgress(EMPHASIZED_ACCELERATE, 0, 0.4f));
|
||||
config.setInterpolator(ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE,
|
||||
clampToProgress(LINEAR, 0, 0.33f));
|
||||
}
|
||||
|
||||
config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, 0, 0.25f));
|
||||
config.setInterpolator(ANIM_SCRIM_FADE, LINEAR);
|
||||
config.setInterpolator(ANIM_SCRIM_FADE, clampToProgress(LINEAR, 0.33f, 1));
|
||||
config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL);
|
||||
config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL);
|
||||
|
||||
@@ -98,8 +109,7 @@ public class QuickstepAtomicAnimationFactory extends
|
||||
// Overview is going offscreen, so keep it at its current scale and opacity.
|
||||
config.setInterpolator(ANIM_OVERVIEW_SCALE, FINAL_FRAME);
|
||||
config.setInterpolator(ANIM_OVERVIEW_FADE, FINAL_FRAME);
|
||||
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X,
|
||||
clampToProgress(FAST_OUT_SLOW_IN, 0, 0.75f));
|
||||
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, EMPHASIZED_DECELERATE);
|
||||
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, FINAL_FRAME);
|
||||
} else {
|
||||
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL);
|
||||
|
||||
@@ -260,6 +260,10 @@ public class FloatingTaskView extends FrameLayout {
|
||||
mActivity.getDeviceProfile(), mStagePosition);
|
||||
}
|
||||
|
||||
public int getStagePosition() {
|
||||
return mStagePosition;
|
||||
}
|
||||
|
||||
private static class SplitOverlayProperties {
|
||||
|
||||
private final float finalTaskViewScaleX;
|
||||
|
||||
@@ -397,6 +397,39 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
};
|
||||
|
||||
public static final FloatProperty<RecentsView> FIRST_FLOATING_TASK_TRANSLATE_OFFSCREEN =
|
||||
new FloatProperty<RecentsView>("firstFloatingTaskTranslateOffscreen") {
|
||||
@Override
|
||||
public void setValue(RecentsView view, float translation) {
|
||||
view.getPagedOrientationHandler().setFloatingTaskPrimaryTranslation(
|
||||
view.mFirstFloatingTaskView,
|
||||
translation,
|
||||
view.mActivity.getDeviceProfile()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float get(RecentsView view) {
|
||||
return view.getPagedOrientationHandler().getFloatingTaskPrimaryTranslation(
|
||||
view.mFirstFloatingTaskView,
|
||||
view.mActivity.getDeviceProfile()
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public static final FloatProperty<RecentsView> SPLIT_INSTRUCTIONS_FADE =
|
||||
new FloatProperty<RecentsView>("splitInstructionsFade") {
|
||||
@Override
|
||||
public void setValue(RecentsView view, float fade) {
|
||||
view.mSplitInstructionsView.setAlpha(1 - fade);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float get(RecentsView view) {
|
||||
return 1 - view.mSplitInstructionsView.getAlpha();
|
||||
}
|
||||
};
|
||||
|
||||
// OverScroll constants
|
||||
private static final int OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION = 270;
|
||||
|
||||
@@ -2205,7 +2238,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
|
||||
TaskViewSimulator[] taskViewSimulators) {
|
||||
mCurrentGestureEndTarget = endTarget;
|
||||
if (endTarget == GestureState.GestureEndTarget.RECENTS) {
|
||||
boolean isOverviewEndTarget = endTarget == GestureState.GestureEndTarget.RECENTS;
|
||||
if (isOverviewEndTarget) {
|
||||
updateGridProperties();
|
||||
}
|
||||
|
||||
@@ -2234,10 +2268,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
}
|
||||
}
|
||||
int overviewProgress = isOverviewEndTarget ? 1 : 0;
|
||||
if (animatorSet == null) {
|
||||
setOverviewProgress(1);
|
||||
setOverviewProgress(overviewProgress);
|
||||
} else {
|
||||
animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, 1));
|
||||
animatorSet.play(ObjectAnimator.ofFloat(this, OVERVIEW_PROGRESS, overviewProgress));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5291,6 +5326,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
return mRecentsAnimationController;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public FloatingTaskView getFirstFloatingTaskView() {
|
||||
return mFirstFloatingTaskView;
|
||||
}
|
||||
|
||||
/** Update the current activity locus id to show the enabled state of Overview */
|
||||
public void updateLocusId() {
|
||||
String locusId = "Overview";
|
||||
|
||||
@@ -866,10 +866,9 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
|
||||
int thumbnailTopMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
|
||||
int taskIconHeight = deviceProfile.overviewTaskIconSizePx;
|
||||
int taskMargin = isGridTask ? deviceProfile.overviewTaskMarginGridPx
|
||||
: deviceProfile.overviewTaskMarginPx;
|
||||
int taskIconMargin = thumbnailTopMargin - taskIconHeight - taskMargin;
|
||||
orientationHandler.setTaskIconParams(iconParams, taskIconMargin, taskIconHeight,
|
||||
int taskMargin = deviceProfile.overviewTaskMarginPx;
|
||||
|
||||
orientationHandler.setTaskIconParams(iconParams, taskMargin, taskIconHeight,
|
||||
thumbnailTopMargin, isRtl);
|
||||
iconParams.width = iconParams.height = taskIconHeight;
|
||||
mIconView.setLayoutParams(iconParams);
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfilePhone3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfilePhoneTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-7
@@ -339,11 +339,6 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTabletLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTabletLandscapeTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTabletPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTabletPortraitTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-7
@@ -339,11 +339,6 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTwoPanelLandscape3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTwoPanelLandscapeTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-7
@@ -339,11 +339,6 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTwoPanelPortrait3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(32)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(96)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(160)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(128)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileTwoPanelPortraitTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(40)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(72)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileVerticalBar3ButtonTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -339,11 +339,6 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() {
|
||||
assertThat(dp.overviewTaskMarginPx).isEqualTo(56)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskMarginGridPx() {
|
||||
assertThat(dp.overviewTaskMarginGridPx).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun overviewTaskIconSizePx() {
|
||||
assertThat(dp.overviewTaskIconSizePx).isEqualTo(168)
|
||||
@@ -361,7 +356,7 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewTaskThumbnailTopMarginPx() {
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(280)
|
||||
assertThat(dp.overviewTaskThumbnailTopMarginPx).isEqualTo(224)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -386,7 +381,7 @@ class DeviceProfileVerticalBarTest : DeviceProfileBaseTest() {
|
||||
|
||||
@Test
|
||||
fun overviewRowSpacing() {
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(-112)
|
||||
assertThat(dp.overviewRowSpacing).isEqualTo(0)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2017 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="208dp"
|
||||
android:height="212dp"
|
||||
android:viewportWidth="208.0"
|
||||
android:viewportHeight="212.0">
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M89.4,61.8H85l-1.6-1.5c5.5-6.4,8.8-14.7,8.8-23.7C92.2,16.6,76,0.3,55.9,0.3
|
||||
S19.5,16.6,19.5,36.6S35.8,73,55.9,73c9,0,17.3-3.3,23.7-8.8l1.5,1.6v4.4l40.5,40.4l8.3-8.3L89.4,61.8z M54,66.6
|
||||
c-13.9,0-28.8-16-28.8-30S41.5,8.9,55.4,8.9S81,22.7,81,36.6S67.9,66.6,54,66.6z"/>
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M33.4,29.2l-0.3-1.8l-4.2-3.1L18.1,26l-3.1,4.2l0.3,1.8L4.5,33.7L9,62.5
|
||||
c0.2,1.5,1.6,2.5,3.1,2.3l34.2-5.3c1.5-0.2,2.5-1.6,2.3-3.1l-4.4-28.8L33.4,29.2z"/>
|
||||
<path
|
||||
android:fillColor="#3367D6"
|
||||
android:pathData="M30.2,27.9l-0.3-1.8l-4.1-3L15,24.7l-3,4.1l0.3,1.8L1.6,32.3L6,60.9
|
||||
c0.2,1.5,1.6,2.5,3.1,2.3L43,57.9c1.5-0.2,2.5-1.6,2.3-3.1l-4.4-28.6L30.2,27.9z M26.6,28.4l-10.7,1.6l-0.3-1.8l10.7-1.6L26.6,28.4z"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M25.1,37.7a28.9,28.9 0 1,0 57.8,0a28.9,28.9 0 1,0 -57.8,0"/>
|
||||
<path
|
||||
android:fillColor="#4285F4"
|
||||
android:pathData="M41.7,23l-0.3-2.1l-4.9-3.6l-12.6,1.9l-3.6,4.9l0.3,2.1L8.1,28.1l5.2,33.7
|
||||
c0.3,1.7,1.9,2.9,3.6,2.7l40-6.1c1.7-0.3,2.9-1.9,2.7-3.6L54.4,21L41.7,23z M37.5,23.6l-12.6,1.9l-0.3-2.1l12.6-1.9L37.5,23.6z"/>
|
||||
</group>
|
||||
<path
|
||||
android:fillColor="?android:attr/colorControlHighlight"
|
||||
android:pathData="M87.5,62.9h-4.4l-1.6-1.5c5.5-6.4,8.8-14.7,8.8-23.7C90.3,17.7,74,1.4,54,1.4
|
||||
S17.6,17.7,17.6,37.7S33.9,74.1,54,74.1c9,0,17.3-3.3,23.7-8.8l1.5,1.6v4.4l40.5,40.4l8.3-8.3L87.5,62.9z M54,64.2
|
||||
c-14.7,0-26.5-11.8-26.5-26.5S39.3,11.2,54,11.2s26.5,11.8,26.5,26.5S68.6,64.2,54,64.2z"/>
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M153.4,112.9c-14.9-17.2-38.6-9.1-38.6-9.1l-10.2-11.3c0,0-4.8-5.9-9-3.7
|
||||
c-7,3.6-0.6,10.7-0.6,10.7s12.3,15.1,15.4,20.1c2.1,3.4,8.4,4.5,10.1,4.9l17.1,3.7l-0.9-0.7l-1-0.7L153.4,112.9z"/>
|
||||
<path
|
||||
android:fillColor="#FFDBA6"
|
||||
android:pathData="M152.1,113.9c-14.9-17.2-37.6-8-37.6-8l-11.1-12.3c0,0-4.8-5.9-9-3.7
|
||||
c-7,3.6-0.6,10.7-0.6,10.7s12.3,15.1,15.4,20.1c2.1,3.4,8.4,4.5,10.1,4.9l19,4.1"/>
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M148.6,77.9c0.6,0.7,2,2.5,2.1,2.6c1.1,1.7,6.2,13.6,11.8,35.1c0,0.1,1.9,3,1.9,3.1
|
||||
c0,0,0.1,0.1,0.1,0.2c0,0,0,0,0-0.1c0.9,1.3,4.4,6.6,8.9,13.7c0.1,0.2,0.3,0.5,0.4,0.7c0,0.1,0.1,0.1,0.1,0.2
|
||||
c0.2,0.3,0.4,0.6,0.6,0.9c0.1-0.1,0.2-0.2,0.3-0.3c0.2-0.3,0.6-0.3,0.8,0c2.9,4.8,21.2,35,26.7,49c2.1,5.3,3.2,8.4,3.6,11.6
|
||||
c0.3,2.3,0,4.4-1.2,6c1.5-1.9,3.5-6.8-1.5-19c-1.2-2.9-2.8-6.5-4.8-10.5c-7.5-15.2-20-35.6-22.4-39.6c-0.2-0.3-0.6-0.3-0.8,0
|
||||
c-0.2,0.2-0.3,0.4-0.5,0.6c-4.5-7.1-8.2-12.6-8.8-13.5c-0.1-0.1-1.9-3-1.9-3.1c-5.7-21.6-10.7-33.4-11.8-35.1
|
||||
c-0.1-0.1-1.5-1.9-2.1-2.6l-6.5-8.3c-1.9-2.3-4.2-4.1-6.7-2.3c-2.5,1.8-1.6,4.5-0.1,7.1l3.3,5.2l7-2
|
||||
C147.7,77.4,148.1,77.3,148.6,77.9z"/>
|
||||
<path
|
||||
android:fillColor="#FFDBA6"
|
||||
android:pathData="M148.6,77.9l-6.5-8.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l3.8,6L148.6,77.9C148.6,77.9,148.6,77.9,148.6,77.9z"/>
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M151.1,92.5l-19.7-25.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l17.1,27.2L151.1,92.5z"/>
|
||||
<path
|
||||
android:fillColor="#FFDBA6"
|
||||
android:pathData="M149.7,92.9l-19.7-25.3c-1.9-2.3-4.2-4.1-6.7-2.3l0,0l0,0c-2.5,1.8-1.6,4.5-0.1,7.1l17.1,27.2L149.7,92.9z"/>
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M141.6,94.6l-20.8-26.7c-2.1-2.5-4.4-4.3-7.1-2.5l0,0l0,0c-2.6,1.9-1.7,4.7-0.1,7.5l18,28.6L141.6,94.6z"/>
|
||||
<path
|
||||
android:fillColor="#FFDBA6"
|
||||
android:pathData="M140.1,95l-20.8-26.7c-2.1-2.5-4.4-4.3-7.1-2.5l0,0h0c-2.6,1.9-1.7,4.7-0.1,7.5l18,28.6L140.1,95z"/>
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M140.4,99.1c-0.5-0.6-2.1-7.5-2.8-7.3l-15.9-6.9c-0.3,0-0.5-0.1-0.7-0.3l-2.3-3.5
|
||||
l-0.4-0.6L100,54.5c-1.5-2-3.3-4-5.3-4.3c-0.7-0.1-1.3-0.2-2,0.2v0c-1,0.6-1.2,1.5-1.3,2.4c-0.2,1.8,0.6,3.9,1.6,5.9L108.5,87
|
||||
l0.2,0.4l6.6,11.7l0,0c2.5,4.5,4.4,10.5,4.4,10.7L140.4,99.1"/>
|
||||
<path
|
||||
android:fillColor="#FFDBA6"
|
||||
android:pathData="M129.7,125.1c3,0.7,8.1,4,11.8,9.1c2.7,3.7,5.5,8.3,8.2,13
|
||||
c7.6-2.3,19.9-6.8,24.9-12.9c-0.2-0.3-0.4-0.6-0.6-0.9c0-0.1-0.1-0.1-0.1-0.2c-0.1-0.2-0.3-0.5-0.4-0.7c-4.5-7.1-8-12.4-8.9-13.7
|
||||
c0,0,0,0,0,0.1c0-0.1-0.1-0.1-0.1-0.2c-0.1-0.1-1.9-3-1.9-3.1c-5.7-21.5-10.7-33.4-11.8-35.1c-0.1-0.1-1.5-1.9-2.1-2.6
|
||||
c-0.5-0.6-0.9-0.5-1.6-0.3l-26.8,7.7c-0.3,0-0.5-0.1-0.7-0.3l-2.3-3.5l-0.4-0.6L98.5,54.8c-1.5-2-3.3-4-5.3-4.3
|
||||
c-0.7-0.1-1.3-0.2-2,0.2c-1,0.6-1.2,1.5-1.3,2.4c-0.2,1.8,0.6,3.9,1.6,5.9L107,87.3l0.2,0.4l6.6,11.7l0,0
|
||||
c2.5,4.5,4.4,10.5,4.4,10.7L129.7,125.1"/>
|
||||
<path
|
||||
android:fillColor="?android:attr/colorForeground"
|
||||
android:pathData="M202.3,183.1c-5.4-14.1-23.8-44.3-26.7-49c-0.2-0.3-0.6-0.3-0.8,0
|
||||
c-5.1,6.6-19,11.4-26.5,13.6c-0.3,0.1-1,0.1-1.2,0.6c-0.2,0.4,0.1,1,0.2,1.1c7.8,12.9,14.7,27.9,15.3,29.3c0,0.1,0.1,0.1,0.1,0.2
|
||||
l9.6,22.9c0,0,0,0,0,0l1.7,4.1c1.4,2.7,3,4.3,5.3,5.1c1.5,0.5,2.1,0.6,3.2,0.6c4.8,0.1,15.2-6.1,20.5-9.4c2.7-1.7,3.3-4.4,2.9-7.6
|
||||
C205.5,191.5,204.4,188.4,202.3,183.1z"/>
|
||||
</vector>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 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="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48.0"
|
||||
android:viewportHeight="48.0">
|
||||
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M44.28,30.96c4.84-10.68,0.09-23.27-10.59-28.11S10.42,2.74,5.58,13.42
|
||||
C1,23.54,6.5,35.92,16.62,40.51l0,0l-3.23,7.12C27.84,47,39.79,40.86,44.28,30.96z" />
|
||||
<path
|
||||
android:fillColor="?android:attr/colorPrimary"
|
||||
android:pathData="M41.75,30.05c4.84-10.68,0.09-23.27-10.59-28.11S7.9,1.83,3.06,12.51
|
||||
c-4.59,10.12,0.92,22.5,11.03,27.09l0,0l-3.23,7.12C25.31,46.09,37.26,39.94,41.75,30.05z" />
|
||||
</vector>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 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="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48.0"
|
||||
android:viewportHeight="48.0">
|
||||
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M20.54,44.59c0.57-0.04,1.15-0.38,1.67-1.04l24.23-30.62c0.62-0.78,0.77-1.54,0.52-2.12
|
||||
c-0.25-0.58-0.9-0.99-1.89-1.1L6.2,5.99C5.39,5.91,4.74,6.08,4.32,6.44l0,0C3.7,6.97,3.55,7.88,4.01,8.96l14.54,34.09
|
||||
C19,44.13,19.75,44.65,20.54,44.59L20.54,44.59z" />
|
||||
<path
|
||||
android:fillColor="?android:attr/colorPrimary"
|
||||
android:pathData="M18.49,43.22c0.57-0.04,1.15-0.38,1.67-1.04l24.23-30.62c0.62-0.78,0.77-1.54,0.52-2.12
|
||||
c-0.25-0.58-0.9-0.99-1.89-1.1L4.15,4.62C3.34,4.54,2.69,4.71,2.27,5.08l0,0C1.65,5.6,1.5,6.52,1.96,7.6L16.5,41.69
|
||||
C16.96,42.76,17.7,43.28,18.49,43.22L18.49,43.22z" />
|
||||
</vector>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 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="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48.0"
|
||||
android:viewportHeight="48.0">
|
||||
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M25.18,1.27c-12.32,0-23.41,9.99-23.41,22.31s11.09,22.31,23.41,22.31
|
||||
s22.31-9.99,22.31-22.31S37.5,1.27,25.18,1.27z M25.18,33.55c-5.5,0-14.35-5.1-14.35-10.6s8.32-12.19,13.82-12.19
|
||||
c5.5,0,10.49,7.33,10.49,12.83S30.68,33.55,25.18,33.55z" />
|
||||
<path
|
||||
android:fillColor="?android:attr/colorPrimary"
|
||||
android:pathData="M22.93,0.22c-12.32,0-22.31,9.99-22.31,22.31s9.99,22.31,22.31,22.31
|
||||
s22.31-9.99,22.31-22.31S35.25,0.22,22.93,0.22z M22.93,32.5c-5.5,0-9.97-4.46-9.97-9.97s4.46-9.97,9.97-9.97
|
||||
c5.5,0,9.97,4.46,9.97,9.97S28.43,32.5,22.93,32.5z" />
|
||||
<path
|
||||
android:fillColor="?android:attr/colorPrimary"
|
||||
android:pathData="M14.81,22.53a8.12,8.12 0 1,0 16.24,0a8.12,8.12 0 1,0 -16.24,0z" />
|
||||
</vector>
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 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="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48.0"
|
||||
android:viewportHeight="48.0">
|
||||
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M11.53,8.02l23.39-5.73c1.61-0.39,3.25,0.6,3.64,2.21l7.64,31.19
|
||||
c0.39,1.61-0.6,3.25-2.21,3.64L12.8,46.97c-1.61,0.39-3.25-0.6-3.64-2.21L3.43,21.37L11.53,8.02z" />
|
||||
<path
|
||||
android:fillColor="?android:attr/colorPrimary"
|
||||
android:pathData="M9.2,6.53L32.59,0.8C34.2,0.4,35.84,1.4,36.23,3l7.64,31.19c0.39,1.61-0.6,3.25-2.21,3.64
|
||||
l-31.19,7.64c-1.61,0.39-3.25-0.6-3.64-2.21L1.11,19.87L9.2,6.53z" />
|
||||
<path
|
||||
android:fillColor="#1A000000"
|
||||
android:pathData="M9.27,6.47l1.91,7.8c0.4,1.62-0.59,3.24-2.21,3.64l-7.8,1.91L9.27,6.47z" />
|
||||
</vector>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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.
|
||||
-->
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/search_market_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/dynamic_grid_edge_margin"
|
||||
android:paddingRight="@dimen/dynamic_grid_edge_margin"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?android:attr/colorAccent"
|
||||
android:text="@string/all_apps_search_market_message"
|
||||
android:textAllCaps="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:selectableItemBackground" />
|
||||
@@ -108,9 +108,6 @@
|
||||
<dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
|
||||
<dimen name="all_apps_search_bar_bottom_padding">30dp</dimen>
|
||||
<dimen name="all_apps_empty_search_message_top_offset">40dp</dimen>
|
||||
<dimen name="all_apps_empty_search_bg_top_offset">144dp</dimen>
|
||||
<dimen name="all_apps_background_canvas_width">700dp</dimen>
|
||||
<dimen name="all_apps_background_canvas_height">475dp</dimen>
|
||||
<dimen name="all_apps_header_pill_height">48dp</dimen>
|
||||
<dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
|
||||
<dimen name="all_apps_header_tab_height">48dp</dimen>
|
||||
@@ -381,7 +378,6 @@
|
||||
<dimen name="task_thumbnail_icon_drawable_size">0dp</dimen>
|
||||
<dimen name="task_thumbnail_icon_drawable_size_grid">0dp</dimen>
|
||||
<dimen name="overview_task_margin">0dp</dimen>
|
||||
<dimen name="overview_task_margin_grid">0dp</dimen>
|
||||
<dimen name="overview_actions_height">0dp</dimen>
|
||||
<dimen name="overview_actions_button_spacing">0dp</dimen>
|
||||
<dimen name="overview_actions_margin_gesture">0dp</dimen>
|
||||
|
||||
@@ -128,8 +128,6 @@
|
||||
<string name="all_apps_loading_message">Loading apps…</string>
|
||||
<!-- No-search-results text. [CHAR_LIMIT=50] -->
|
||||
<string name="all_apps_no_search_results">No apps found matching \"<xliff:g id="query" example="Android">%1$s</xliff:g>\"</string>
|
||||
<!-- Label for the button which allows the user to get app search results. [CHAR_LIMIT=50] -->
|
||||
<string name="all_apps_search_market_message">Search for more apps</string>
|
||||
<!-- Label for an icon representing any generic app. [CHAR_LIMIT=50] -->
|
||||
<string name="label_application">App</string>
|
||||
<!-- Label for the header text of the All Apps section in All Apps view, used to separate Predicted Apps and Actions section from All Apps section. [CHAR_LIMIT=50] -->
|
||||
|
||||
@@ -292,17 +292,6 @@
|
||||
|
||||
<style name="TextTitle" parent="@android:style/TextAppearance.DeviceDefault" />
|
||||
|
||||
<style name="AllAppsEmptySearchBackground">
|
||||
<item name="android:colorPrimary">#E0E0E0</item>
|
||||
<item name="android:colorControlHighlight">#19BDBDBD</item>
|
||||
<item name="android:colorForeground">@color/all_apps_bg_hand_fill</item>
|
||||
</style>
|
||||
<style name="AllAppsEmptySearchBackground.Dark">
|
||||
<item name="android:colorPrimary">#9AA0A6</item>
|
||||
<item name="android:colorControlHighlight">#19DFE1E5</item>
|
||||
<item name="android:colorForeground">@color/all_apps_bg_hand_fill_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Button.TopRounded.Bordered" parent="@android:style/Widget.Material.Button">
|
||||
<item name="android:background">@drawable/button_top_rounded_bordered_ripple</item>
|
||||
<item name="android:stateListAnimator">@null</item>
|
||||
|
||||
@@ -191,7 +191,6 @@ public class DeviceProfile {
|
||||
|
||||
// Overview
|
||||
public int overviewTaskMarginPx;
|
||||
public int overviewTaskMarginGridPx;
|
||||
public int overviewTaskIconSizePx;
|
||||
public int overviewTaskIconDrawableSizePx;
|
||||
public int overviewTaskIconDrawableSizeGridPx;
|
||||
@@ -426,25 +425,18 @@ public class DeviceProfile {
|
||||
}
|
||||
|
||||
overviewTaskMarginPx = res.getDimensionPixelSize(R.dimen.overview_task_margin);
|
||||
overviewTaskMarginGridPx = res.getDimensionPixelSize(R.dimen.overview_task_margin_grid);
|
||||
overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size);
|
||||
overviewTaskIconDrawableSizePx =
|
||||
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size);
|
||||
overviewTaskIconDrawableSizeGridPx =
|
||||
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size_grid);
|
||||
overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2;
|
||||
overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx;
|
||||
overviewActionsTopMarginPx = res.getDimensionPixelSize(R.dimen.overview_actions_top_margin);
|
||||
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
|
||||
overviewActionsButtonSpacing = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_button_spacing);
|
||||
overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height);
|
||||
// Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
|
||||
// overviewTaskThumbnailTopMarginPx is applied to all TaskThumbnailView, so exclude the
|
||||
// extra margin when calculating row spacing.
|
||||
int extraTopMargin = overviewTaskThumbnailTopMarginPx - overviewTaskIconSizePx
|
||||
- overviewTaskMarginGridPx;
|
||||
overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing)
|
||||
- extraTopMargin;
|
||||
overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing);
|
||||
overviewGridSideMargin = res.getDimensionPixelSize(R.dimen.overview_grid_side_margin);
|
||||
|
||||
// Calculate all of the remaining variables.
|
||||
@@ -1379,7 +1371,6 @@ public class DeviceProfile {
|
||||
writer.println(prefix + pxToDpStr("workspaceBottomPadding", workspaceBottomPadding));
|
||||
|
||||
writer.println(prefix + pxToDpStr("overviewTaskMarginPx", overviewTaskMarginPx));
|
||||
writer.println(prefix + pxToDpStr("overviewTaskMarginGridPx", overviewTaskMarginGridPx));
|
||||
writer.println(prefix + pxToDpStr("overviewTaskIconSizePx", overviewTaskIconSizePx));
|
||||
writer.println(prefix + pxToDpStr("overviewTaskIconDrawableSizePx",
|
||||
overviewTaskIconDrawableSizePx));
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
@@ -32,7 +31,6 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
|
||||
import com.android.launcher3.allapps.search.SearchAdapterProvider;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.util.PackageManagerHelper;
|
||||
import com.android.launcher3.views.AppLauncher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -77,13 +75,6 @@ public class ActivityAllAppsContainerView<T extends Context & AppLauncher
|
||||
|
||||
/** Updates all apps container with the latest search query. */
|
||||
public void setLastSearchQuery(String query) {
|
||||
Intent marketSearchIntent = PackageManagerHelper.getMarketSearchIntent(
|
||||
mActivityContext, query);
|
||||
OnClickListener marketSearchClickListener = (v) -> mActivityContext.startActivitySafely(v,
|
||||
marketSearchIntent, null);
|
||||
for (int i = 0; i < mAH.size(); i++) {
|
||||
mAH.get(i).mAdapter.setLastSearchQuery(query, marketSearchClickListener);
|
||||
}
|
||||
mIsSearching = true;
|
||||
rebindAdapters();
|
||||
mHeader.setCollapsed(true);
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.Gravity;
|
||||
|
||||
import com.android.launcher3.LauncherAnimUtils;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.Themes;
|
||||
|
||||
/**
|
||||
* This is a custom composite drawable that has a fixed virtual size and dynamically lays out its
|
||||
* children images relatively within its bounds. This way, we can reduce the memory usage of a
|
||||
* single, large sparsely populated image.
|
||||
*/
|
||||
public class AllAppsBackgroundDrawable extends Drawable {
|
||||
|
||||
/**
|
||||
* A helper class to position and orient a drawable to be drawn.
|
||||
*/
|
||||
protected static class TransformedImageDrawable {
|
||||
private Drawable mImage;
|
||||
private float mXPercent;
|
||||
private float mYPercent;
|
||||
private int mGravity;
|
||||
private int mAlpha;
|
||||
|
||||
/**
|
||||
* @param gravity If one of the Gravity center values, the x and y offset will take the width
|
||||
* and height of the image into account to center the image to the offset.
|
||||
*/
|
||||
public TransformedImageDrawable(Context context, int resourceId, float xPct, float yPct,
|
||||
int gravity) {
|
||||
mImage = context.getDrawable(resourceId);
|
||||
mXPercent = xPct;
|
||||
mYPercent = yPct;
|
||||
mGravity = gravity;
|
||||
}
|
||||
|
||||
public void setAlpha(int alpha) {
|
||||
mImage.setAlpha(alpha);
|
||||
mAlpha = alpha;
|
||||
}
|
||||
|
||||
public int getAlpha() {
|
||||
return mAlpha;
|
||||
}
|
||||
|
||||
public void updateBounds(Rect bounds) {
|
||||
int width = mImage.getIntrinsicWidth();
|
||||
int height = mImage.getIntrinsicHeight();
|
||||
int left = bounds.left + (int) (mXPercent * bounds.width());
|
||||
int top = bounds.top + (int) (mYPercent * bounds.height());
|
||||
if ((mGravity & Gravity.CENTER_HORIZONTAL) == Gravity.CENTER_HORIZONTAL) {
|
||||
left -= (width / 2);
|
||||
}
|
||||
if ((mGravity & Gravity.CENTER_VERTICAL) == Gravity.CENTER_VERTICAL) {
|
||||
top -= (height / 2);
|
||||
}
|
||||
mImage.setBounds(left, top, left + width, top + height);
|
||||
}
|
||||
|
||||
public void draw(Canvas canvas) {
|
||||
mImage.draw(canvas);
|
||||
}
|
||||
|
||||
public Rect getBounds() {
|
||||
return mImage.getBounds();
|
||||
}
|
||||
}
|
||||
|
||||
protected final TransformedImageDrawable mHand;
|
||||
protected final TransformedImageDrawable[] mIcons;
|
||||
private final int mWidth;
|
||||
private final int mHeight;
|
||||
|
||||
private ObjectAnimator mBackgroundAnim;
|
||||
|
||||
public AllAppsBackgroundDrawable(Context context) {
|
||||
Resources res = context.getResources();
|
||||
mWidth = res.getDimensionPixelSize(R.dimen.all_apps_background_canvas_width);
|
||||
mHeight = res.getDimensionPixelSize(R.dimen.all_apps_background_canvas_height);
|
||||
|
||||
context = new ContextThemeWrapper(context,
|
||||
Themes.getAttrBoolean(context, R.attr.isMainColorDark)
|
||||
? R.style.AllAppsEmptySearchBackground_Dark
|
||||
: R.style.AllAppsEmptySearchBackground);
|
||||
mHand = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_hand,
|
||||
0.575f, 0.f, Gravity.CENTER_HORIZONTAL);
|
||||
mIcons = new TransformedImageDrawable[4];
|
||||
mIcons[0] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_1,
|
||||
0.375f, 0, Gravity.CENTER_HORIZONTAL);
|
||||
mIcons[1] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_2,
|
||||
0.3125f, 0.2f, Gravity.CENTER_HORIZONTAL);
|
||||
mIcons[2] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_3,
|
||||
0.475f, 0.26f, Gravity.CENTER_HORIZONTAL);
|
||||
mIcons[3] = new TransformedImageDrawable(context, R.drawable.ic_all_apps_bg_icon_4,
|
||||
0.7f, 0.125f, Gravity.CENTER_HORIZONTAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Animates the background alpha.
|
||||
*/
|
||||
public void animateBgAlpha(float finalAlpha, int duration) {
|
||||
int finalAlphaI = (int) (finalAlpha * 255f);
|
||||
if (getAlpha() != finalAlphaI) {
|
||||
mBackgroundAnim = cancelAnimator(mBackgroundAnim);
|
||||
mBackgroundAnim = ObjectAnimator.ofInt(this, LauncherAnimUtils.DRAWABLE_ALPHA,
|
||||
finalAlphaI);
|
||||
mBackgroundAnim.setDuration(duration);
|
||||
mBackgroundAnim.start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the background alpha immediately.
|
||||
*/
|
||||
public void setBgAlpha(float finalAlpha) {
|
||||
int finalAlphaI = (int) (finalAlpha * 255f);
|
||||
if (getAlpha() != finalAlphaI) {
|
||||
mBackgroundAnim = cancelAnimator(mBackgroundAnim);
|
||||
setAlpha(finalAlphaI);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicWidth() {
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicHeight() {
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
mHand.draw(canvas);
|
||||
for (int i = 0; i < mIcons.length; i++) {
|
||||
mIcons[i].draw(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBoundsChange(Rect bounds) {
|
||||
super.onBoundsChange(bounds);
|
||||
mHand.updateBounds(bounds);
|
||||
for (int i = 0; i < mIcons.length; i++) {
|
||||
mIcons[i].updateBounds(bounds);
|
||||
}
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAlpha(int alpha) {
|
||||
mHand.setAlpha(alpha);
|
||||
for (int i = 0; i < mIcons.length; i++) {
|
||||
mIcons[i].setAlpha(alpha);
|
||||
}
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAlpha() {
|
||||
return mHand.getAlpha();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOpacity() {
|
||||
return PixelFormat.TRANSLUCENT;
|
||||
}
|
||||
|
||||
private ObjectAnimator cancelAnimator(ObjectAnimator animator) {
|
||||
if (animator != null) {
|
||||
animator.cancel();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,13 +24,10 @@ import static com.android.launcher3.util.LogConfig.SEARCH_LOGGING;
|
||||
import static com.android.launcher3.util.UiThreadHelper.hideKeyboardAsync;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
@@ -39,7 +36,6 @@ import com.android.launcher3.FastScrollRecyclerView;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.views.RecyclerViewFastScroller;
|
||||
@@ -89,10 +85,6 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
}
|
||||
};
|
||||
|
||||
// The empty-search result background
|
||||
protected AllAppsBackgroundDrawable mEmptySearchBackground;
|
||||
protected int mEmptySearchBackgroundTopOffset;
|
||||
|
||||
public AllAppsRecyclerView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -108,9 +100,6 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr,
|
||||
int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
Resources res = getResources();
|
||||
mEmptySearchBackgroundTopOffset = res.getDimensionPixelSize(
|
||||
R.dimen.all_apps_empty_search_bg_top_offset);
|
||||
mNumAppsPerRow = LauncherAppState.getIDP(context).numColumns;
|
||||
mFastScrollHelper = new AllAppsFastScrollHelper(this);
|
||||
}
|
||||
@@ -132,7 +121,6 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
|
||||
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1);
|
||||
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ALL_APPS_DIVIDER, 1);
|
||||
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET, 1);
|
||||
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows
|
||||
* (mNumAppsPerRow + 1));
|
||||
|
||||
@@ -143,10 +131,6 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c) {
|
||||
// Draw the background
|
||||
if (mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
|
||||
mEmptySearchBackground.draw(c);
|
||||
}
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "onDraw at = " + System.currentTimeMillis());
|
||||
}
|
||||
@@ -157,34 +141,14 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
super.onDraw(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean verifyDrawable(Drawable who) {
|
||||
return who == mEmptySearchBackground || super.verifyDrawable(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
updateEmptySearchBackgroundBounds();
|
||||
updatePoolSize();
|
||||
}
|
||||
|
||||
public void onSearchResultsChanged() {
|
||||
// Always scroll the view to the top so the user can see the changed results
|
||||
scrollToTop();
|
||||
|
||||
if (mApps.hasNoFilteredResults() && !FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
|
||||
if (mEmptySearchBackground == null) {
|
||||
mEmptySearchBackground = new AllAppsBackgroundDrawable(getContext());
|
||||
mEmptySearchBackground.setAlpha(0);
|
||||
mEmptySearchBackground.setCallback(this);
|
||||
updateEmptySearchBackgroundBounds();
|
||||
}
|
||||
mEmptySearchBackground.animateBgAlpha(1f, 150);
|
||||
} else if (mEmptySearchBackground != null) {
|
||||
// For the time being, we just immediately hide the background to ensure that it does
|
||||
// not overlap with the results
|
||||
mEmptySearchBackground.setBgAlpha(0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,16 +172,6 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent e) {
|
||||
boolean result = super.onInterceptTouchEvent(e);
|
||||
if (!result && e.getAction() == MotionEvent.ACTION_DOWN
|
||||
&& mEmptySearchBackground != null && mEmptySearchBackground.getAlpha() > 0) {
|
||||
mEmptySearchBackground.setHotspot(e.getX(), e.getY());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the touch (from 0..1) to the adapter position that should be visible.
|
||||
*/
|
||||
@@ -393,22 +347,6 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
|
||||
return mScrollbar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the bounds of the empty search background.
|
||||
*/
|
||||
private void updateEmptySearchBackgroundBounds() {
|
||||
if (mEmptySearchBackground == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Center the empty search background on this new view bounds
|
||||
int x = (getMeasuredWidth() - mEmptySearchBackground.getIntrinsicWidth()) / 2;
|
||||
int y = mEmptySearchBackgroundTopOffset;
|
||||
mEmptySearchBackground.setBounds(x, y,
|
||||
x + mEmptySearchBackground.getIntrinsicWidth(),
|
||||
y + mEmptySearchBackground.getIntrinsicHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlappingRendering() {
|
||||
return false;
|
||||
|
||||
@@ -15,17 +15,12 @@
|
||||
*/
|
||||
package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_ALL_APPS_DIVIDER;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_SEARCH_MARKET;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.DiffUtil;
|
||||
|
||||
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.LabelComparator;
|
||||
@@ -172,13 +167,6 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
return !mSearchResults.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether there are no filtered results.
|
||||
*/
|
||||
public boolean hasNoFilteredResults() {
|
||||
return hasSearchResults() && mAccessibilityResultsCount == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets results list for search
|
||||
*/
|
||||
@@ -249,15 +237,6 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
// ordered set of sections
|
||||
if (hasSearchResults()) {
|
||||
mAdapterItems.addAll(mSearchResults);
|
||||
if (!FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
|
||||
// Append the search market item
|
||||
if (hasNoFilteredResults()) {
|
||||
mAdapterItems.add(new AdapterItem(VIEW_TYPE_EMPTY_SEARCH));
|
||||
} else {
|
||||
mAdapterItems.add(new AdapterItem(VIEW_TYPE_ALL_APPS_DIVIDER));
|
||||
}
|
||||
mAdapterItems.add(new AdapterItem(VIEW_TYPE_SEARCH_MARKET));
|
||||
}
|
||||
} else {
|
||||
int position = 0;
|
||||
if (mWorkProviderManager != null) {
|
||||
|
||||
@@ -19,7 +19,6 @@ import static com.android.launcher3.touch.ItemLongClickListener.INSTANCE_ALL_APP
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -54,19 +53,13 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
public static final int VIEW_TYPE_ICON = 1 << 1;
|
||||
// The message shown when there are no filtered results
|
||||
public static final int VIEW_TYPE_EMPTY_SEARCH = 1 << 2;
|
||||
// The message to continue to a market search when there are no filtered results
|
||||
public static final int VIEW_TYPE_SEARCH_MARKET = 1 << 3;
|
||||
|
||||
// We use various dividers for various purposes. They share enough attributes to reuse layouts,
|
||||
// but differ in enough attributes to require different view types
|
||||
|
||||
// A divider that separates the apps list and the search market button
|
||||
public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 4;
|
||||
public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 3;
|
||||
|
||||
public static final int VIEW_TYPE_WORK_EDU_CARD = 1 << 5;
|
||||
public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 6;
|
||||
public static final int VIEW_TYPE_WORK_EDU_CARD = 1 << 4;
|
||||
public static final int VIEW_TYPE_WORK_DISABLED_CARD = 1 << 5;
|
||||
|
||||
public static final int NEXT_ID = 7;
|
||||
public static final int NEXT_ID = 6;
|
||||
|
||||
// Common view type masks
|
||||
public static final int VIEW_TYPE_MASK_DIVIDER = VIEW_TYPE_ALL_APPS_DIVIDER;
|
||||
@@ -117,7 +110,7 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
}
|
||||
|
||||
protected boolean isCountedForAccessibility() {
|
||||
return viewType == VIEW_TYPE_ICON || viewType == VIEW_TYPE_SEARCH_MARKET;
|
||||
return viewType == VIEW_TYPE_ICON;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,15 +132,12 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
protected final T mActivityContext;
|
||||
protected final AlphabeticalAppsList<T> mApps;
|
||||
// The text to show when there are no search results and no market search handler.
|
||||
protected String mEmptySearchMessage;
|
||||
protected int mAppsPerRow;
|
||||
|
||||
protected final LayoutInflater mLayoutInflater;
|
||||
protected final OnClickListener mOnIconClickListener;
|
||||
protected OnLongClickListener mOnIconLongClickListener = INSTANCE_ALL_APPS;
|
||||
protected OnFocusChangeListener mIconFocusListener;
|
||||
// The click listener to send off to the market app, updated each time the search query changes.
|
||||
private OnClickListener mMarketSearchClickListener;
|
||||
private final int mExtraHeight;
|
||||
|
||||
public BaseAllAppsAdapter(T activityContext, LayoutInflater inflater,
|
||||
@@ -155,7 +145,6 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
Resources res = activityContext.getResources();
|
||||
mActivityContext = activityContext;
|
||||
mApps = apps;
|
||||
mEmptySearchMessage = res.getString(R.string.all_apps_loading_message);
|
||||
mLayoutInflater = inflater;
|
||||
|
||||
mOnIconClickListener = mActivityContext.getItemOnClickListener();
|
||||
@@ -185,16 +174,6 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
mIconFocusListener = focusListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the last search query that was made, used to show when there are no results and to also
|
||||
* seed the intent for searching the market.
|
||||
*/
|
||||
public void setLastSearchQuery(String query, OnClickListener marketSearchClickListener) {
|
||||
Resources res = mActivityContext.getResources();
|
||||
mEmptySearchMessage = res.getString(R.string.all_apps_no_search_results, query);
|
||||
mMarketSearchClickListener = marketSearchClickListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the layout manager.
|
||||
*/
|
||||
@@ -222,11 +201,6 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
case VIEW_TYPE_EMPTY_SEARCH:
|
||||
return new ViewHolder(mLayoutInflater.inflate(R.layout.all_apps_empty_search,
|
||||
parent, false));
|
||||
case VIEW_TYPE_SEARCH_MARKET:
|
||||
View searchMarketView = mLayoutInflater.inflate(R.layout.all_apps_search_market,
|
||||
parent, false);
|
||||
searchMarketView.setOnClickListener(mMarketSearchClickListener);
|
||||
return new ViewHolder(searchMarketView);
|
||||
case VIEW_TYPE_ALL_APPS_DIVIDER:
|
||||
return new ViewHolder(mLayoutInflater.inflate(
|
||||
R.layout.all_apps_divider, parent, false));
|
||||
@@ -248,26 +222,21 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
switch (holder.getItemViewType()) {
|
||||
case VIEW_TYPE_ICON:
|
||||
case VIEW_TYPE_ICON: {
|
||||
AdapterItem adapterItem = mApps.getAdapterItems().get(position);
|
||||
BubbleTextView icon = (BubbleTextView) holder.itemView;
|
||||
icon.reset();
|
||||
icon.applyFromApplicationInfo(adapterItem.itemInfo);
|
||||
break;
|
||||
case VIEW_TYPE_EMPTY_SEARCH:
|
||||
TextView emptyViewText = (TextView) holder.itemView;
|
||||
emptyViewText.setText(mEmptySearchMessage);
|
||||
emptyViewText.setGravity(mApps.hasNoFilteredResults() ? Gravity.CENTER :
|
||||
Gravity.START | Gravity.CENTER_VERTICAL);
|
||||
break;
|
||||
case VIEW_TYPE_SEARCH_MARKET:
|
||||
TextView searchView = (TextView) holder.itemView;
|
||||
if (mMarketSearchClickListener != null) {
|
||||
searchView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
searchView.setVisibility(View.GONE);
|
||||
}
|
||||
case VIEW_TYPE_EMPTY_SEARCH: {
|
||||
AppInfo info = mApps.getAdapterItems().get(position).itemInfo;
|
||||
if (info != null) {
|
||||
((TextView) holder.itemView).setText(mActivityContext.getString(
|
||||
R.string.all_apps_no_search_results, info.title));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VIEW_TYPE_ALL_APPS_DIVIDER:
|
||||
case VIEW_TYPE_WORK_DISABLED_CARD:
|
||||
// nothing to do
|
||||
|
||||
@@ -131,7 +131,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText
|
||||
public void initializeSearch(ActivityAllAppsContainerView<?> appsView) {
|
||||
mAppsView = appsView;
|
||||
mSearchBarController.initialize(
|
||||
new DefaultAppSearchAlgorithm(getContext()),
|
||||
new DefaultAppSearchAlgorithm(getContext(), true),
|
||||
this, mLauncher, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.launcher3.allapps.search;
|
||||
|
||||
import static com.android.launcher3.allapps.BaseAllAppsAdapter.VIEW_TYPE_EMPTY_SEARCH;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -44,10 +45,16 @@ public class DefaultAppSearchAlgorithm implements SearchAlgorithm<AdapterItem> {
|
||||
|
||||
private final LauncherAppState mAppState;
|
||||
private final Handler mResultHandler;
|
||||
private final boolean mAddNoResultsMessage;
|
||||
|
||||
public DefaultAppSearchAlgorithm(Context context) {
|
||||
this(context, false);
|
||||
}
|
||||
|
||||
public DefaultAppSearchAlgorithm(Context context, boolean addNoResultsMessage) {
|
||||
mAppState = LauncherAppState.getInstance(context);
|
||||
mResultHandler = new Handler(MAIN_EXECUTOR.getLooper());
|
||||
mAddNoResultsMessage = addNoResultsMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,11 +70,23 @@ public class DefaultAppSearchAlgorithm implements SearchAlgorithm<AdapterItem> {
|
||||
@Override
|
||||
public void execute(LauncherAppState app, BgDataModel dataModel, AllAppsList apps) {
|
||||
ArrayList<AdapterItem> result = getTitleMatchResult(apps.data, query);
|
||||
if (mAddNoResultsMessage && result.isEmpty()) {
|
||||
result.add(getEmptyMessageAdapterItem(query));
|
||||
}
|
||||
mResultHandler.post(() -> callback.onSearchResult(query, result));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static AdapterItem getEmptyMessageAdapterItem(String query) {
|
||||
AdapterItem item = new AdapterItem(VIEW_TYPE_EMPTY_SEARCH);
|
||||
// Add a place holder info to propagate the query
|
||||
AppInfo placeHolder = new AppInfo();
|
||||
placeHolder.title = query;
|
||||
item.itemInfo = placeHolder;
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters {@link AppInfo}s matching specified query
|
||||
*/
|
||||
|
||||
@@ -64,6 +64,8 @@ public class StateAnimationConfig {
|
||||
ANIM_DEPTH,
|
||||
ANIM_OVERVIEW_ACTIONS_FADE,
|
||||
ANIM_WORKSPACE_PAGE_TRANSLATE_X,
|
||||
ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN,
|
||||
ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface AnimType {}
|
||||
@@ -84,8 +86,10 @@ public class StateAnimationConfig {
|
||||
public static final int ANIM_DEPTH = 13;
|
||||
public static final int ANIM_OVERVIEW_ACTIONS_FADE = 14;
|
||||
public static final int ANIM_WORKSPACE_PAGE_TRANSLATE_X = 15;
|
||||
public static final int ANIM_OVERVIEW_SPLIT_SELECT_FLOATING_TASK_TRANSLATE_OFFSCREEN = 17;
|
||||
public static final int ANIM_OVERVIEW_SPLIT_SELECT_INSTRUCTIONS_FADE = 18;
|
||||
|
||||
private static final int ANIM_TYPES_COUNT = 17;
|
||||
private static final int ANIM_TYPES_COUNT = 19;
|
||||
|
||||
protected final Interpolator[] mInterpolators = new Interpolator[ANIM_TYPES_COUNT];
|
||||
|
||||
|
||||
@@ -523,6 +523,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
iconParams.rightMargin = -taskIconHeight - taskIconMargin / 2;
|
||||
iconParams.leftMargin = 0;
|
||||
iconParams.topMargin = thumbnailTopMargin / 2;
|
||||
iconParams.bottomMargin = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -580,4 +581,22 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
||||
FloatProperty secondary, DeviceProfile deviceProfile) {
|
||||
return new Pair<>(primary, secondary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
|
||||
@StagePosition int stagePosition, DeviceProfile dp) {
|
||||
float currentTranslationY = floatingTask.getTranslationY();
|
||||
return currentTranslationY - onScreenRect.height();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation,
|
||||
DeviceProfile dp) {
|
||||
floatingTask.setTranslationY(translation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) {
|
||||
return floatingTask.getTranslationY();
|
||||
}
|
||||
}
|
||||
@@ -34,9 +34,9 @@ import android.widget.LinearLayout;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -242,6 +242,41 @@ public interface PagedOrientationHandler {
|
||||
*/
|
||||
void fixBoundsForHomeAnimStartRect(RectF outStartRect, DeviceProfile deviceProfile);
|
||||
|
||||
/**
|
||||
* Determine the target translation for animating the FloatingTaskView out. This value could
|
||||
* either be an x-coordinate or a y-coordinate, depending on which way the FloatingTaskView was
|
||||
* docked.
|
||||
*
|
||||
* @param floatingTask The FloatingTaskView.
|
||||
* @param onScreenRect The current on-screen dimensions of the FloatingTaskView.
|
||||
* @param stagePosition STAGE_POSITION_TOP_OR_LEFT or STAGE_POSITION_BOTTOM_OR_RIGHT.
|
||||
* @param dp The device profile.
|
||||
* @return A float. When an animation translates the FloatingTaskView to this position, it will
|
||||
* appear to tuck away off the edge of the screen.
|
||||
*/
|
||||
float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
|
||||
@StagePosition int stagePosition, DeviceProfile dp);
|
||||
|
||||
/**
|
||||
* Sets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be
|
||||
* either x or y), depending on how the view is oriented.
|
||||
*
|
||||
* @param floatingTask The FloatingTaskView to be translated.
|
||||
* @param translation The target translation value.
|
||||
* @param dp The current device profile.
|
||||
*/
|
||||
void setFloatingTaskPrimaryTranslation(View floatingTask, float translation, DeviceProfile dp);
|
||||
|
||||
/**
|
||||
* Gets the translation of a FloatingTaskView along its "slide-in/slide-out" axis (could be
|
||||
* either x or y), depending on how the view is oriented.
|
||||
*
|
||||
* @param floatingTask The FloatingTaskView in question.
|
||||
* @param dp The current device profile.
|
||||
* @return The current translation value.
|
||||
*/
|
||||
Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp);
|
||||
|
||||
class ChildBounds {
|
||||
|
||||
public final int primaryDimension;
|
||||
|
||||
@@ -52,9 +52,9 @@ import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.StagePosition;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
|
||||
import java.util.List;
|
||||
@@ -658,8 +658,9 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
public void setTaskIconParams(FrameLayout.LayoutParams iconParams, int taskIconMargin,
|
||||
int taskIconHeight, int thumbnailTopMargin, boolean isRtl) {
|
||||
iconParams.gravity = TOP | CENTER_HORIZONTAL;
|
||||
// Reset margins, since they may have been set on rotation
|
||||
iconParams.leftMargin = iconParams.rightMargin = 0;
|
||||
iconParams.topMargin = taskIconMargin;
|
||||
iconParams.topMargin = iconParams.bottomMargin = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -756,4 +757,36 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
return new Pair<>(secondary, primary);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloatingTaskOffscreenTranslationTarget(View floatingTask, RectF onScreenRect,
|
||||
@StagePosition int stagePosition, DeviceProfile dp) {
|
||||
if (dp.isLandscape) {
|
||||
float currentTranslationX = floatingTask.getTranslationX();
|
||||
return stagePosition == STAGE_POSITION_TOP_OR_LEFT
|
||||
? currentTranslationX - onScreenRect.width()
|
||||
: currentTranslationX + onScreenRect.width();
|
||||
} else {
|
||||
float currentTranslationY = floatingTask.getTranslationY();
|
||||
return currentTranslationY - onScreenRect.height();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFloatingTaskPrimaryTranslation(View floatingTask, float translation,
|
||||
DeviceProfile dp) {
|
||||
if (dp.isLandscape) {
|
||||
floatingTask.setTranslationX(translation);
|
||||
} else {
|
||||
floatingTask.setTranslationY(translation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Float getFloatingTaskPrimaryTranslation(View floatingTask, DeviceProfile dp) {
|
||||
return dp.isLandscape
|
||||
? floatingTask.getTranslationX()
|
||||
: floatingTask.getTranslationY();
|
||||
}
|
||||
}
|
||||
@@ -216,6 +216,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
|
||||
iconParams.leftMargin = -taskIconHeight - taskIconMargin / 2;
|
||||
iconParams.rightMargin = 0;
|
||||
iconParams.topMargin = thumbnailTopMargin / 2;
|
||||
iconParams.bottomMargin = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user