Skip to content

Commit

Permalink
Merge branch 'release/1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
胡晟昊 committed Oct 17, 2021
2 parents eb1d36f + d094981 commit 3082b57
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId = "com.dede.android_eggs"
minSdk = Versions.MIN_SDK
targetSdk = Versions.TARGET_SDK
versionCode = 10
versionName = "1.5.0"
versionCode = 11
versionName = "1.5.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.addAll(listOf("zh", "en"))
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/java/com/dede/android_eggs/EggPreference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ class EggPreference : Preference {

private class OvalOutlineProvider : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setOval(0, 0, view.width, view.height)
outline.setOval(view.paddingLeft, view.paddingTop,
view.width - view.paddingRight,
view.height - view.paddingBottom)
}
}

private class CornersOutlineProvider(val radius: Float) : ViewOutlineProvider() {
override fun getOutline(view: View, outline: Outline) {
outline.setRoundRect(0, 0, view.width, view.height, radius)
outline.setRoundRect(view.paddingLeft, view.paddingTop,
view.width - view.paddingRight,
view.height - view.paddingBottom, radius)
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<string name="title_android_r" translatable="false">Android 11 (Red Velvet Cake)</string>
<string name="title_android_q" translatable="false">Android 10 (Queen Cake)</string>
<string name="title_android_p" translatable="false">Android 9 (Pie)</string>
<string name="title_android_o" translatable="false">Android 8.x (Oreo)</string>
<string name="title_android_o" translatable="false">Android 8.0 (Oreo)</string>
<string name="title_android_o_point" translatable="false">Android 8.1 (Oreo)</string>
<string name="title_android_n" translatable="false">Android 7.x (Nougat)</string>
<string name="title_android_m" translatable="false">Android 6.x (Marshmallow)</string>
<string name="title_android_l" translatable="false">Android 5.x (Lollipop)</string>
Expand Down
24 changes: 19 additions & 5 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,52 @@
<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_s"
app:icon="@drawable/s_platlogo"
app:iconPadding="2dp"
app:iconPadding="1.5dp"
app:summary="@string/s_egg_name"
app:title="@string/title_android_s" />

<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_r"
app:icon="@drawable/r_icon"
app:iconPadding="2dp"
app:iconPadding="1.5dp"
app:summary="@string/r_egg_name"
app:supportAdaptiveIcon="oval"
app:title="@string/title_android_r" />

<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_q"
app:icon="@drawable/q_icon"
app:iconPadding="2dp"
app:iconPadding="1.5dp"
app:summary="@string/q_egg_name"
app:supportAdaptiveIcon="oval"
app:title="@string/title_android_q" />

<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_p"
app:icon="@drawable/p_icon"
app:iconPadding="2dp"
app:iconPadding="1.5dp"
app:summary="@string/p_app_name"
app:supportAdaptiveIcon="oval"
app:title="@string/title_android_p" />

<com.dede.android_eggs.EggPreference
app:icon="@drawable/o_icon"
app:iconPadding="-2dp"
app:summary="@string/o_app_name"
app:title="@string/title_android_o_point">
<intent
android:targetClass="@string/target_class_android_o"
android:targetPackage="@string/app_package">
<extra
android:name="isOreoPoint"
android:value="true" />
</intent>
</com.dede.android_eggs.EggPreference>

<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_o"
app:icon="@drawable/o_icon"
app:iconPadding="-1.5dp"
app:iconPadding="-2dp"
app:summary="@string/o_app_name"
app:title="@string/title_android_o" />

Expand Down
2 changes: 1 addition & 1 deletion eggs/Nougat/src/com/android_n/egg/PlatLogoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void run() {
try {
startActivity(new Intent(PlatLogoActivity.this, NekoActivationActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TASK
// | Intent.FLAG_ACTIVITY_CLEAR_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS));
} catch (ActivityNotFoundException ex) {
Log.e("PlatLogoActivity", "No more eggs.");
Expand Down
1 change: 1 addition & 0 deletions eggs/Oreo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ android {
}

dependencies {
implementation(deps.androidx.appcompat)
implementation(deps.androidx.dynamicanimation)
implementation project(path: ':basic')
}
Expand Down
48 changes: 48 additions & 0 deletions eggs/Oreo/res/drawable/o_point_platlogo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright (C) 2017 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="480dp"
android:height="480dp"
android:viewportWidth="48"
android:viewportHeight="48">
<group>
<path
android:fillColor="#2C292A"
android:fillType="evenOdd"
android:pathData="M6,26a20,20 0 0,1 40,0a20,20 0 0,1 -40,0z" />
<path
android:fillColor="#FAFAFA"
android:fillType="evenOdd"
android:pathData="M4,24a20,20 0 0,1 40,0a20,20 0 0,1 -40,0z" />
<path
android:fillColor="#2C292A"
android:fillType="evenOdd"
android:pathData="M2,22a20,20 0 0,1 40,0a20,20 0 0,1 -40,0z" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M26.5 29.5v3c0 1.13-.87 2-2 2s-2-.87-2-2v-3h-1v3c0 1.13-.87 2-2 2s-2-.87-2-2v-3H17a1.5 1.5 0 0 1-1.5-1.5V17.5h13V28a1.5 1.5 0 0 1-1.5 1.5h-.5zM13.5 17.5c1.13 0 2 .87 2 2v7c0 1.13-.87 2-2 2s-2-.87-2-2v-7c0-1.13.87-2 2-2zM30.5 17.5c1.13 0 2 .87 2 2v7c0 1.13-.87 2-2 2s-2-.87-2-2v-7c0-1.13.87-2 2-2zM26.3 12.11A6.46 6.46 0 0 1 28.5 17v.5h-13V17a6.46 6.46 0 0 1 2.2-4.89l-.9-.9a.98.98 0 0 1 0-1.41.98.98 0 0 1 1.4 0l1.26 1.25A6.33 6.33 0 0 1 22 10.5c.87 0 1.73.2 2.54.55L25.8 9.8a.98.98 0 0 1 1.4 0 .98.98 0 0 1 0 1.4l-.9.91z"
android:strokeWidth="1"
android:strokeColor="#453F41" />
<path
android:fillColor="#453F41"
android:fillType="evenOdd"
android:pathData="M20.16 14.5a.66.66 0 1 1-1.31 0c0-.36.29-.65.65-.65.36 0 .65.29.65.65zM25.16 14.5c0 .36-.3.66-.66.66a.65.65 0 1 1 .66-.66z" />
<path
android:fillColor="#453F41"
android:pathData="M22 40.5c0.36 0 0.73-0.01 1.09-0.03l-0.18-3A15.77 15.77 0 0 1 22 37.5v3zm2.17-0.13a18.48 18.48 0 0 0 1.08-0.15l-0.53-2.96c-0.3 0.05-0.6 0.1-0.9 0.13l0.35 2.98zM26.32 40a18.37 18.37 0 0 0 1.05-0.28l-0.87-2.87a15.37 15.37 0 0 1-0.88 0.23l0.7 2.92zm2.1-0.64l-1.03-2.81a15.39 15.39 0 0 0 0.84-0.34l1.2 2.74a18.39 18.39 0 0 1-1 0.41zm1.99-0.87l-1.37-2.67a15.46 15.46 0 0 0 0.8-0.44l1.52 2.59a18.46 18.46 0 0 1-0.95 0.52zm1.89-1.11l-1.67-2.5a15.55 15.55 0 0 0 0.74-0.52l1.81 2.39a18.55 18.55 0 0 1-0.88 0.63zm1.75-1.33l-1.95-2.28a15.6 15.6 0 0 0 0.67-0.61l2.09 2.15a18.6 18.6 0 0 1-0.8 0.74zm1.6-1.55l-2.22-2.02a15.6 15.6 0 0 0 0.6-0.7l2.33 1.9a18.6 18.6 0 0 1-0.72 0.82zM37 32.82l-2.43-1.76a15.53 15.53 0 0 0 0.5-0.75l2.54 1.6c-0.2 0.31-0.4 0.61-0.61 0.9zm1.15-1.8l-2.62-1.47a15.45 15.45 0 0 0 0.42-0.8l2.7 1.3a18.45 18.45 0 0 1-0.5 0.97zm0.95-1.98l-2.77-1.14a15.38 15.38 0 0 0 0.32-0.86l2.84 0.98a18.38 18.38 0 0 1-0.39 1.02zm0.72-2.09c0.1-0.34 0.18-0.7 0.26-1.05l-2.93-0.63a15.38 15.38 0 0 1-0.22 0.88l2.89 0.8zm0.46-2.15a18.52 18.52 0 0 0 0.13-1.08l-2.99-0.28a15.52 15.52 0 0 1-0.1 0.9l2.96 0.46zm0.2-2.2a18.81 18.81 0 0 0 0-1.1l-3 0.08a16 16 0 0 1 0 0.92l3 0.1zm-0.06-2.2a18.54 18.54 0 0 0-0.12-1.07l-2.97 0.43c0.04 0.3 0.08 0.6 0.1 0.9l3-0.25zm-0.31-2.15a18.39 18.39 0 0 0-0.25-1.06l-2.9 0.78a15.39 15.39 0 0 1 0.21 0.89l2.94-0.6zm-0.57-2.12l-2.85 0.95a15.37 15.37 0 0 0-0.31-0.85l2.78-1.12a18.37 18.37 0 0 1 0.38 1.02zm-0.83-2.06l-2.71 1.29a15.44 15.44 0 0 0-0.42-0.81l2.63-1.45a18.44 18.44 0 0 1 0.5 0.97zm-1.03-1.88l-2.54 1.6a15.53 15.53 0 0 0-0.5-0.76l2.44-1.74 0.6 0.9zm-1.28-1.79l-2.33 1.88a15.6 15.6 0 0 0-0.6-0.69l2.23-2.02a18.6 18.6 0 0 1 0.7 0.83zm-1.48-1.63l-2.1 2.14a15.6 15.6 0 0 0-0.67-0.62l1.97-2.26a18.6 18.6 0 0 1 0.8 0.74zM33.24 7.3l-1.82 2.38a15.55 15.55 0 0 0-0.74-0.53l1.68-2.49c0.3 0.2 0.6 0.42 0.88 0.64zm-1.71-1.17L29.98 8.7a15.47 15.47 0 0 0-0.8-0.45l1.4-2.66a18.47 18.47 0 0 1 0.95 0.54zm-1.95-1.02l-1.23 2.74A15.4 15.4 0 0 0 27.5 7.5l1.06-2.8a18.4 18.4 0 0 1 1.01 0.4zm-2.06-0.78l-0.9 2.86a15.37 15.37 0 0 0-0.87-0.24l0.72-2.92a18.37 18.37 0 0 1 1.05 0.3zM25.38 3.8a18.47 18.47 0 0 0-1.08-0.17l-0.37 2.98c0.3 0.04 0.6 0.08 0.9 0.14l0.55-2.95zm-2.2-0.27A18.75 18.75 0 0 0 22.1 3.5l-0.02 3L23 6.53l0.19-3zM21 3.53a18.6 18.6 0 0 0-1.08 0.09l0.33 2.98a15.6 15.6 0 0 1 0.91-0.08l-0.16-3zm-2.16 0.24A18.4 18.4 0 0 0 17.76 4l0.68 2.92a15.4 15.4 0 0 1 0.9-0.18l-0.51-2.96zm-2.14 0.5l0.86 2.88a15.37 15.37 0 0 0-0.86 0.28l-1.03-2.81a18.37 18.37 0 0 1 1.03-0.35zm-2.07 0.76l1.2 2.75a15.42 15.42 0 0 0-0.83 0.4L13.63 5.5a18.42 18.42 0 0 1 0.99-0.47zM12.7 6l1.5 2.6a15.5 15.5 0 0 0-0.76 0.48l-1.66-2.5A18.5 18.5 0 0 1 12.7 6zm-1.83 1.22l1.8 2.4a15.58 15.58 0 0 0-0.7 0.57L10.01 7.9a18.58 18.58 0 0 1 0.85-0.68zM9.19 8.66l2.07 2.16a15.6 15.6 0 0 0-0.63 0.65l-2.2-2.04a18.6 18.6 0 0 1 0.76-0.77zm-1.51 1.63l2.32 1.9a15.57 15.57 0 0 0-0.56 0.72l-2.42-1.76a18.57 18.57 0 0 1 0.66-0.86zm-1.23 1.69l2.52 1.62a15.5 15.5 0 0 0-0.47 0.78l-2.61-1.47a18.5 18.5 0 0 1 0.56-0.93zm-1.08 1.9l2.7 1.32a15.41 15.41 0 0 0-0.38 0.83l-2.77-1.15a18.41 18.41 0 0 1 0.45-1zm-0.85 2.04l2.84 0.98a15.37 15.37 0 0 0-0.28 0.87L4.2 16.96c0.1-0.35 0.2-0.7 0.32-1.04zm-0.6 2.12a18.43 18.43 0 0 0-0.2 1.07l2.97 0.47c0.05-0.3 0.1-0.6 0.17-0.9l-2.93-0.64zm-0.34 2.18a18.65 18.65 0 0 0-0.07 1.09l3 0.11 0.06-0.91-2.99-0.29zm-0.08 2.2a18.7 18.7 0 0 0 0.06 1.1l3-0.25a15.7 15.7 0 0 1-0.06-0.91l-3 0.07zm0.18 2.18a18.44 18.44 0 0 0 0.18 1.07l2.95-0.6a15.44 15.44 0 0 1-0.16-0.9L3.68 24.6zm0.43 2.14l2.9-0.77a15.37 15.37 0 0 0 0.26 0.88l-2.85 0.94a18.37 18.37 0 0 1-0.3-1.05zm0.7 2.1l2.78-1.11a15.4 15.4 0 0 0 0.36 0.83l-2.71 1.27a18.4 18.4 0 0 1-0.44-1zm0.9 1.95l2.65-1.43a15.48 15.48 0 0 0 0.45 0.8l-2.55 1.57a18.48 18.48 0 0 1-0.54-0.94zm1.17 1.87l2.45-1.73a15.56 15.56 0 0 0 0.54 0.73l-2.34 1.87a18.56 18.56 0 0 1-0.65-0.87zm1.37 1.72l2.23-2a15.6 15.6 0 0 0 0.63 0.65l-2.1 2.14a18.6 18.6 0 0 1-0.76-0.79zm1.58 1.56l1.98-2.26c0.22 0.2 0.46 0.39 0.7 0.58l-1.84 2.37a18.59 18.59 0 0 1-0.84-0.7zm1.66 1.28l1.7-2.46a15.52 15.52 0 0 0 0.77 0.5l-1.56 2.56a18.52 18.52 0 0 1-0.91-0.6zm1.87 1.14l1.4-2.65a15.43 15.43 0 0 0 0.82 0.4l-1.24 2.73a18.43 18.43 0 0 1-0.98-0.48zm2 0.91l1.08-2.8a15.37 15.37 0 0 0 0.86 0.3l-0.9 2.86a18.37 18.37 0 0 1-1.04-0.36zm2.1 0.67a18.4 18.4 0 0 0 1.07 0.23l0.56-2.94a15.4 15.4 0 0 1-0.9-0.2l-0.72 2.91zm2.18 0.41a18.57 18.57 0 0 0 1.08 0.1l0.2-2.99a15.57 15.57 0 0 1-0.9-0.09l-0.38 2.98zm2.2 0.15H22v-3h-0.13l-0.03 3z" />
</group>
</vector>
35 changes: 22 additions & 13 deletions eggs/Oreo/src/com/android_o/egg/PlatLogoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,28 @@ public void onAttachedToWindow() {
im.setScaleY(0.5f);
im.setAlpha(0f);

im.setBackground(new RippleDrawable(
ColorStateList.valueOf(0xFF776677),
getDrawable(R.drawable.o_platlogo),
null));
im.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
final int w = view.getWidth();
final int h = view.getHeight();
outline.setOval((int) (w * .125), (int) (h * .125), (int) (w * .96), (int) (h * .96));
}
});
im.setElevation(12f * dp);
Intent intent = getIntent();
boolean isOreoPoint = intent.getBooleanExtra("isOreoPoint", false);
if (!isOreoPoint) {
im.setBackground(new RippleDrawable(
ColorStateList.valueOf(0xFF776677),
getDrawable(R.drawable.o_platlogo),
null));
} else {
im.setBackground(new RippleDrawable(
ColorStateList.valueOf(0xFF776677),
getDrawable(R.drawable.o_point_platlogo),
null));
im.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
final int w = view.getWidth();
final int h = view.getHeight();
outline.setOval((int) (w * .125), (int) (h * .125), (int) (w * .96), (int) (h * .96));
}
});
im.setElevation(12f * dp);
}
im.setClickable(true);
im.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down

0 comments on commit 3082b57

Please sign in to comment.