Skip to content

Commit

Permalink
Merge branch 'release/1.7.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
shhu committed Sep 23, 2022
2 parents b1731af + b3e69ee commit f11ad4e
Show file tree
Hide file tree
Showing 213 changed files with 1,529 additions and 77 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ The project contains the complete code of the system Easter eggs, which aims to

[中文](./README_zh.md)

## Screenshots
<img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/Screenshot_20220901_135512.png"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_14_28.PNG"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_13_58.PNG"/>

## Details
| Name | SDK | Egg | Status | Use new features [*](#id_new_features) | Minimum SDK [*](#id_full_egg_mini_sdk) |
|---|:---:|---|:---:|:---:|:---:|
Expand Down Expand Up @@ -45,8 +48,19 @@ The project contains the complete code of the system Easter eggs, which aims to
* <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
<img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/Screenshot_20220901_135512.png"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_14_28.PNG"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_13_58.PNG"/>
## Test

Using Android devices or emulators.
```shell
./gradlew app:cAT
```

Device type for emulators to be managed by the Android Gradle Plugin.

```shell
./gradlew app:pixel4Api33DebugAndroidTest
./gradlew app:nexusOneApi21DebugAndroidTest
```

## Other

Expand Down
18 changes: 16 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

[English](./README.md)

## 截图
<img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/Screenshot_20220901_135512.png"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_14_28.PNG"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_13_58.PNG"/>

## 版本明细
| 名称 | SDK | 彩蛋 | 状态 | 有使用新特性 [*](#id_new_features) | 最小版本 [*](#id_full_egg_mini_sdk) |
|---|:---:|---|:---:|:---:|:---:|
Expand Down Expand Up @@ -45,8 +48,19 @@
* <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>

## 截图
<img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/Screenshot_20220901_135512.png"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_14_28.PNG"/> <img height="512" src="https://github.com/hushenghao/AndroidEasterEggs/raw/master/images/STIIITCH_2022_09_01_02_13_58.PNG"/>
## 测试

使用Android设备或者模拟器.
```shell
./gradlew app:cAT
```

由Android Gradle插件管理的模拟器的设备类型。

```shell
./gradlew app:pixel4Api33DebugAndroidTest
./gradlew app:nexusOneApi21DebugAndroidTest
```

## 其他

Expand Down
27 changes: 25 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.android.build.api.dsl.ManagedVirtualDevice
import java.io.ByteArrayOutputStream
import java.util.*

Expand All @@ -19,8 +20,8 @@ android {
applicationId = "com.dede.android_eggs"
minSdk = Versions.MIN_SDK
targetSdk = Versions.TARGET_SDK
versionCode = 19
versionName = "1.7.3"
versionCode = 20
versionName = "1.7.4"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations.addAll(listOf("zh", "en"))
Expand Down Expand Up @@ -66,6 +67,27 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}

testOptions {
animationsDisabled = true

unitTests {
isIncludeAndroidResources = true
}

managedDevices {
devices.register<ManagedVirtualDevice>("pixel4Api33") {
apiLevel = 33
systemImageSource = "google"
device = "Pixel 4"
}
devices.register<ManagedVirtualDevice>("nexusOneApi21") {
apiLevel = 21
systemImageSource = "aosp"
device = "Nexus One"
}
}
}
}

dependencies {
Expand Down Expand Up @@ -97,6 +119,7 @@ dependencies {

testImplementation(deps.junit)
androidTestImplementation(deps.bundles.android.test)
androidTestImplementation(deps.nanohttpd)
}

tasks.register<Exec>("pgyer") {
Expand Down
38 changes: 38 additions & 0 deletions app/src/androidTest/java/com/android_g/egg/PlatLogoActivityTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.android_g.egg


import android.widget.ImageView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.dede.android_eggs.EasterEggsActivityBaseTest
import com.dede.android_eggs.R
import org.hamcrest.Matchers.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* Android Gingerbread PlatLogoActivity test
*/
@LargeTest
@RunWith(AndroidJUnit4::class)
class PlatLogoActivityTest : EasterEggsActivityBaseTest() {

@Test
fun platLogoActivityTest() {

testPlatLogo(R.string.title_android_g)

onView(allOf(withId(android.R.id.content),
withChild(`is`(instanceOf(ImageView::class.java)))))
.check(matches(isDisplayed()))
.perform(click())

pressBack()
}

}
38 changes: 38 additions & 0 deletions app/src/androidTest/java/com/android_h/egg/PlatLogoActivityTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.android_h.egg


import android.widget.ImageView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.dede.android_eggs.EasterEggsActivityBaseTest
import com.dede.android_eggs.R
import org.hamcrest.Matchers.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* Android Honeycomb PlatLogo test
*/
@LargeTest
@RunWith(AndroidJUnit4::class)
class PlatLogoActivityTest : EasterEggsActivityBaseTest() {

@Test
fun platLogoActivityTest() {

testPlatLogo(R.string.title_android_h)

onView(allOf(withId(android.R.id.content),
withChild(`is`(instanceOf(ImageView::class.java)))))
.check(matches(isDisplayed()))
.perform(click())

pressBack()
}

}
74 changes: 74 additions & 0 deletions app/src/androidTest/java/com/android_i/egg/PlatLogoActivityTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.android_i.egg


import android.view.InputDevice
import android.view.MotionEvent
import android.view.View
import android.view.ViewConfiguration
import android.widget.ImageView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.GeneralLocation
import androidx.test.espresso.action.MotionEvents
import androidx.test.espresso.action.Press
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.dede.android_eggs.EasterEggsActivityBaseTest
import com.dede.android_eggs.R
import org.hamcrest.Matcher
import org.hamcrest.Matchers.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* Android Ice Cream Sandwich PlatLogo test
*/
@LargeTest
@RunWith(AndroidJUnit4::class)
class PlatLogoActivityTest : EasterEggsActivityBaseTest() {

@Test
fun platLogoActivityTest() {

testPlatLogo(R.string.title_android_i)

// PlatLogoActivity
onView(allOf(withId(android.R.id.content),
withChild(`is`(instanceOf(ImageView::class.java)))))
.check(matches(isDisplayed()))
.perform(object : ViewAction {
override fun getConstraints(): Matcher<View> {
return isDisplayingAtLeast(90)
}

override fun getDescription(): String {
return "MotionEvent down"
}

override fun perform(uiController: UiController, view: View) {
MotionEvents.sendDown(
uiController,
GeneralLocation.CENTER.calculateCoordinates(view),
Press.FINGER.describePrecision(),
InputDevice.SOURCE_UNKNOWN,
MotionEvent.BUTTON_PRIMARY
)
// launch Nyandroid
uiController.loopMainThreadForAtLeast(ViewConfiguration.getLongPressTimeout() * 2 * 3L)
}
})

// Nyandroid
onView(allOf(withId(android.R.id.content),
withChild(`is`(instanceOf(Nyandroid.Board::class.java)))))
.check(matches(isDisplayed()))

// popup
pressBack()
}

}
41 changes: 41 additions & 0 deletions app/src/androidTest/java/com/android_j/egg/PlatLogoActivityTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.android_j.egg


import android.widget.ImageView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.longClick
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.dede.android_eggs.EasterEggsActivityBaseTest
import com.dede.android_eggs.R
import org.hamcrest.Matchers.*
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith

/**
* Android Jelly Bean PlatLogo test
*/
@LargeTest
@RunWith(AndroidJUnit4::class)
class PlatLogoActivityTest : EasterEggsActivityBaseTest() {

@Test
@Ignore("Failed on Gradle Managed Devices")
fun platLogoActivityTest() {

testPlatLogo(R.string.title_android_j)

onView(allOf(withId(android.R.id.content),
withChild(`is`(instanceOf(ImageView::class.java)))))
.check(matches(isDisplayed()))
.perform(click(), longClick())

pressBack()
}

}
44 changes: 44 additions & 0 deletions app/src/androidTest/java/com/android_k/egg/PlatLogoActivityTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.android_k.egg


import android.widget.FrameLayout
import android.widget.ImageView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.longClick
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import com.dede.android_eggs.EasterEggsActivityBaseTest
import com.dede.android_eggs.R
import org.hamcrest.Matchers.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* Android KitKat PlatLogo test
*/
@LargeTest
@RunWith(AndroidJUnit4::class)
class PlatLogoActivityTest : EasterEggsActivityBaseTest() {

@Test
fun platLogoActivityTest() {

testPlatLogo(R.string.title_android_k)

onView(allOf(withId(android.R.id.content),
withChild(`is`(instanceOf(FrameLayout::class.java)))))
.check(matches(isDisplayed()))
.perform(click(), longClick())

onView(withChild(`is`(instanceOf(ImageView::class.java))))
.check(matches(isDisplayed()))
.perform(longClick())

pressBack()
}

}
Loading

0 comments on commit f11ad4e

Please sign in to comment.