commit afc6f94450c3a1ab624b508003c2b6fa089b9eb3 Author: Nolen Johnson Date: Wed Feb 17 18:02:13 2021 -0500 extra: Initial commit diff --git a/OpenWeatherProvider/Android.mk b/OpenWeatherProvider/Android.mk new file mode 100644 index 0000000..7bb9c09 --- /dev/null +++ b/OpenWeatherProvider/Android.mk @@ -0,0 +1,28 @@ +# Copyright (C) 2017-2018 The LineageOS 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. + +# This file is generated by device/motorola/nash/setup-makefiles.sh + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := OpenWeatherProviderPrebuilt +LOCAL_MODULE_OWNER := lineage +LOCAL_SRC_FILES := OpenWeatherProviderPrebuilt.apk +LOCAL_CERTIFICATE := PRESIGNED +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := APPS +LOCAL_DEX_PREOPT := false +LOCAL_MODULE_SUFFIX := .apk +include $(BUILD_PREBUILT) diff --git a/OpenWeatherProvider/OpenWeatherProviderPrebuilt.apk b/OpenWeatherProvider/OpenWeatherProviderPrebuilt.apk new file mode 100755 index 0000000..43ab42f Binary files /dev/null and b/OpenWeatherProvider/OpenWeatherProviderPrebuilt.apk differ diff --git a/adb_keys b/adb_keys new file mode 100644 index 0000000..692447a --- /dev/null +++ b/adb_keys @@ -0,0 +1,3 @@ +QAAAABtLfTbt6OPLZT4fn/3A+qzkvtN9Rv0exmMUPkfTzwrectlxLZlY9fRzxvcKB4wojiVJGY8BhW8yH8n1AEBWGvnkQxPT5+RBYp/pcouYOcAd9bTRvzKI/rxLN3NvHuQAuqZpkpk2JPLsnOZL5BiNyidxukxObbRG2qSSo4xrthGvyKMQXPAAnwoPCn0WtWigJ8BsQ/1037PfjCJnvsin8guLQul/yHFLvC8LzsU/sfwVqRmn4MkVOhyimQ67gvn053gtVPx1kLEL2nvqPPjEXFfBHawAy28tDYSyaddcTOY3tbakXDIi2YKCM+tp0X0s0Kur0ygIwZaqk/EUI2LpbueP1CfUwTRexY1k38pv51UzhfAQihz8DWr+fNlUAQzufaZ3Sa3OpYF2Yhj0VPG8+DkP1gxVasLRp6SeFpHvRcHDPgxMSch0jwxQj/bZT7IzEGlPWSIlU3yV1+utqM41J5m96J/U4iPCIryD6vN+UbF92MAGDI+O+S7ghlW6BN8NGNMD0gEVlxUNpTCKNo/6YRgqC5X06rHjo3MrpUCdlDuzbiZB4GISt3OslcUknE89SrOG2WX5gM1xBLsMdWBWtfg9ln/Uy14PgickdfzQuDpKiQZHTKjRAjeFqP+T3ugklwfDpyy5EfX+757lUzsUm2YYjG+kpY074JhiaA4asldOd/O1FQEAAQA= nolenjohnson@ODS-SB +QAAAAAFHlzT/RuZ19fbZwSBwT//MnTQnKWx6gbQS48tyIwo+cqO3aFqvDgifK1klhcZYRIilf60P/ZxEN8QnNu++XEa3Gm/MSgMVmAPFurRDEabf2sNn02yQd+kc7LT2035kyZOLScFgyCOu+bmMOZpxzAM/yh9EAHlSNnqUNLyX1fp+gpUMHyXu534WZnuuXUyAhld+z4BzuBVNMQfTF4m1jHsOHpJLyCzgjnN9WJFqYE/MvlcwS+TovZ/fEps58o+4FaL0jmm6N7UqhNRE+KTlBjUSRkxGT8ZWb97gQvVFKU8JpZ0fuQRUDpX7BBBonER3Zi5XVbAMhybj6FqqteUoTNP+33CXl+iGTcUMYMqAnuB2tHYl8TOMMHa91oFh6x9C2yGNBkmvL30yBDpM1aTv8ahHOw4WNns7xHBHozA+jXxLliLeRQ4/uGOSUkpmYU67NrZc/s4cxxqL+UNWBDVI1fsKL2Rq/0GiYZMw+k3HY5hNq7m+Wa6VH9gi5DDKAvMCxo1omhghpz1u5BoPZ58oHcldwg7kDT167yBSNXBwFMemrISBKvvYAH2xhM3Bh8WBHtCHzVDKrohSHNGyLUC4ltknzljCqsaBYmnfLtziSpltDoF8Krf8QwEDPpYS89x73oLI8WVfZ3mtueh064ZtAGS+Wn9msuz/Jz6nQaBCWnUPltjlKQEAAQA= nolenjohnson@DD-NJOHNSON.local +QAAAAKf8QKfpFJuf1jF2rcoPaWBx9Ej0W91VsPiI8czhWDPvaAE8CGUzP/w/PJBjxJqgTU4uFVCiDHHIv2VB6M8l3TAUG8iYflZLfoKf0BuSkK5W3xD2rPf0EgI9KL+CVSrr2J/6DgZ22pmfihcQrd3T+uBUlPJJDSD3lnYY0OSBHaydttTQTw8oyUS4DfhBKS5k6BEKY3cGkh6CLh5cHXikH965Vl3w/hVL1KvcolNxxqiLI1TKcyLpP7ioD+esxWU6DI440rzlHIkl/j4GDIpDQKhHxOX84kDHCklyjE/t9PKWQ7dJ6eSE0MHAqzbAXDVrzALva7qvg0TcTbcKzRbGudCsKxel4TgE5VxiYoAbHGIupZgEb6f1po13mBqkKeg5vy79jSgtpg2cY2zW1TgsrzwJLCymOYOP6S+3tqQbEYkp28ARo3wlTj/GXbT4cnfl1mleegFVClVj3xyZBdITgxnNIi2dj1lvpGgPdX+gapnkrBfujtowqYGfAkrd3hxXW6fr6BTH9QnJkw+a2cyBp+8qYxZW3GWBhYPlHfRuZlC2wENqHOZCgUnRZxZfVYSPk7MHIO4EYQL6u/cLxK4llCgvpIQQUIMo3YIkd3C+IgQ0Go9eRA1yBl1Y2xNtK5dC8bYPhR3upYmv+l3iaq8KWaDSDeb1ACgPtMm7l8tgTbO0LFxLcQEAAQA= nolenjohnson@ODS-PRO diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..4f1a23e --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,5 @@ + + + true + M50 0C77.6 0 100 22.4 100 50C100 77.6 77.6 100 50 100C22.4 100 0 77.6 0 50C0 22.4 22.4 0 50 0Z + diff --git a/overlay/packages/apps/DocumentsUI/res/mipmap-anydpi/ic_app_icon.xml b/overlay/packages/apps/DocumentsUI/res/mipmap-anydpi/ic_app_icon.xml new file mode 100644 index 0000000..e2819f2 --- /dev/null +++ b/overlay/packages/apps/DocumentsUI/res/mipmap-anydpi/ic_app_icon.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/overlay/packages/apps/DocumentsUI/res/mipmap-hdpi/ic_foreground.png b/overlay/packages/apps/DocumentsUI/res/mipmap-hdpi/ic_foreground.png new file mode 100644 index 0000000..992c44e Binary files /dev/null and b/overlay/packages/apps/DocumentsUI/res/mipmap-hdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/DocumentsUI/res/mipmap-mdpi/ic_foreground.png b/overlay/packages/apps/DocumentsUI/res/mipmap-mdpi/ic_foreground.png new file mode 100644 index 0000000..4639ff0 Binary files /dev/null and b/overlay/packages/apps/DocumentsUI/res/mipmap-mdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/DocumentsUI/res/mipmap-xhdpi/ic_foreground.png b/overlay/packages/apps/DocumentsUI/res/mipmap-xhdpi/ic_foreground.png new file mode 100644 index 0000000..b992944 Binary files /dev/null and b/overlay/packages/apps/DocumentsUI/res/mipmap-xhdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/DocumentsUI/res/mipmap-xxhdpi/ic_foreground.png b/overlay/packages/apps/DocumentsUI/res/mipmap-xxhdpi/ic_foreground.png new file mode 100644 index 0000000..ae44b2f Binary files /dev/null and b/overlay/packages/apps/DocumentsUI/res/mipmap-xxhdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/DocumentsUI/res/mipmap-xxxhdpi/ic_foreground.png b/overlay/packages/apps/DocumentsUI/res/mipmap-xxxhdpi/ic_foreground.png new file mode 100644 index 0000000..85150eb Binary files /dev/null and b/overlay/packages/apps/DocumentsUI/res/mipmap-xxxhdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/LineageParts/res/values/arrays.xml b/overlay/packages/apps/LineageParts/res/values/arrays.xml new file mode 100644 index 0000000..8c71a99 --- /dev/null +++ b/overlay/packages/apps/LineageParts/res/values/arrays.xml @@ -0,0 +1,18 @@ + + + + + org.lineageos.overlay.accent.red + org.lineageos.overlay.accent.pink + org.lineageos.overlay.accent.purple + org.lineageos.overlay.accent.blue + org.lineageos.overlay.accent.cyan + org.lineageos.overlay.accent.green + org.lineageos.overlay.accent.orange + org.lineageos.overlay.accent.yellow + org.lineageos.overlay.accent.brown + org.lineageos.overlay.accent.black + com.google.android.theme.pixel + + + diff --git a/overlay/packages/apps/Settings/res/mipmap-anydpi/ic_launcher.xml b/overlay/packages/apps/Settings/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..c6241fe --- /dev/null +++ b/overlay/packages/apps/Settings/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/overlay/packages/apps/Settings/res/mipmap-hdpi/ic_foreground.png b/overlay/packages/apps/Settings/res/mipmap-hdpi/ic_foreground.png new file mode 100644 index 0000000..ddce98e Binary files /dev/null and b/overlay/packages/apps/Settings/res/mipmap-hdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/Settings/res/mipmap-mdpi/ic_foreground.png b/overlay/packages/apps/Settings/res/mipmap-mdpi/ic_foreground.png new file mode 100644 index 0000000..86f3be8 Binary files /dev/null and b/overlay/packages/apps/Settings/res/mipmap-mdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/Settings/res/mipmap-xhdpi/ic_foreground.png b/overlay/packages/apps/Settings/res/mipmap-xhdpi/ic_foreground.png new file mode 100644 index 0000000..360aa69 Binary files /dev/null and b/overlay/packages/apps/Settings/res/mipmap-xhdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/Settings/res/mipmap-xxhdpi/ic_foreground.png b/overlay/packages/apps/Settings/res/mipmap-xxhdpi/ic_foreground.png new file mode 100644 index 0000000..7cb67a9 Binary files /dev/null and b/overlay/packages/apps/Settings/res/mipmap-xxhdpi/ic_foreground.png differ diff --git a/overlay/packages/apps/Settings/res/mipmap-xxxhdpi/ic_foreground.png b/overlay/packages/apps/Settings/res/mipmap-xxxhdpi/ic_foreground.png new file mode 100644 index 0000000..3fec9c4 Binary files /dev/null and b/overlay/packages/apps/Settings/res/mipmap-xxxhdpi/ic_foreground.png differ diff --git a/pixel-theme/Android.mk b/pixel-theme/Android.mk new file mode 100644 index 0000000..12fe37f --- /dev/null +++ b/pixel-theme/Android.mk @@ -0,0 +1,26 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional + +LOCAL_PACKAGE_NAME := PixelTheme +LOCAL_SDK_VERSION := current +LOCAL_CERTIFICATE := platform +LOCAL_PRIVILEGED_MODULE := false +#LOCAL_SRC_FILES := $(call all-subdir-java-files) + +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res + +#LOCAL_STATIC_JAVA_LIBRARIES := \ +# android-support-v7-recyclerview \ +# android-support-v7-preference \ +# android-support-v7-appcompat \ +# android-support-v14-preference \ +# android-support-v17-leanback \ +# android-support-v7-palette \ +# android-support-v4 \ +# SystemUI-proto \ +# SystemUI-tags \ +# uicommon + +include $(BUILD_PACKAGE) diff --git a/pixel-theme/AndroidManifest.xml b/pixel-theme/AndroidManifest.xml new file mode 100644 index 0000000..ef32312 --- /dev/null +++ b/pixel-theme/AndroidManifest.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/pixel-theme/res/drawable-land-v26/ic_sysbar_docked.xml b/pixel-theme/res/drawable-land-v26/ic_sysbar_docked.xml new file mode 100644 index 0000000..de0d881 --- /dev/null +++ b/pixel-theme/res/drawable-land-v26/ic_sysbar_docked.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-ldrtl-v26/ic_sysbar_back.xml b/pixel-theme/res/drawable-ldrtl-v26/ic_sysbar_back.xml new file mode 100644 index 0000000..a76d25e --- /dev/null +++ b/pixel-theme/res/drawable-ldrtl-v26/ic_sysbar_back.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/halo.xml b/pixel-theme/res/drawable-v26/halo.xml new file mode 100644 index 0000000..e6ff45f --- /dev/null +++ b/pixel-theme/res/drawable-v26/halo.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_back.xml b/pixel-theme/res/drawable-v26/ic_sysbar_back.xml new file mode 100644 index 0000000..91647d4 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_back.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_back_dark.xml b/pixel-theme/res/drawable-v26/ic_sysbar_back_dark.xml new file mode 100644 index 0000000..67edbf8 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_back_dark.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_back_ime.xml b/pixel-theme/res/drawable-v26/ic_sysbar_back_ime.xml new file mode 100644 index 0000000..d8e3c49 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_back_ime.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_back_ime_dark.xml b/pixel-theme/res/drawable-v26/ic_sysbar_back_ime_dark.xml new file mode 100644 index 0000000..29f1f40 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_back_ime_dark.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_docked.xml b/pixel-theme/res/drawable-v26/ic_sysbar_docked.xml new file mode 100644 index 0000000..62c8247 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_docked.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_docked_dark.xml b/pixel-theme/res/drawable-v26/ic_sysbar_docked_dark.xml new file mode 100644 index 0000000..6415fbd --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_docked_dark.xml @@ -0,0 +1,27 @@ + + + + + + + diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_home.xml b/pixel-theme/res/drawable-v26/ic_sysbar_home.xml new file mode 100644 index 0000000..7eb8b55 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_home.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_home_dark.xml b/pixel-theme/res/drawable-v26/ic_sysbar_home_dark.xml new file mode 100644 index 0000000..b6f6c43 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_home_dark.xml @@ -0,0 +1,27 @@ + + + + + + + diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_opa_blue.xml b/pixel-theme/res/drawable-v26/ic_sysbar_opa_blue.xml new file mode 100644 index 0000000..a3df91c --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_opa_blue.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_opa_green.xml b/pixel-theme/res/drawable-v26/ic_sysbar_opa_green.xml new file mode 100644 index 0000000..6814ba1 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_opa_green.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_opa_red.xml b/pixel-theme/res/drawable-v26/ic_sysbar_opa_red.xml new file mode 100644 index 0000000..5d44c61 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_opa_red.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_opa_yellow.xml b/pixel-theme/res/drawable-v26/ic_sysbar_opa_yellow.xml new file mode 100644 index 0000000..e56b8c8 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_opa_yellow.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_recent.xml b/pixel-theme/res/drawable-v26/ic_sysbar_recent.xml new file mode 100644 index 0000000..ed54bd1 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_recent.xml @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/pixel-theme/res/drawable-v26/ic_sysbar_recent_dark.xml b/pixel-theme/res/drawable-v26/ic_sysbar_recent_dark.xml new file mode 100644 index 0000000..acc87e0 --- /dev/null +++ b/pixel-theme/res/drawable-v26/ic_sysbar_recent_dark.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/pixel-theme/res/layout/home.xml b/pixel-theme/res/layout/home.xml new file mode 100644 index 0000000..31bab82 --- /dev/null +++ b/pixel-theme/res/layout/home.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + diff --git a/pixel-theme/res/values/colors.xml b/pixel-theme/res/values/colors.xml new file mode 100644 index 0000000..a562edf --- /dev/null +++ b/pixel-theme/res/values/colors.xml @@ -0,0 +1,23 @@ + + + #ff5e97f6 + #ff5c6bc0 + #ff26a69a + #ffec407a + #ff33ac71 + #ff8bc34a + #ffff9800 + #ffff7043 + #ffea4335 + #ff2d2d2d + #ff2d2d2d + #ff242424 + #ff242424 + #ff3a3a3a + #ff616161 + #ff9e9e9e + #ff3367d6 + #ff4285f4 + #ff5e97f6 + #ffe8f0fe + diff --git a/pixel-theme/res/values/config.xml b/pixel-theme/res/values/config.xml new file mode 100644 index 0000000..08936b1 --- /dev/null +++ b/pixel-theme/res/values/config.xml @@ -0,0 +1,6 @@ + + + true + M50 0C77.6 0 100 22.4 100 50C100 77.6 77.6 100 50 100C22.4 100 0 77.6 0 50C0 22.4 22.4 0 50 0Z + true + diff --git a/pixel-theme/res/values/dimens.xml b/pixel-theme/res/values/dimens.xml new file mode 100644 index 0000000..43ca127 --- /dev/null +++ b/pixel-theme/res/values/dimens.xml @@ -0,0 +1,20 @@ + + + 70dp + 0dp + + + 10.0dip + 1.0dip + 22.0dip + 10.0dip + 16.0dip + 16.0dip + 15.0dip + 30.0dip + 46.0dip + 15.0dip + 8.0dip + -1.0dip + 7.0dip + diff --git a/pixel-theme/res/values/strings.xml b/pixel-theme/res/values/strings.xml new file mode 100644 index 0000000..9ae9163 --- /dev/null +++ b/pixel-theme/res/values/strings.xml @@ -0,0 +1,4 @@ + + + Home + diff --git a/pixel-theme/res/values/styles.xml b/pixel-theme/res/values/styles.xml new file mode 100644 index 0000000..9dfab7e --- /dev/null +++ b/pixel-theme/res/values/styles.xml @@ -0,0 +1,9 @@ + + + + diff --git a/pixel-theme/src/com/google/android/systemui/OpaLayout.java b/pixel-theme/src/com/google/android/systemui/OpaLayout.java new file mode 100644 index 0000000..61c932a --- /dev/null +++ b/pixel-theme/src/com/google/android/systemui/OpaLayout.java @@ -0,0 +1,583 @@ +package com.google.android.systemui; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.content.ContentResolver; +import android.content.Context; +import android.database.ContentObserver; +import android.graphics.drawable.Drawable; +import android.net.Uri; +import android.os.Handler; +import android.os.SystemClock; +import android.os.UserHandle; +import android.os.UserManager; +import android.provider.Settings; +import android.util.ArraySet; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewConfiguration; +import android.view.RenderNodeAnimator; +import android.view.animation.Interpolator; +import android.view.animation.PathInterpolator; +import android.widget.FrameLayout; +import android.widget.ImageView; + +import com.android.systemui.Interpolators; +import com.android.systemui.R; +import com.android.systemui.statusbar.phone.ButtonDispatcher; +import com.android.systemui.statusbar.policy.KeyButtonView; + +public class OpaLayout extends FrameLayout implements ButtonDispatcher.ButtonInterface{ + + private static final int ANIMATION_STATE_NONE = 0; + private static final int ANIMATION_STATE_DIAMOND = 1; + private static final int ANIMATION_STATE_RETRACT = 2; + private static final int ANIMATION_STATE_OTHER = 3; + + private static final int MIN_DIAMOND_DURATION = 100; + private static final int COLLAPSE_ANIMATION_DURATION_RY = 83; + private static final int COLLAPSE_ANIMATION_DURATION_BG = 100; + private static final int LINE_ANIMATION_DURATION_Y = 275; + private static final int LINE_ANIMATION_DURATION_X = 133; + private static final int RETRACT_ANIMATION_DURATION = 300; + private static final int DIAMOND_ANIMATION_DURATION = 200; + private static final int HALO_ANIMATION_DURATION = 100; + + private static final int DOTS_RESIZE_DURATION = 200; + private static final int HOME_RESIZE_DURATION = 83; + + private static final int HOME_REAPPEAR_ANIMATION_OFFSET = 33; + private static final int HOME_REAPPEAR_DURATION = 150; + + private static final float DIAMOND_DOTS_SCALE_FACTOR = 0.8f; + private static final float DIAMOND_HOME_SCALE_FACTOR = 0.625f; + private static final float HALO_SCALE_FACTOR = 0.47619048f; + + private KeyButtonView mHome; + + private int mAnimationState; + private final ArraySet mCurrentAnimators; + + private boolean mIsLandscape; + private boolean mIsPressed; + private boolean mLongClicked; + private boolean mOpaEnabled; + private long mStartTime; + + private View mRed; + private View mBlue; + private View mGreen; + private View mYellow; + private View mWhite; + private View mHalo; + + private View mTop; + private View mRight; + private View mLeft; + private View mBottom; + + private final Runnable mCheckLongPress; + private final Runnable mRetract; + + private final Interpolator mRetractInterpolator; + private final Interpolator mCollapseInterpolator; + private final Interpolator mDiamondInterpolator; + private final Interpolator mDotsFullSizeInterpolator; + private final Interpolator mFastOutSlowInInterpolator; + private final Interpolator mHomeDisappearInterpolator; + public OpaLayout(Context context) { + super(context); + mFastOutSlowInInterpolator = Interpolators.FAST_OUT_SLOW_IN; + mHomeDisappearInterpolator = new PathInterpolator(0.8f, 0f, 1f, 1f); + mCollapseInterpolator = Interpolators.FAST_OUT_LINEAR_IN; + mDotsFullSizeInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mRetractInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mDiamondInterpolator = new PathInterpolator(0.2f, 0f, 0.2f, 1f); + mCheckLongPress = new Runnable() { + @Override + public void run() { + if (mIsPressed) { + mLongClicked = true; + } + } + }; + mRetract = new Runnable() { + @Override + public void run() { + cancelCurrentAnimation(); + startRetractAnimation(); + } + }; + mAnimationState = ANIMATION_STATE_NONE; + mCurrentAnimators = new ArraySet(); + } + + public OpaLayout(Context context, AttributeSet attrs) { + super(context, attrs); + mFastOutSlowInInterpolator = Interpolators.FAST_OUT_SLOW_IN; + mHomeDisappearInterpolator = new PathInterpolator(0.8f, 0f, 1f, 1f); + mCollapseInterpolator = Interpolators.FAST_OUT_LINEAR_IN; + mDotsFullSizeInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mRetractInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mDiamondInterpolator = new PathInterpolator(0.2f, 0f, 0.2f, 1f); + mCheckLongPress = new Runnable() { + @Override + public void run() { + if (mIsPressed) { + mLongClicked = true; + } + } + }; + mRetract = new Runnable() { + @Override + public void run() { + cancelCurrentAnimation(); + startRetractAnimation(); + } + }; + mAnimationState = ANIMATION_STATE_NONE; + mCurrentAnimators = new ArraySet(); + } + + public OpaLayout(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + mFastOutSlowInInterpolator = Interpolators.FAST_OUT_SLOW_IN; + mHomeDisappearInterpolator = new PathInterpolator(0.8f, 0f, 1f, 1f); + mCollapseInterpolator = Interpolators.FAST_OUT_LINEAR_IN; + mDotsFullSizeInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mRetractInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mDiamondInterpolator = new PathInterpolator(0.2f, 0f, 0.2f, 1f); + mCheckLongPress = new Runnable() { + @Override + public void run() { + if (mIsPressed) { + mLongClicked = true; + } + } + }; + mRetract = new Runnable() { + @Override + public void run() { + cancelCurrentAnimation(); + startRetractAnimation(); + } + }; + mAnimationState = ANIMATION_STATE_NONE; + mCurrentAnimators = new ArraySet(); + } + + public OpaLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + mFastOutSlowInInterpolator = Interpolators.FAST_OUT_SLOW_IN; + mHomeDisappearInterpolator = new PathInterpolator(0.8f, 0f, 1f, 1f); + mCollapseInterpolator = Interpolators.FAST_OUT_LINEAR_IN; + mDotsFullSizeInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mRetractInterpolator = new PathInterpolator(0.4f, 0f, 0f, 1f); + mDiamondInterpolator = new PathInterpolator(0.2f, 0f, 0.2f, 1f); + mCheckLongPress = new Runnable() { + @Override + public void run() { + if (mIsPressed) { + mLongClicked = true; + } + } + }; + mRetract = new Runnable() { + @Override + public void run() { + cancelCurrentAnimation(); + startRetractAnimation(); + } + }; + mAnimationState = ANIMATION_STATE_NONE; + mCurrentAnimators = new ArraySet(); + } + + private void startAll(ArraySet animators) { + for(int i=0; i < animators.size(); i++) { + Animator curAnim = (Animator) mCurrentAnimators.valueAt(i); + curAnim.start(); + } + } + + private void startCollapseAnimation() { + mCurrentAnimators.clear(); + mCurrentAnimators.addAll(getCollapseAnimatorSet()); + mAnimationState = ANIMATION_STATE_OTHER; + startAll(mCurrentAnimators); + } + + private void startDiamondAnimation() { + mCurrentAnimators.clear(); + mCurrentAnimators.addAll(getDiamondAnimatorSet()); + mAnimationState = ANIMATION_STATE_DIAMOND; + startAll(mCurrentAnimators); + } + + private void startLineAnimation() { + mCurrentAnimators.clear(); + mCurrentAnimators.addAll(getLineAnimatorSet()); + mAnimationState = ANIMATION_STATE_OTHER; + startAll(mCurrentAnimators); + } + + private void startRetractAnimation() { + mCurrentAnimators.clear(); + mCurrentAnimators.addAll(getRetractAnimatorSet()); + mAnimationState = ANIMATION_STATE_RETRACT; + startAll(mCurrentAnimators); + } + + private void cancelCurrentAnimation() { + if(mCurrentAnimators.isEmpty()) + return; + for(int i=0; i < mCurrentAnimators.size(); i++) { + Animator curAnim = (Animator) mCurrentAnimators.valueAt(i); + curAnim.removeAllListeners(); + curAnim.cancel(); + } + mCurrentAnimators.clear(); + mAnimationState = ANIMATION_STATE_NONE; + } + + private void endCurrentAnimation() { + if(mCurrentAnimators.isEmpty()) + return; + for(int i=0; i < mCurrentAnimators.size(); i++) { + Animator curAnim = (Animator) mCurrentAnimators.valueAt(i); + curAnim.removeAllListeners(); + curAnim.end(); + } + mCurrentAnimators.clear(); + mAnimationState = ANIMATION_STATE_NONE; + } + + private ArraySet getCollapseAnimatorSet() { + final ArraySet set = new ArraySet(); + Animator animator; + if (mIsLandscape) { + animator = getDeltaAnimatorY(mRed, mCollapseInterpolator, -getPxVal(R.dimen.opa_line_x_collapse_ry), COLLAPSE_ANIMATION_DURATION_RY); + } else { + animator = getDeltaAnimatorX(mRed, mCollapseInterpolator, getPxVal(R.dimen.opa_line_x_collapse_ry), COLLAPSE_ANIMATION_DURATION_RY); + } + set.add(animator); + set.add(getScaleAnimatorX(mRed, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + set.add(getScaleAnimatorY(mRed, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + Animator animator2; + if (mIsLandscape) { + animator2 = getDeltaAnimatorY(mBlue, mCollapseInterpolator, -getPxVal(R.dimen.opa_line_x_collapse_bg), COLLAPSE_ANIMATION_DURATION_BG); + } else { + animator2 = getDeltaAnimatorX(mBlue, mCollapseInterpolator, getPxVal(R.dimen.opa_line_x_collapse_bg), COLLAPSE_ANIMATION_DURATION_BG); + } + set.add(animator2); + set.add(getScaleAnimatorX(mBlue, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + set.add(getScaleAnimatorY(mBlue, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + Animator animator3; + if (mIsLandscape) { + animator3 = getDeltaAnimatorY(mYellow, mCollapseInterpolator, getPxVal(R.dimen.opa_line_x_collapse_ry), COLLAPSE_ANIMATION_DURATION_RY); + } else { + animator3 = getDeltaAnimatorX(mYellow, mCollapseInterpolator, -getPxVal(R.dimen.opa_line_x_collapse_ry), COLLAPSE_ANIMATION_DURATION_RY); + } + set.add(animator3); + set.add(getScaleAnimatorX(mYellow, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + set.add(getScaleAnimatorY(mYellow, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + Animator animator4; + if (mIsLandscape) { + animator4 = getDeltaAnimatorY(mGreen, mCollapseInterpolator, getPxVal(R.dimen.opa_line_x_collapse_bg), COLLAPSE_ANIMATION_DURATION_BG); + } else { + animator4 = getDeltaAnimatorX(mGreen, mCollapseInterpolator, -getPxVal(R.dimen.opa_line_x_collapse_bg), COLLAPSE_ANIMATION_DURATION_BG); + } + set.add(animator4); + set.add(getScaleAnimatorX(mGreen, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + set.add(getScaleAnimatorY(mGreen, 1.0f, DOTS_RESIZE_DURATION, mDotsFullSizeInterpolator)); + final Animator scaleAnimatorX = getScaleAnimatorX(mWhite, 1.0f, HOME_REAPPEAR_DURATION, mFastOutSlowInInterpolator); + final Animator scaleAnimatorY = getScaleAnimatorY(mWhite, 1.0f, HOME_REAPPEAR_DURATION, mFastOutSlowInInterpolator); + final Animator scaleAnimatorX2 = getScaleAnimatorX(mHalo, 1.0f, HOME_REAPPEAR_DURATION, mFastOutSlowInInterpolator); + final Animator scaleAnimatorY2 = getScaleAnimatorY(mHalo, 1.0f, HOME_REAPPEAR_DURATION, mFastOutSlowInInterpolator); + scaleAnimatorX.setStartDelay(HOME_REAPPEAR_ANIMATION_OFFSET); + scaleAnimatorY.setStartDelay(HOME_REAPPEAR_ANIMATION_OFFSET); + scaleAnimatorX2.setStartDelay(HOME_REAPPEAR_ANIMATION_OFFSET); + scaleAnimatorY2.setStartDelay(HOME_REAPPEAR_ANIMATION_OFFSET); + set.add(scaleAnimatorX); + set.add(scaleAnimatorY); + set.add(scaleAnimatorX2); + set.add(scaleAnimatorY2); + getLongestAnim((set)).addListener((Animator.AnimatorListener)new AnimatorListenerAdapter() { + public void onAnimationEnd(final Animator animator) { + mCurrentAnimators.clear(); + mAnimationState = ANIMATION_STATE_NONE; + } + }); + return set; + } + + private ArraySet getDiamondAnimatorSet() { + final ArraySet set = new ArraySet(); + set.add(getDeltaAnimatorY(mTop, mDiamondInterpolator, -getPxVal(R.dimen.opa_diamond_translation), DIAMOND_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mTop, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mTop, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getDeltaAnimatorY(mBottom, mDiamondInterpolator, getPxVal(R.dimen.opa_diamond_translation), DIAMOND_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mBottom, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mBottom, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getDeltaAnimatorX(mLeft, mDiamondInterpolator, -getPxVal(R.dimen.opa_diamond_translation), DIAMOND_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mLeft, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mLeft, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getDeltaAnimatorX(mRight, mDiamondInterpolator, getPxVal(R.dimen.opa_diamond_translation), DIAMOND_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mRight, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mRight, DIAMOND_DOTS_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorX(mWhite, DIAMOND_HOME_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mWhite, DIAMOND_HOME_SCALE_FACTOR, DIAMOND_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorX(mHalo, HALO_SCALE_FACTOR, MIN_DIAMOND_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mHalo, HALO_SCALE_FACTOR, MIN_DIAMOND_DURATION, mFastOutSlowInInterpolator)); + getLongestAnim(set).addListener((Animator.AnimatorListener)new AnimatorListenerAdapter() { + public void onAnimationCancel(final Animator animator) { + mCurrentAnimators.clear(); + } + + public void onAnimationEnd(final Animator animator) { + startLineAnimation(); + } + }); + return set; + } + + private ArraySet getLineAnimatorSet() { + final ArraySet set = new ArraySet(); + if (mIsLandscape) { + set.add(getDeltaAnimatorY(mRed, mFastOutSlowInInterpolator, getPxVal(R.dimen.opa_line_x_trans_ry), LINE_ANIMATION_DURATION_Y)); + set.add(getDeltaAnimatorX(mRed, mFastOutSlowInInterpolator, getPxVal(R.dimen.opa_line_y_translation), LINE_ANIMATION_DURATION_X)); + set.add(getDeltaAnimatorY(mBlue, mFastOutSlowInInterpolator, getPxVal(R.dimen.opa_line_x_trans_bg), LINE_ANIMATION_DURATION_Y)); + set.add(getDeltaAnimatorY(mYellow, mFastOutSlowInInterpolator, -getPxVal(R.dimen.opa_line_x_trans_ry), LINE_ANIMATION_DURATION_Y)); + set.add(getDeltaAnimatorX(mYellow, mFastOutSlowInInterpolator, -getPxVal(R.dimen.opa_line_y_translation), LINE_ANIMATION_DURATION_X)); + set.add(getDeltaAnimatorY(mGreen, mFastOutSlowInInterpolator, -getPxVal(R.dimen.opa_line_x_trans_bg), LINE_ANIMATION_DURATION_Y)); + } else { + set.add(getDeltaAnimatorX(mRed, mFastOutSlowInInterpolator, -getPxVal(R.dimen.opa_line_x_trans_ry), LINE_ANIMATION_DURATION_Y)); + set.add(getDeltaAnimatorY(mRed, mFastOutSlowInInterpolator, getPxVal(R.dimen.opa_line_y_translation), LINE_ANIMATION_DURATION_X)); + set.add(getDeltaAnimatorX(mBlue, mFastOutSlowInInterpolator, -getPxVal(R.dimen.opa_line_x_trans_bg), LINE_ANIMATION_DURATION_Y)); + set.add(getDeltaAnimatorX(mYellow, mFastOutSlowInInterpolator, getPxVal(R.dimen.opa_line_x_trans_ry), LINE_ANIMATION_DURATION_Y)); + set.add(getDeltaAnimatorY(mYellow, mFastOutSlowInInterpolator, -getPxVal(R.dimen.opa_line_y_translation), LINE_ANIMATION_DURATION_X)); + set.add(getDeltaAnimatorX(mGreen, mFastOutSlowInInterpolator, getPxVal(R.dimen.opa_line_x_trans_bg), LINE_ANIMATION_DURATION_Y)); + } + set.add(getScaleAnimatorX(mWhite, 0.0f, HOME_RESIZE_DURATION, mHomeDisappearInterpolator)); + set.add(getScaleAnimatorY(mWhite, 0.0f, HOME_RESIZE_DURATION, mHomeDisappearInterpolator)); + set.add(getScaleAnimatorX(mHalo, 0.0f, HOME_RESIZE_DURATION, mHomeDisappearInterpolator)); + set.add(getScaleAnimatorY(mHalo, 0.0f, HOME_RESIZE_DURATION, mHomeDisappearInterpolator)); + getLongestAnim(set).addListener((Animator.AnimatorListener)new AnimatorListenerAdapter() { + public void onAnimationCancel(final Animator animator) { + mCurrentAnimators.clear(); + } + + public void onAnimationEnd(final Animator animator) { + startCollapseAnimation(); + } + }); + return set; + } + + private ArraySet getRetractAnimatorSet() { + final ArraySet set = new ArraySet(); + set.add(getTranslationAnimatorX(mRed, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getTranslationAnimatorY(mRed, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mRed, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorY(mRed, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getTranslationAnimatorX(mBlue, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getTranslationAnimatorY(mBlue, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mBlue, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorY(mBlue, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getTranslationAnimatorX(mGreen, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getTranslationAnimatorY(mGreen, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mGreen, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorY(mGreen, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getTranslationAnimatorX(mYellow, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getTranslationAnimatorY(mYellow, mRetractInterpolator, RETRACT_ANIMATION_DURATION)); + set.add(getScaleAnimatorX(mYellow, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorY(mYellow, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorX(mWhite, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorY(mWhite, 1.0f, RETRACT_ANIMATION_DURATION, mRetractInterpolator)); + set.add(getScaleAnimatorX(mHalo, 1.0f, RETRACT_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + set.add(getScaleAnimatorY(mHalo, 1.0f, RETRACT_ANIMATION_DURATION, mFastOutSlowInInterpolator)); + getLongestAnim(set).addListener((Animator.AnimatorListener)new AnimatorListenerAdapter() { + public void onAnimationEnd(final Animator animator) { + mCurrentAnimators.clear(); + mAnimationState = ANIMATION_STATE_NONE; + } + }); + return set; + } + + private float getPxVal(int id) { + return getResources().getDimensionPixelOffset(id); + } + + private Animator getDeltaAnimatorX(View v, Interpolator interpolator, float deltaX, int duration) { + RenderNodeAnimator anim = new RenderNodeAnimator(8, (int) (v.getX() + deltaX)); + anim.setTarget(v); + anim.setInterpolator(interpolator); + anim.setDuration(duration); + return anim; + } + + private Animator getDeltaAnimatorY(View v, Interpolator interpolator, float deltaY, int duration) { + RenderNodeAnimator anim = new RenderNodeAnimator(9, (int) (v.getY() + deltaY)); + anim.setTarget(v); + anim.setInterpolator(interpolator); + anim.setDuration(duration); + return anim; + } + + private Animator getScaleAnimatorX(View v, float factor, int duration, Interpolator interpolator) { + RenderNodeAnimator anim = new RenderNodeAnimator(3, factor); + anim.setTarget(v); + anim.setInterpolator(interpolator); + anim.setDuration(duration); + return anim; + } + + private Animator getScaleAnimatorY(View v, float factor, int duration, Interpolator interpolator) { + RenderNodeAnimator anim = new RenderNodeAnimator(4, factor); + anim.setTarget(v); + anim.setInterpolator(interpolator); + anim.setDuration(duration); + return anim; + } + + private Animator getTranslationAnimatorX(View v, Interpolator interpolator, int duration) { + RenderNodeAnimator anim = new RenderNodeAnimator(0, 0); + anim.setTarget(v); + anim.setInterpolator(interpolator); + anim.setDuration(duration); + return anim; + } + + private Animator getTranslationAnimatorY(View v, Interpolator interpolator, int duration) { + RenderNodeAnimator anim = new RenderNodeAnimator(1, 0); + anim.setTarget(v); + anim.setInterpolator(interpolator); + anim.setDuration(duration); + return anim; + } + + private Animator getLongestAnim(ArraySet animators) { + long longestDuration = -1; + Animator longestAnim = null; + + for(int i=0; i < animators.size(); i++) { + Animator a = (Animator) animators.valueAt(i); + if(a.getTotalDuration() > longestDuration) { + longestDuration = a.getTotalDuration(); + longestAnim = a; + } + } + return longestAnim; + } + + public void abortCurrentGesture() { + mHome.abortCurrentGesture(); + } + + protected void onFinishInflate() { + super.onFinishInflate(); + + mRed = findViewById(R.id.red); + mBlue = findViewById(R.id.blue); + mYellow = findViewById(R.id.yellow); + mGreen = findViewById(R.id.green); + mWhite = findViewById(R.id.white); + mHalo = findViewById(R.id.halo); + mHome = (KeyButtonView) findViewById(R.id.home_button); + + setOpaEnabled(true); + } + + public boolean onInterceptTouchEvent(MotionEvent ev) { + if (!mOpaEnabled) { + return false; + } + switch (ev.getAction()) { + case MotionEvent.ACTION_DOWN: { + if (!mCurrentAnimators.isEmpty()) { + if (mAnimationState != ANIMATION_STATE_RETRACT) { + return false; + } + endCurrentAnimation(); + } + mStartTime = SystemClock.elapsedRealtime(); + mLongClicked = false; + mIsPressed = true; + startDiamondAnimation(); + removeCallbacks(mCheckLongPress); + postDelayed(mCheckLongPress, (long)ViewConfiguration.getLongPressTimeout()); + return false; + } + case MotionEvent.ACTION_UP: + case MotionEvent.ACTION_CANCEL: { + if (mAnimationState == ANIMATION_STATE_DIAMOND) { + final long elapsedRealtime = SystemClock.elapsedRealtime(); + removeCallbacks(mRetract); + postDelayed(mRetract, 100L - (elapsedRealtime - mStartTime)); + removeCallbacks(mCheckLongPress); + return false; + } + int n; + if (!mIsPressed || mLongClicked) { + n = 0; + } else { + n = 1; + } + mIsPressed = false; + if (n != 0) { + mRetract.run(); + return false; + } + break; + } + } + return false; + } + + public void setCarMode(boolean carMode) { + setOpaEnabled(!carMode); + } + + public void setImageDrawable(Drawable drawable) { + ((ImageView) mWhite).setImageDrawable(drawable); + } + + public void setImageResource(int resId) { + ((ImageView) mWhite).setImageResource(resId); + } + + public void setVertical(boolean landscape) { + mIsLandscape = landscape; + if (mIsLandscape) { + mTop = mGreen; + mBottom = mBlue; + mRight = mYellow; + mLeft = mRed; + return; + } + mTop = mRed; + mBottom = mYellow; + mLeft = mBlue; + mRight = mGreen; + } + + public void setOnLongClickListener(View.OnLongClickListener l) { + mHome.setOnLongClickListener(l); + } + + public void setOnTouchListener(View.OnTouchListener l) { + mHome.setOnTouchListener(l); + } + + public void setOpaEnabled(boolean enabled) { + visibility = View.VISIBLE; + mBlue.setVisibility(visibility); + mRed.setVisibility(visibility); + mYellow.setVisibility(visibility); + mGreen.setVisibility(visibility); + mHalo.setVisibility(visibility); + } + +} diff --git a/product.mk b/product.mk new file mode 100644 index 0000000..8908c43 --- /dev/null +++ b/product.mk @@ -0,0 +1,40 @@ +## ADB Keys +# Android +PRODUCT_COPY_FILES += \ + vendor/extra/adb_keys:root/adb_keys +# Recovery +PRODUCT_COPY_FILES += \ + vendor/extra/adb_keys:recovery/root/adb_keys + +## Media +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + ro.config.vc_call_vol_steps=7 \ + ro.config.media_vol_steps=25 + +## OpenWeatherProvider +PRODUCT_PACKAGES += OpenWeatherProviderPrebuilt + +## Pixel Theme +DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay +PRODUCT_PACKAGES += \ + PixelTheme + +## Recovery +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.sys.recovery_update=true + +## Remove Dialer Apps +ifneq ($(filter %shieldtablet %yellowstone,$(TARGET_PRODUCT)),) +PRODUCT_PACKAGES += remove-dialer +endif + +## Remove Telephony Apps +ifneq ($(filter %flo %gts4lvwifi %icosa,$(TARGET_PRODUCT)),) +PRODUCT_PACKAGES += remove-telephony +endif + +## Updater +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += lineage.updater.uri="https://updater-api.oddsolutions.us/api/v1/{device}/{type}/{incr}" +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += lineage.updater.allow_downgrading=true + +## Signing +PRODUCT_DEFAULT_DEV_CERTIFICATE := vendor/certs/releasekey diff --git a/remove-dialer/Android.mk b/remove-dialer/Android.mk new file mode 100644 index 0000000..d274a16 --- /dev/null +++ b/remove-dialer/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := remove-dialer +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := APPS +LOCAL_OVERRIDES_PACKAGES := Dialer GoogleDialer +LOCAL_UNINSTALLABLE_MODULE := true +LOCAL_SRC_FILES := /dev/null +LOCAL_CERTIFICATE := PRESIGNED +include $(BUILD_PREBUILT) diff --git a/remove-telephony/Android.mk b/remove-telephony/Android.mk new file mode 100644 index 0000000..99875da --- /dev/null +++ b/remove-telephony/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := remove-telephony +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := APPS +LOCAL_OVERRIDES_PACKAGES := CarrierServicesGoogle Dialer GoogleDialer Messages Messaging Telecom Telephony +LOCAL_UNINSTALLABLE_MODULE := true +LOCAL_SRC_FILES := /dev/null +LOCAL_CERTIFICATE := PRESIGNED +include $(BUILD_PREBUILT)