Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
shhu committed Aug 23, 2022
2 parents 18882eb + 99c34e8 commit 4a5b2fb
Show file tree
Hide file tree
Showing 124 changed files with 4,595 additions and 110 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![icon](./app/src/main/ic_launcher-playstore.png)

## 截图
![截图1](./images/screenshot.jpeg)
![截图1](./images/Screenshot_20220820_184459.png)
![截图2](./images/image.jpeg)

部分版本彩蛋使用了系统新特性,低版本只能使用部分功能,其他版本都是完整彩蛋功能。
Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val keystoreProperties = Properties().apply {

plugins {
id("com.android.application")
id("kotlin-android")
id("org.jetbrains.kotlin.android")
}

android {
Expand All @@ -19,8 +19,8 @@ android {
applicationId = "com.dede.android_eggs"
minSdk = Versions.MIN_SDK
targetSdk = Versions.TARGET_SDK
versionCode = 14
versionName = "1.6.2"
versionCode = 16
versionName = "1.7.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.addAll(listOf("zh", "en"))
Expand Down Expand Up @@ -69,7 +69,6 @@ android {
}

dependencies {
implementation(deps.kotlin.stdlib)
implementation(deps.androidx.appcompat)
implementation(deps.androidx.core.ktx)
implementation(deps.androidx.preference.ktx)
Expand All @@ -79,6 +78,7 @@ dependencies {
implementation(deps.free.reflection)
debugImplementation(deps.leakcanary)
implementation(project(":basic"))
implementation(project(":eggs:T"))
implementation(project(":eggs:S"))
implementation(project(":eggs:R"))
implementation(project(":eggs:Q"))
Expand All @@ -105,8 +105,8 @@ tasks.register<Exec>("pgyer") {
dependsOn("clean", assemble)
assemble.mustRunAfter("clean")

val tree = fileTree("build/intermediates/apk/release") {
include("*.apk")
val tree = fileTree("build") {
include("outputs/apk/release/*.apk", "intermediates/apk/release/*.apk")
builtBy("assembleRelease")
}
doFirst {
Expand Down
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class ChromeTabPreference : Preference, Preference.OnPreferenceClickListene
this.uri = uri
}

override fun onPreferenceClick(preference: Preference?): Boolean {
override fun onPreferenceClick(preference: Preference): Boolean {
val uri = this.uri
if (uri != null) {
if (useChromeTab) {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/dede/android_eggs/EasterEggsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.ViewAnimationUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import com.dede.android_eggs.databinding.ActivityEasterEggsBinding
import com.google.android.material.internal.EdgeToEdgeUtils
import kotlin.math.hypot

/**
Expand All @@ -25,6 +26,7 @@ class EasterEggsActivity : AppCompatActivity(), Runnable {
postAnim()
}

@Suppress("DEPRECATION")
private fun initStatusBar() {
val option =
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/dede/android_eggs/EggCollection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class EggCollection : PreferenceCategory {
}
}

override fun onGetDefaultValue(a: TypedArray?, index: Int): Boolean {
return a?.getBoolean(index, false) ?: false
override fun onGetDefaultValue(a: TypedArray, index: Int): Boolean {
return a.getBoolean(index, false)
}

override fun onSetInitialValue(defaultValue: Any?) {
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/dede/android_eggs/EggPreference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ class EggPreference : Preference {
finalTitle = title
}

override fun onBindViewHolder(holder: PreferenceViewHolder?) {
override fun onBindViewHolder(holder: PreferenceViewHolder) {
super.onBindViewHolder(holder)

if (!showSuffix && finalTitle != null) {
val title = holder?.findViewById(android.R.id.title) as? TextView
val title = holder.findViewById(android.R.id.title) as? TextView
title?.text = finalTitle.replace(suffixRegex,"")
}

val icon = holder?.findViewById(android.R.id.icon) as? ImageView ?: return
val icon = holder.findViewById(android.R.id.icon) as? ImageView ?: return
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O) {
// support adaptive-icon
icon.clipToOutline = outlineProvider != null
Expand Down
58 changes: 40 additions & 18 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.515625"
android:scaleY="0.515625"
android:translateX="21"
android:translateY="21">
<path
android:fillColor="#00000000"
android:pathData="M32.5,34.15a10,10 0,0 1,9.94 10V93.85"
android:strokeWidth="4"
android:strokeColor="#fff"
android:strokeLineCap="round" />
<path
android:fillColor="#00000000"
android:pathData="M95.5,93.85H55.71V83.9A19.9,19.9 0,0 1,75.61 64h10a9.94,9.94 0,0 0,9.94 -10,19.9 19.9,0 0,0 -38.69,-6.56A20.77,20.77 0,0 0,56 50.73"
android:strokeWidth="4"
android:strokeColor="#fff"
android:strokeLineCap="round" />
</group>
<group
android:scaleX="2.775701"
android:scaleY="2.775701"
android:translateX="21"
android:translateY="21">
<path
android:fillColor="#219bcc"
android:pathData="M11,0.3c0.6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2.22"
android:strokeColor="#322c4c" />
<path
android:pathData="M6.3,6.5l3,0l0,12.2"
android:strokeWidth="0.56"
android:strokeColor="#e1e3e5" />
<path
android:pathData="M12.3,6.5h4l-2,4c2.2,0.3 3.6,2.4 3.3,4.5c-0.3,1.9 -1.9,3.3 -3.8,3.3c-0.5,0 -1,-0.1 -1.4,-0.3"
android:strokeWidth="0.56"
android:strokeColor="#e1e3e5" />
</group>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_easter_eggs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher" />
android:src="@drawable/t_platlogo" />

</FrameLayout>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.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 modified app/src/main/res/mipmap-hdpi/ic_launcher_round.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 modified app/src/main/res/mipmap-mdpi/ic_launcher.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 modified app/src/main/res/mipmap-mdpi/ic_launcher_round.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 modified app/src/main/res/mipmap-xhdpi/ic_launcher.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 modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.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 modified app/src/main/res/mipmap-xxhdpi/ic_launcher.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 modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.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 modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.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 modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#ce93d8</color>
<color name="purple_500">#9c27b0</color>
<color name="purple_700">#7b1fa2</color>
<color name="teal_200">#80cbc4</color>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#8A6A92</color>
<color name="ic_launcher_background">#219BCC</color>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<string name="title_android_h" translatable="false">Android 3.x (Honeycomb)</string>
<string name="title_android_g" translatable="false">Android 2.3.x (Gingerbread)</string>

<string name="target_class_android_t" translatable="false">com.android_t.egg.PlatLogoActivity</string>
<string name="target_class_android_s" translatable="false">com.android_s.egg.PlatLogoActivity</string>
<string name="target_class_android_r" translatable="false">com.android_r.egg.PlatLogoActivity</string>
<string name="target_class_android_q" translatable="false">com.android_q.egg.PlatLogoActivity</string>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
app:key="key_collection"
app:title="@string/header_collection">

<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_t"
app:icon="@drawable/t_platlogo"
app:iconPadding="1.5dp"
app:summary="@string/t_egg_name"
app:title="@string/title_android_t" />

<com.dede.android_eggs.EggPreference
android:targetClass="@string/target_class_android_s"
app:icon="@drawable/s_platlogo"
Expand Down
3 changes: 1 addition & 2 deletions basic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.android.library")
id("kotlin-android")
id("org.jetbrains.kotlin.android")
}

android {
Expand Down Expand Up @@ -31,7 +31,6 @@ android {
}

dependencies {
implementation(deps.kotlin.stdlib)
implementation(deps.kotlinx.coroutines.core)
implementation(deps.androidx.appcompat)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.android_s.egg;
package com.dede.basic;

import android.content.BroadcastReceiver;
import android.content.Context;
Expand All @@ -31,8 +31,6 @@

import androidx.core.content.ContextCompat;

import com.dede.basic.DrawableKt;

import java.util.TimeZone;

/**
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions basic/src/main/res/values/resources.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<declare-styleable name="AnalogClock">
<attr name="dial" format="reference" />
<attr name="hand_hour" format="reference" />
<attr name="hand_minute" format="reference" />
</declare-styleable>
</resources>
24 changes: 5 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30")
//classpath(deps.bundles.classpath)
}
}

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "7.2.2" apply false
id("com.android.library") version "7.2.2" apply false
id("org.jetbrains.kotlin.android") version "1.7.10" apply false
}

task<Delete>("clean") {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
object Versions {

const val COMPILE_SDK = 31
const val BUILD_TOOLS = "31.0.0"
const val TARGET_SDK = 31
const val COMPILE_SDK = 33
const val BUILD_TOOLS = "33.0.0"
const val TARGET_SDK = 32
const val MIN_SDK = 21

}
1 change: 1 addition & 0 deletions eggs/Nougat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ android {
dependencies {
implementation(deps.androidx.recyclerview)
implementation(deps.androidx.dynamicanimation)
implementation(deps.androidx.annotation)
implementation project(path: ':basic')
}

6 changes: 5 additions & 1 deletion eggs/Nougat/src/com/android_n/egg/neko/Cat.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ public Notification.Builder buildNotification(Context context) {
final Intent intent = new Intent(Intent.ACTION_MAIN)
.setClass(context, NekoLand.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
int flag = PendingIntent.FLAG_IMMUTABLE;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
flag = PendingIntent.FLAG_MUTABLE;
}
Notification.Builder builder = new Notification.Builder(context)
.setSmallIcon(Icon.createWithResource(context, R.drawable.stat_icon))
.setColor(getBodyColor())
Expand All @@ -226,7 +230,7 @@ public Notification.Builder buildNotification(Context context) {
.setShowWhen(true)
.setCategory(Notification.CATEGORY_STATUS)
.setContentText(getName())
.setContentIntent(PendingIntent.getActivity(context, 0, intent, 0))
.setContentIntent(PendingIntent.getActivity(context, 0, intent, flag))
.setAutoCancel(true)
.setVibrate(PURR)
.addExtras(extras);
Expand Down
3 changes: 1 addition & 2 deletions eggs/Pie/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.kotlin.android'

android {
compileSdkVersion Versions.COMPILE_SDK
Expand Down Expand Up @@ -36,7 +36,6 @@ android {
}

dependencies {
implementation(deps.kotlin.stdlib)
implementation(deps.androidx.appcompat)
implementation project(path: ':basic')
}
Expand Down
7 changes: 4 additions & 3 deletions eggs/Q/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion Versions.COMPILE_SDK
Expand Down Expand Up @@ -36,7 +38,6 @@ android {
}

dependencies {
implementation(deps.kotlin.stdlib)
implementation(deps.androidx.appcompat)
implementation project(path: ':basic')
}
Expand Down
2 changes: 1 addition & 1 deletion eggs/Q/src/com/android_q/egg/quares/Quare.kt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Quare(val width: Int, val height: Int, val depth: Int) : Parcelable {
return 0
}

override fun writeToParcel(p: Parcel?, flags: Int) {
override fun writeToParcel(p: Parcel, flags: Int) {
p?.let {
p.writeInt(width)
p.writeInt(height)
Expand Down
3 changes: 1 addition & 2 deletions eggs/R/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.kotlin.android'

android {
compileSdkVersion Versions.COMPILE_SDK
Expand Down Expand Up @@ -36,7 +36,6 @@ android {
}

dependencies {
implementation(deps.kotlin.stdlib)
implementation(deps.androidx.appcompat)
implementation(deps.androidx.core.ktx)
implementation(deps.androidx.recyclerview)
Expand Down
Loading

0 comments on commit 4a5b2fb

Please sign in to comment.