add kotlin support for launcher
Bug: 193432925 Test: click on the app icon and check logcat Change-Id: I2ca4d57105fe4e1b1dfc6c968a7c1bbd3cbd2151
This commit is contained in:
parent
75c97f534b
commit
26f44911a6
16
Android.bp
16
Android.bp
|
@ -152,9 +152,13 @@ android_app {
|
|||
],
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
"src_shortcuts_overrides/**/*.java",
|
||||
"src_shortcuts_overrides/**/*.kt",
|
||||
"src_ui_overrides/**/*.java",
|
||||
"src_ui_overrides/**/*.kt",
|
||||
"ext_tests/src/**/*.java",
|
||||
"ext_tests/src/**/*.kt",
|
||||
],
|
||||
resource_dirs: [
|
||||
"ext_tests/res",
|
||||
|
@ -211,7 +215,10 @@ android_library {
|
|||
// Source code used for test helpers
|
||||
filegroup {
|
||||
name: "launcher-src-ext-tests",
|
||||
srcs: ["ext_tests/src/**/*.java"],
|
||||
srcs: [
|
||||
"ext_tests/src/**/*.java",
|
||||
"ext_tests/src/**/*.kt",
|
||||
],
|
||||
}
|
||||
|
||||
// Common source files used to build launcher
|
||||
|
@ -219,8 +226,11 @@ filegroup {
|
|||
name: "launcher-src-no-build-config",
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
"src_shortcuts_overrides/**/*.java",
|
||||
"src_shortcuts_overrides/**/*.kt",
|
||||
"quickstep/src/**/*.java",
|
||||
"quickstep/src/**/*.kt",
|
||||
],
|
||||
}
|
||||
|
||||
|
@ -235,9 +245,13 @@ android_library {
|
|||
name: "LauncherGoResLib",
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
"quickstep/src/**/*.java",
|
||||
"quickstep/src/**/*.kt",
|
||||
"go/src/**/*.java",
|
||||
"go/src/**/*.kt",
|
||||
"go/quickstep/src/**/*.java",
|
||||
"go/quickstep/src/**/*.kt",
|
||||
],
|
||||
resource_dirs: [
|
||||
"go/res",
|
||||
|
|
|
@ -105,7 +105,7 @@ else
|
|||
LOCAL_SDK_VERSION := system_current
|
||||
LOCAL_MIN_SDK_VERSION := 26
|
||||
endif
|
||||
LOCAL_STATIC_ANDROID_LIBRARIES := Launcher3CommonDepsLib
|
||||
LOCAL_STATIC_ANDROID_LIBRARIES := LauncherGoResLib
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(call all-java-files-under, src) \
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.util.Log;
|
|||
import com.android.systemui.shared.recents.model.Task.TaskKey;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
|
@ -117,7 +118,7 @@ public class TaskKeyLruCache<V> {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Entry<Integer, TaskKeyLruCache.Entry<V>> eldest) {
|
||||
protected boolean removeEldestEntry(Map.Entry<Integer, TaskKeyLruCache.Entry<V>> eldest) {
|
||||
return size() > mMaxSize;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package com.android.quickstep.views
|
||||
|
||||
import android.util.Log
|
||||
|
||||
// TODO(http://b/193432925)
|
||||
class TaskMenuViewWithArrow {
|
||||
companion object {
|
||||
const val TAG = "TaskMenuViewWithArrow"
|
||||
|
||||
fun logSomething() {
|
||||
Log.d(TAG, "It worked!")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -115,6 +115,7 @@ import java.util.stream.Stream;
|
|||
public class TaskView extends FrameLayout implements Reusable {
|
||||
|
||||
private static final String TAG = TaskView.class.getSimpleName();
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
public static final int FLAG_UPDATE_ICON = 1;
|
||||
public static final int FLAG_UPDATE_THUMBNAIL = FLAG_UPDATE_ICON << 1;
|
||||
|
@ -808,6 +809,8 @@ public class TaskView extends FrameLayout implements Reusable {
|
|||
}
|
||||
|
||||
protected boolean showTaskMenuWithContainer(IconView iconView) {
|
||||
// TODO(http://b/193432925)
|
||||
if (DEBUG) TaskMenuViewWithArrow.Companion.logSomething();
|
||||
return TaskMenuView.showForTask(mTaskIdAttributeContainer[0]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue