mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Add empty view to desktop tile in overview" into tm-qpr-dev
This commit is contained in:
25
quickstep/res/drawable/ic_empty_desktop.xml
Normal file
25
quickstep/res/drawable/ic_empty_desktop.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (C) 2023 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="92dp"
|
||||
android:height="80dp"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:viewportHeight="80.0"
|
||||
android:viewportWidth="92.0">
|
||||
<path
|
||||
android:fillColor="#AAFFFFFF"
|
||||
android:pathData="M 14.365954,80 Q 10.981668,80 8.4908345,77.509166 6,75.018332 6,71.634046 V 36.193807 q 0,-3.384286 2.4908345,-5.87512 2.4908335,-2.493091 5.8751195,-2.493091 H 22.35738 V 8.365954 q 0,-3.3842855 2.538217,-5.8751198 Q 27.433811,0 30.723337,0 h 46.910711 q 3.479041,0 5.969878,2.4908342 2.490834,2.4908343 2.490834,5.8751198 v 35.442495 q 0,3.384286 -2.490834,5.87512 -2.490837,2.490835 -5.969878,2.490835 h -7.896671 v 19.459642 q 0,3.384286 -2.49083,5.87512 Q 64.755713,80 61.371423,80 Z m 0,-8.365954 h 47.005469 q 0,0 0,0 0,0 0,0 V 43.526426 H 14.365954 v 28.10762 q 0,0 0,0 0,0 0,0 z M 69.737377,43.808449 h 7.896671 q 0,0 0,0 0,0 0,0 V 15.698573 H 30.723337 v 12.127023 h 30.740592 q 3.479048,0 5.877376,2.445711 2.396072,2.443454 2.396072,5.82774 z" />
|
||||
</vector>
|
||||
@@ -32,6 +32,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/overview_task_margin"
|
||||
android:drawablePadding="@dimen/recents_empty_message_text_padding"
|
||||
android:text="@string/recents_empty_desktop_message"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/recents_empty_message_text_size"
|
||||
android:drawableTop="@drawable/ic_empty_desktop"
|
||||
android:drawableTint="?android:attr/textColorPrimary" />
|
||||
|
||||
<!--
|
||||
TODO(b249371338): DesktopTaskView extends from TaskView. TaskView expects TaskThumbnailView
|
||||
and IconView with these ids to be present. Need to refactor RecentsView to accept child
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
<!-- Recents: The empty recents string. [CHAR LIMIT=NONE] -->
|
||||
<string name="recents_empty_message">No recent items</string>
|
||||
|
||||
<!-- Recents: The empty recents desktop tile string. [CHAR LIMIT=NONE] -->
|
||||
<string name="recents_empty_desktop_message">No desktop items</string>
|
||||
|
||||
<!-- Content description for the recent apps's accessibility option that opens its usage settings. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_app_usage_settings">App usage settings</string>
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ public class DesktopTaskView extends TaskView {
|
||||
private final ArrayList<CancellableTask<?>> mPendingThumbnailRequests = new ArrayList<>();
|
||||
|
||||
private View mBackgroundView;
|
||||
private View mEmptyView;
|
||||
|
||||
public DesktopTaskView(Context context) {
|
||||
this(context, null);
|
||||
@@ -110,6 +111,7 @@ public class DesktopTaskView extends TaskView {
|
||||
super.onFinishInflate();
|
||||
|
||||
mBackgroundView = findViewById(R.id.background);
|
||||
mEmptyView = findViewById(R.id.empty_view);
|
||||
|
||||
int topMarginPx =
|
||||
mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx;
|
||||
@@ -185,6 +187,8 @@ public class DesktopTaskView extends TaskView {
|
||||
mSnapshotViewMap.put(task.key.id, snapshotView);
|
||||
}
|
||||
|
||||
mEmptyView.setVisibility(mTasks.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
updateTaskIdContainer();
|
||||
updateTaskIdAttributeContainer();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user