Skip to content

Commit

Permalink
Merge branch 'release/1.7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
shhu committed Sep 1, 2022
2 parents 1a0a5d0 + d8be954 commit 48cd168
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 74 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The project contains the complete code of the system Easter eggs, which aims to
## Details
| Name | SDK | Egg | Status | Use new features [*](#id_new_features) | Minimum SDK [*](#id_full_egg_mini_sdk) |
|---|:---:|---|:---:|:---:|:---:|
| Android U | | | ⌛️ | | |
| Android 13 (Tiramisu) | 33 | Paint Chips ||| 31 |
| Android 14 (Upside Down Cake) | | | ⌛️ | | |
| Android 13 (Tiramisu) | 33 | Paint Chips ||| 31 [*](#id_color_vector_fonts) |
| Android 12 (Snow Cone) | 31~32 | Paint Chips ||| 31 |
| Android 11 (Red Velvet Cake) | 30 | Cat Controls(Collection) ||| 30 |
| Android 10 (Queen Cake) | 29 | Icon Quiz ||| - |
Expand All @@ -42,11 +42,11 @@ The project contains the complete code of the system Easter eggs, which aims to

* <span id='id_new_features'>Easter eggs with new features of the system are used, and the old version of the system can only use some functions.</span>
* <span id='id_full_egg_mini_sdk'>The minimum SDK version required to fully experience Easter Egg.</span>
* <span id='id_color_vector_fonts'>Starting in [Android 13](https://developer.android.google.cn/about/versions/13/features#color-vector-fonts), the system includes rendering support for [COLRv1](https://developer.chrome.com/blog/colrv1-fonts/) fonts and updates system emoji to the COLRv1 format.</span>
* <span id='id_egg_name'>There is no specific name for the old version of Easter eggs, and the system version alias are used here.</span>

## Screenshots
![Screenshots1](./images/Screenshot_20220820_184459.png)
![Screenshots2](./images/image.jpeg)
![](./images/Screenshot_20220901_135512.png) ![](./images/STIIITCH_2022_09_01_02_14_28.PNG) ![](./images/STIIITCH_2022_09_01_02_13_58.PNG)

## Other

Expand Down
8 changes: 4 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
## 版本明细
| 名称 | SDK | 彩蛋 | 状态 | 有使用新特性 [*](#id_new_features) | 最小版本 [*](#id_full_egg_mini_sdk) |
|---|:---:|---|:---:|:---:|:---:|
| Android U | | | ⌛️ | | |
| Android 13 (Tiramisu) | 33 | Paint Chips ||| 31 |
| Android 14 (Upside Down Cake) | | | ⌛️ | | |
| Android 13 (Tiramisu) | 33 | Paint Chips ||| 31 [*](#id_color_vector_fonts) |
| Android 12 (Snow Cone) | 31~32 | Paint Chips ||| 31 |
| Android 11 (Red Velvet Cake) | 30 | Cat Controls(Collection) ||| 30 |
| Android 10 (Queen Cake) | 29 | Icon Quiz ||| - |
Expand All @@ -42,11 +42,11 @@

* <span id='id_new_features'>使用了系统新特性的彩蛋,老版本系统只能使用部分功能。</span>
* <span id='id_full_egg_mini_sdk'>完整体验彩蛋所需要的最低SDK版本。</span>
* <span id='id_color_vector_fonts'>[Android 13](https://developer.android.google.cn/about/versions/13/features#color-vector-fonts) 可支持呈现 [COLRv1](https://developer.chrome.com/blog/colrv1-fonts/) 字体,并将系统表情符号更新成了 COLRv1 格式。</span>
* <span id='id_egg_name'>老版本的彩蛋没有具体命名,这里使用系统版本别名。</span>

## 截图
![截图1](./images/Screenshot_20220820_184459.png)
![截图2](./images/image.jpeg)
![](./images/Screenshot_20220901_135512.png) ![](./images/STIIITCH_2022_09_01_02_14_28.PNG) ![](./images/STIIITCH_2022_09_01_02_13_58.PNG)

## 其他

Expand Down
6 changes: 4 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 = 18
versionName = "1.7.2"
versionCode = 19
versionName = "1.7.3"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.addAll(listOf("zh", "en"))
Expand Down Expand Up @@ -71,6 +71,8 @@ android {
dependencies {
implementation(deps.androidx.appcompat)
implementation(deps.androidx.core.ktx)
implementation(deps.androidx.lifecycle.runtime.ktx)
implementation(deps.androidx.lifecycle.viewmodel.ktx)
implementation(deps.androidx.preference.ktx)
implementation(deps.androidx.constraintlayout)
implementation(deps.androidx.browser)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
android:hasFragileUserData="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.EasterEggs">
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/com/dede/android_eggs/ChromeTabsBrowser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.graphics.Color
import android.net.Uri
import androidx.appcompat.app.AppCompatDelegate
import androidx.browser.customtabs.*
import com.google.android.material.color.DynamicColors
import com.google.android.material.color.MaterialColors

/**
Expand Down Expand Up @@ -65,7 +66,10 @@ object ChromeTabsBrowser {
if (AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES)
CustomTabsIntent.COLOR_SCHEME_DARK else CustomTabsIntent.COLOR_SCHEME_LIGHT

val color = MaterialColors.getColor(context, android.R.attr.colorPrimary, Color.WHITE)
val dynamicContext = DynamicColors.wrapContextIfAvailable(context)
val color = MaterialColors.getColor(dynamicContext,
com.google.android.material.R.attr.colorSurface,
Color.WHITE)
val params = CustomTabColorSchemeParams.Builder()
.setToolbarColor(color)
.build()
Expand Down
44 changes: 22 additions & 22 deletions app/src/main/java/com/dede/android_eggs/EasterEggsActivity.kt
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
package com.dede.android_eggs

import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.ViewAnimationUtils
import android.widget.FrameLayout
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat.Type
import androidx.core.view.updatePadding
import androidx.appcompat.widget.AppCompatImageView
import com.dede.android_eggs.databinding.ActivityEasterEggsBinding
import com.google.android.material.color.DynamicColors
import com.google.android.material.color.DynamicColorsOptions
import com.google.android.material.color.MaterialColors
import com.google.android.material.internal.EdgeToEdgeUtils
import com.google.android.material.shape.MaterialShapeDrawable
import kotlin.math.hypot
import com.google.android.material.R as MR

/**
* Easter Egg Collection
*/
class EasterEggsActivity : AppCompatActivity(), Runnable {

private lateinit var binding: ActivityEasterEggsBinding
private lateinit var ivLogo: ImageView

@SuppressLint("RestrictedApi")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val options = DynamicColorsOptions.Builder()
.setThemeOverlay(MR.style.ThemeOverlay_Material3_DynamicColors_DayNight)
.build()
DynamicColors.applyToActivityIfAvailable(this, options)
val colorPrimary = MaterialColors.getColor(this, R.attr.colorPrimary, Color.WHITE)
EdgeToEdgeUtils.applyEdgeToEdge(window, true, colorPrimary, null)
DynamicColors.applyToActivityIfAvailable(this)
EdgeToEdgeUtils.applyEdgeToEdge(window, true)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)

binding = ActivityEasterEggsBinding.inflate(layoutInflater)
setContentView(binding.root)
setSupportActionBar(binding.toolbar)
binding.appBar.statusBarForeground =
MaterialShapeDrawable.createWithElevationOverlay(this)

ViewCompat.setOnApplyWindowInsetsListener(binding.toolbar) { view, insets ->
val edge = insets.getInsets(Type.displayCutout() or Type.systemBars())
view.updatePadding(top = edge.top)
return@setOnApplyWindowInsetsListener insets
ivLogo = AppCompatImageView(this).apply {
setImageResource(R.drawable.t_platlogo)
}
val layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
).apply { gravity = Gravity.CENTER }
addContentView(ivLogo, layoutParams)

postAnim()
}

private fun postAnim() {
binding.content.visibility = View.INVISIBLE
binding.content.postDelayed(this, 200)
binding.root.visibility = View.INVISIBLE
binding.root.post(this)
}

override fun run() {
val logo = binding.logo
val content = binding.content
val logo = ivLogo
val content = binding.root
val cx = logo.x + logo.width / 2f
val cy = logo.y + logo.height / 2f
val startRadius = hypot(logo.width.toFloat(), logo.height.toFloat())
Expand All @@ -81,7 +81,7 @@ class EasterEggsActivity : AppCompatActivity(), Runnable {
}

override fun onDestroy() {
binding.content.removeCallbacks(this)
binding.root.removeCallbacks(this)
super.onDestroy()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.dede.android_eggs

import android.content.Context
import android.util.AttributeSet
import androidx.preference.Preference
import com.dede.android_eggs.BuildConfig.VERSION_CODE
import com.dede.android_eggs.BuildConfig.VERSION_NAME

Expand Down
33 changes: 33 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_android_cs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="112.578316dp"
android:viewportWidth="249"
android:viewportHeight="219">

<group
android:scaleX="0.8"
android:scaleY="0.8"
android:translateX="24.9"
android:translateY="21.9">

<path
android:fillColor="#AECBFA"
android:pathData="M43.43,71.24L24.43,104.1C22.65,107.2 22.65,111.01 24.43,114.1L70.14,193.26C71.92,196.36 75.22,198.26 78.8,198.26L170.2,198.26C173.77,198.26 177.08,196.36 178.86,193.27L206.37,145.71C209.13,140.93 215.24,139.28 220.03,142.05C224.81,144.81 226.45,150.93 223.69,155.71L190.41,213.26C188.62,216.36 185.32,218.26 181.75,218.26L67.25,218.26C63.68,218.26 60.38,216.36 58.59,213.26L1.34,114.1C-0.44,111.01 -0.44,107.2 1.34,104.1L26.11,61.24C28.87,56.45 34.99,54.82 39.77,57.58C44.56,60.34 46.19,66.45 43.43,71.24" />
<path
android:fillColor="#AECBFA"
android:pathData="M205.59,147.03L224.55,114.16C226.34,111.07 226.34,107.25 224.55,104.16L178.85,25C177.06,21.91 173.76,20 170.19,20L78.78,20C75.21,20 71.91,21.91 70.12,25L42.84,72.31C40.08,77.09 33.96,78.73 29.18,75.97C24.4,73.21 22.76,67.09 25.52,62.31L58.57,5C60.36,1.91 63.66,-0 67.24,-0L181.73,-0C185.31,-0 188.61,1.91 190.39,5L247.65,104.16C249.43,107.25 249.43,111.07 247.65,114.16L222.91,157.04C220.15,161.82 214.03,163.46 209.25,160.69C204.46,157.93 202.83,151.82 205.59,147.03Z" />
<path
android:fillColor="#4285F4"
android:pathData="M224.57,114.09L205.58,146.98C202.81,151.76 204.46,157.88 209.24,160.65 214.02,163.4 220.13,161.76 222.9,156.98L247.66,114.09C249.45,110.99 249.45,107.18 247.66,104.09L222.9,61.19C220.14,56.41 214.02,54.77 209.24,57.53 204.46,60.3 202.81,66.41 205.58,71.2L224.57,104.09C226.35,107.18 226.35,110.99 224.57,114.09M24.43,114.09L43.43,146.98C46.19,151.76 44.54,157.88 39.76,160.65 34.98,163.4 28.87,161.76 26.1,156.98L1.34,114.09C-0.45,110.99 -0.45,107.18 1.34,104.09L26.1,61.19C28.87,56.41 34.98,54.77 39.76,57.53 44.54,60.3 46.19,66.41 43.42,71.2L24.43,104.09C22.65,107.18 22.65,110.99 24.43,114.09" />
<path
android:fillColor="#E8F0FE"
android:pathData="M76.31,107.25C76.31,81.61 97.08,60.84 122.71,60.84C148.34,60.84 169.12,81.61 169.12,107.25C169.12,120.06 163.92,131.66 155.53,140.05C147.13,148.46 135.53,153.65 122.71,153.65C97.08,153.65 76.31,132.88 76.31,107.25" />
<path
android:fillColor="#4285F4"
android:pathData="M122.72,70.84C102.64,70.84 86.31,87.17 86.31,107.24C86.31,127.32 102.64,143.65 122.72,143.65C132.44,143.65 141.58,139.86 148.45,132.99C155.33,126.11 159.12,116.97 159.12,107.24C159.12,87.17 142.79,70.84 122.72,70.84M122.72,163.65C91.61,163.65 66.31,138.35 66.31,107.24C66.31,76.14 91.61,50.84 122.72,50.84C153.82,50.84 179.12,76.14 179.12,107.24C179.12,122.31 173.25,136.47 162.6,147.13C151.95,157.78 137.79,163.65 122.72,163.65" />
<path
android:fillColor="#4285F4"
android:pathData="M152.72,179.24L139.49,156.33C136.74,151.55 138.37,145.43 143.15,142.67C147.94,139.91 154.06,141.55 156.82,146.33L170.04,169.24C172.81,174.02 171.16,180.14 166.38,182.9C161.6,185.66 155.49,184.02 152.72,179.24" />

</group>
</vector>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_logo_android.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="56dp"
android:height="56dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">

<group
android:scaleX="0.8"
android:scaleY="0.8"
android:translateX="2.6"
android:translateY="1.4">
<path
android:fillColor="#71D98C"
android:pathData="M17.6,11.48 L19.44,8.3a0.63,0.63 0,0 0,-1.09 -0.63l-1.88,3.24a11.43,11.43 0,0 0,-8.94 0L5.65,7.67a0.63,0.63 0,0 0,-1.09 0.63L6.4,11.48A10.81,10.81 0,0 0,1 20L23,20A10.81,10.81 0,0 0,17.6 11.48ZM7,17.25A1.25,1.25 0,1 1,8.25 16,1.25 1.25,0 0,1 7,17.25ZM17,17.25A1.25,1.25 0,1 1,18.25 16,1.25 1.25,0 0,1 17,17.25Z" />
</group>
</vector>
17 changes: 17 additions & 0 deletions app/src/main/res/drawable-anydpi/ic_logo_github.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="56dp"
android:height="56dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="1024"
android:viewportHeight="1024">
<group
android:scaleX="0.8"
android:scaleY="0.8"
android:translateX="102.4"
android:translateY="102.4">
<path
android:fillColor="@android:color/black"
android:pathData="M512 42.666667A464.64 464.64 0 0 0 42.666667 502.186667 460.373333 460.373333 0 0 0 363.52 938.666667c23.466667 4.266667 32-9.813333 32-22.186667v-78.08c-130.56 27.733333-158.293333-61.44-158.293333-61.44a122.026667 122.026667 0 0 0-52.053334-67.413333c-42.666667-28.16 3.413333-27.733333 3.413334-27.733334a98.56 98.56 0 0 1 71.68 47.36 101.12 101.12 0 0 0 136.533333 37.973334 99.413333 99.413333 0 0 1 29.866667-61.44c-104.106667-11.52-213.333333-50.773333-213.333334-226.986667a177.066667 177.066667 0 0 1 47.36-124.16 161.28 161.28 0 0 1 4.693334-121.173333s39.68-12.373333 128 46.933333a455.68 455.68 0 0 1 234.666666 0c89.6-59.306667 128-46.933333 128-46.933333a161.28 161.28 0 0 1 4.693334 121.173333A177.066667 177.066667 0 0 1 810.666667 477.866667c0 176.64-110.08 215.466667-213.333334 226.986666a106.666667 106.666667 0 0 1 32 85.333334v125.866666c0 14.933333 8.533333 26.88 32 22.186667A460.8 460.8 0 0 0 981.333333 502.186667 464.64 464.64 0 0 0 512 42.666667" />
</group>

</vector>
39 changes: 17 additions & 22 deletions app/src/main/res/layout/activity_easter_eggs.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EasterEggsActivity">

<LinearLayout
android:id="@+id/content"
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:liftOnScroll="true">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true" />

<fragment
android:id="@+id/fl_eggs"
android:name="com.dede.android_eggs.EasterEggsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
app:layout_scrollFlags="scroll|enterAlways|snap"
app:titleCentered="true" />
</com.google.android.material.appbar.AppBarLayout>

<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/t_platlogo" />

</FrameLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fl_eggs"
android:name="com.dede.android_eggs.EasterEggsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
1 change: 0 additions & 1 deletion app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<style name="Theme.EasterEggs" parent="Base.EasterEggs">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_700</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@android:color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.EasterEggs" parent="Theme.Material3.DynamicColors.DayNight">
<!-- Status bar color. -->
<!--<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>-->
<!-- Customize your theme here. -->
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
Expand All @@ -11,7 +9,6 @@
<style name="Theme.EasterEggs" parent="Base.EasterEggs">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_500</item>
<item name="colorOnPrimary">@android:color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/locales_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="zh" />
<locale android:name="en" />
</locale-config>
6 changes: 3 additions & 3 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,19 @@

<com.dede.android_eggs.ChromeTabPreference
app:customUrl="@string/url_github"
app:iconSpaceReserved="false"
app:icon="@drawable/ic_logo_github"
app:summary="@string/summary_github"
app:title="@string/title_github" />

<com.dede.android_eggs.ChromeTabPreference
app:customUrl="@string/url_source"
app:iconSpaceReserved="false"
app:icon="@drawable/ic_android_cs"
app:summary="@string/summary_source"
app:title="@string/title_source" />

<com.dede.android_eggs.VersionPreference
app:customUrl="@string/url_beta"
app:iconSpaceReserved="false"
app:icon="@drawable/ic_logo_android"
app:title="@string/title_version" />

</PreferenceCategory>
Expand Down
2 changes: 2 additions & 0 deletions basic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ android {
dependencies {
implementation(deps.kotlinx.coroutines.core)
implementation(deps.androidx.appcompat)
implementation(deps.androidx.lifecycle.runtime.ktx)
implementation(deps.androidx.lifecycle.viewmodel.ktx)
}
Loading

0 comments on commit 48cd168

Please sign in to comment.