Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vendor: Add Pixel charger animation #18

Open
wants to merge 1 commit into
base: r11.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions charger/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2013 The Android Open Source Project
# Copyright 2020 The PixelROM Project

LOCAL_PATH := $(call my-dir)

### pixel_charger_res_images ###
ifneq ($(strip $(LOCAL_CHARGER_NO_UI)),true)
define _add-product-charger-image
include $$(CLEAR_VARS)
LOCAL_MODULE := pixel_charger_res_images_charger_$(notdir $(1))
LOCAL_MODULE_STEM := $(notdir $(1))
_img_modules += $$(LOCAL_MODULE)
LOCAL_SRC_FILES := $1
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $$(TARGET_OUT_PRODUCT)/etc/res/images/charger
LOCAL_PRODUCT_MODULE := true
include $$(BUILD_PREBUILT)
endef

_img_modules :=
_images :=
$(foreach _img, $(call find-subdir-subdir-files, "images/charger", "*.png"), \
$(eval $(call _add-product-charger-image,$(_img))))

### pixel_charger_animation_file ###
define _add-product-charger-animation-file
include $$(CLEAR_VARS)
LOCAL_MODULE := pixel_charger_res_values_charger_$(notdir $(1))
LOCAL_MODULE_STEM := $(notdir $(1))
_anim_modules += $$(LOCAL_MODULE)
LOCAL_SRC_FILES := $1
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $$(TARGET_OUT_PRODUCT)/etc/res/values/charger
LOCAL_PRODUCT_MODULE := true
include $$(BUILD_PREBUILT)
endef

_anim_modules :=
$(foreach _txt, $(call find-subdir-subdir-files, "values/charger", "*.txt"), \
$(eval $(call _add-product-charger-animation-file,$(_txt))))

include $(CLEAR_VARS)
LOCAL_MODULE := product_charger_res_images
LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := $(_img_modules) $(_anim_modules)
include $(BUILD_PHONY_PACKAGE)

_add-product-charger-image :=
_add-product-charger-animation-file :=
_img_modules :=
_anim_modules :=
endif # LOCAL_CHARGER_NO_UI
Binary file added charger/images/charger/battery_fail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added charger/images/charger/battery_scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added charger/images/charger/main_font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions charger/values/charger/animation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
## Google Pixel animation

# animation: num_cycles, first_frame_repeats, animation_file
animation: 2 1 charger/battery_scale

# percent_display: text_percent_pos_x, text_percent_pos_y, color_r, color_g, color_b, color_a, font_file
percent_display: c c 255 255 255 255 charger/main_font

fail: charger/battery_fail

# frame: disp_time min_level max_level
frame: 300 0 100 # 0
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 5
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 10
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 15
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 20
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 25
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 30
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 35
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 40
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 45
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 50
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 55
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 60
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100 # 65
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
frame: 15 0 100
7 changes: 7 additions & 0 deletions config/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ PRODUCT_PACKAGES += \
ViaBrowser \
WeatherProvider

# Charger mode images
ifeq ($(TARGET_INCLUDE_PIXEL_CHARGER),true)
PRODUCT_PACKAGES += \
charger_res_images \
product_charger_res_images
endif

# Navbar
PRODUCT_PACKAGES += \
GesturalNavigationOverlayLong \
Expand Down