Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
Bring in initial Pixel Navbar animation resources [1/?]
Browse files Browse the repository at this point in the history
****

This commit just brings in the history and resources from the
fantastic work Jacob did pwning this Google animation here...

https://github.com/USA-RedDragon/frameworks_base-1/commit/55563047385874559c7a6c5ab25f45d9ab75296c

****

Pixel Navbar, reverse engineered from smali.

Notes:
- This is forcing the Pixel Home button on people,
  and it looks ugly with the other nav buttons being hollow

- There MAY still be a few fixes yet to be found in this code
  because it WAS a big file to RE from smali. I have yet to find
  any, but time is the best tester.

- Shoutout to @bigrushdog for providing a decompiled form used
  to verify the smali and as a guideline for the more obsure
  smali sections. It was a big help.

- Tagging myself here to see adoption rate. @USA-RedDragon

Change-Id: Ief1ee04b540c553848698362298719e489fb3585
  • Loading branch information
USA-RedDragon authored and bigrushdog committed Feb 18, 2017
1 parent 56f9751 commit 5df39f3
Show file tree
Hide file tree
Showing 12 changed files with 680 additions and 0 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_sysbar_home_pixel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions res/drawable/halo.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="ring" android:useLevel="false" android:innerRadius="@dimen/halo_inner_radius" android:thickness="@dimen/halo_thickness"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffffff" />
<size android:height="@dimen/halo_diameter" android:width="@dimen/halo_diameter" />
</shape>
6 changes: 6 additions & 0 deletions res/drawable/ic_sysbar_opa_blue.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="@dimen/opa_dot_diam" android:width="@dimen/opa_dot_diam" />
<solid android:color="#ff4285f4" />
</shape>
6 changes: 6 additions & 0 deletions res/drawable/ic_sysbar_opa_green.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="@dimen/opa_dot_diam" android:width="@dimen/opa_dot_diam" />
<solid android:color="#ff34a853" />
</shape>
6 changes: 6 additions & 0 deletions res/drawable/ic_sysbar_opa_red.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="@dimen/opa_dot_diam" android:width="@dimen/opa_dot_diam" />
<solid android:color="#ffea4335" />
</shape>
6 changes: 6 additions & 0 deletions res/drawable/ic_sysbar_opa_yellow.xml
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<size android:height="@dimen/opa_dot_diam" android:width="@dimen/opa_dot_diam" />
<solid android:color="#fffbbc05" />
</shape>
27 changes: 27 additions & 0 deletions res/layout/home_tmp.xml
@@ -0,0 +1,27 @@
<?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.
-->
<com.android.systemui.navigation.OpaLayout android:id="@+id/home_tmp" android:clipChildren="false" android:clipToPadding="false" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:layout_weight="0.0" android:paddingStart="@dimen/navigation_key_padding" android:paddingEnd="@dimen/navigation_key_padding"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res-auto">
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/red" android:src="@drawable/ic_sysbar_opa_red" android:importantForAccessibility="no" style="@style/DotStyle" />
<ImageView android:id="@+id/blue" android:src="@drawable/ic_sysbar_opa_blue" android:importantForAccessibility="no" style="@style/DotStyle" />
<ImageView android:id="@+id/green" android:src="@drawable/ic_sysbar_opa_green" android:importantForAccessibility="no" style="@style/DotStyle" />
<ImageView android:id="@+id/yellow" android:src="@drawable/ic_sysbar_opa_yellow" android:importantForAccessibility="no" style="@style/DotStyle" />
</RelativeLayout>
<ImageView android:layout_gravity="center" android:id="@+id/white" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_sysbar_home_pixel" android:importantForAccessibility="no" />
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="center" android:id="@+id/home_button" android:layout_width="@dimen/navigation_key_width" android:layout_height="fill_parent" android:scaleType="center" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" />
<ImageView android:layout_gravity="center" android:id="@+id/halo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/halo" android:importantForAccessibility="no" />
</com.android.systemui.navigation.OpaLayout>
14 changes: 14 additions & 0 deletions res/values/dimens.xml
Expand Up @@ -30,4 +30,18 @@
<dimen name="navigation_key_tablet_width_port">128dp</dimen>
<dimen name="navigation_key_tablet_width_land">162dp</dimen>

<!-- OPA home dimens -->
<dimen name="halo_inner_radius">10.0dip</dimen>
<dimen name="halo_thickness">1.0dip</dimen>
<dimen name="halo_diameter">22.0dip</dimen>
<dimen name="opa_dot_diam">10.0dip</dimen>
<dimen name="opa_diamond_translation">16.0dip</dimen>
<dimen name="opa_line_y_translation">16.0dip</dimen>
<dimen name="opa_line_x_trans_ry">15.0dip</dimen>
<dimen name="opa_line_x_trans_bg">30.0dip</dimen>
<dimen name="opa_line_x_collapse_bg">46.0dip</dimen>
<dimen name="opa_line_x_collapse_ry">15.0dip</dimen>
<dimen name="opa_overshoot_translation">8.0dip</dimen>
<dimen name="opa_return_translation">-1.0dip</dimen>
<dimen name="opa_rest_to_collapse">7.0dip</dimen>
</resources>
6 changes: 6 additions & 0 deletions res/values/styles.xml
Expand Up @@ -23,5 +23,11 @@
<item name="@android:windowExitAnimation">@anim/disappear</item>
</style>

<style name="DotStyle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_centerHorizontal">true</item>
<item name="android:layout_centerVertical">true</item>
</style>

</resources>
9 changes: 9 additions & 0 deletions src/com/android/systemui/navigation/Constants.java
@@ -0,0 +1,9 @@
package com.android.systemui.navigation;

public class Constants {

public static final String OPA_COMPONENT_NAME = "com.google.android.googlequicksearchbox/com.google.android.voiceinteraction.GsaVoiceInteractionService";
public static final String OPA_ENABLED = "OPA_ENABLED";
public static final String OPA_ENABLE_ACTION = "com.google.android.systemui.OPA_ENABLED";

}

0 comments on commit 5df39f3

Please sign in to comment.