Merge "Android 1<3." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0f8269e68e
@@ -103,6 +103,7 @@ public class PlatLogoActivity extends Activity {
|
||||
mBg.padding = 0.5f * dp;
|
||||
mBg.minR = 1 * dp;
|
||||
layout.setBackground(mBg);
|
||||
layout.setOnLongClickListener(mBg);
|
||||
|
||||
setContentView(layout);
|
||||
}
|
||||
@@ -291,8 +292,8 @@ public class PlatLogoActivity extends Activity {
|
||||
|
||||
return true;
|
||||
case MotionEvent.ACTION_UP:
|
||||
if (mOverrideMinute == 0 && (mOverrideHour % 12) == 0) {
|
||||
Log.v(TAG, "12:00 let's gooooo");
|
||||
if (mOverrideMinute == 0 && (mOverrideHour % 12) == 1) {
|
||||
Log.v(TAG, "13:00");
|
||||
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
|
||||
launchNextStage(false);
|
||||
}
|
||||
@@ -302,18 +303,45 @@ public class PlatLogoActivity extends Activity {
|
||||
}
|
||||
}
|
||||
|
||||
private static final String[][] EMOJI_SETS = {
|
||||
{"🍇", "🍈", "🍉", "🍊", "🍋", "🍌", "🍍", "🥭", "🍎", "🍏", "🍐", "🍑",
|
||||
"🍒", "🍓", "🫐", "🥝"},
|
||||
{"😺", "😸", "😹", "😻", "😼", "😽", "🙀", "😿", "😾"},
|
||||
{"😀", "😃", "😄", "😁", "😆", "😅", "🤣", "😂", "🙂", "🙃", "🫠", "😉", "😊",
|
||||
"😇", "🥰", "😍", "🤩", "😘", "😗", "☺️", "😚", "😙", "🥲", "😋", "😛", "😜",
|
||||
"🤪", "😝", "🤑", "🤗", "🤭", "🫢", "🫣", "🤫", "🤔", "🫡", "🤐", "🤨", "😐",
|
||||
"😑", "😶", "🫥", "😏", "😒", "🙄", "😬", "🤥", "😌", "😔", "😪", "🤤", "😴",
|
||||
"😷"},
|
||||
{ "🤩", "😍", "🥰", "😘", "🥳", "🥲", "🥹" },
|
||||
{ "🫠" },
|
||||
{"💘", "💝", "💖", "💗", "💓", "💞", "💕", "❣", "💔", "❤", "🧡", "💛",
|
||||
"💚", "💙", "💜", "🤎", "🖤", "🤍"},
|
||||
// {"👁", "️🫦", "👁️"}, // this one is too much
|
||||
{"👽", "🛸", "✨", "🌟", "💫", "🚀", "🪐", "🌙", "⭐", "🌍"},
|
||||
{"🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"},
|
||||
{"🐙", "🪸", "🦑", "🦀", "🦐", "🐡", "🦞", "🐠", "🐟", "🐳", "🐋", "🐬", "🫧", "🌊",
|
||||
"🦈"},
|
||||
{"🙈", "🙉", "🙊", "🐵", "🐒"},
|
||||
{"♈", "♉", "♊", "♋", "♌", "♍", "♎", "♏", "♐", "♑", "♒", "♓"},
|
||||
{"🕛", "🕧", "🕐", "🕜", "🕑", "🕝", "🕒", "🕞", "🕓", "🕟", "🕔", "🕠", "🕕", "🕡",
|
||||
"🕖", "🕢", "🕗", "🕣", "🕘", "🕤", "🕙", "🕥", "🕚", "🕦"},
|
||||
{"🌺", "🌸", "💮", "🏵️", "🌼", "🌿"},
|
||||
{"🐢", "✨", "🌟", "👑"}
|
||||
};
|
||||
|
||||
static class Bubble {
|
||||
public float x, y, r;
|
||||
public int color;
|
||||
public String text = null;
|
||||
}
|
||||
|
||||
class BubblesDrawable extends Drawable {
|
||||
class BubblesDrawable extends Drawable implements View.OnLongClickListener {
|
||||
private static final int MAX_BUBBS = 2000;
|
||||
|
||||
private final int[] mColorIds = {
|
||||
android.R.color.system_accent1_400,
|
||||
android.R.color.system_accent1_500,
|
||||
android.R.color.system_accent1_600,
|
||||
android.R.color.system_accent3_400,
|
||||
android.R.color.system_accent3_500,
|
||||
android.R.color.system_accent3_600,
|
||||
|
||||
android.R.color.system_accent2_400,
|
||||
android.R.color.system_accent2_500,
|
||||
@@ -322,6 +350,8 @@ public class PlatLogoActivity extends Activity {
|
||||
|
||||
private int[] mColors = new int[mColorIds.length];
|
||||
|
||||
private int mEmojiSet = -1;
|
||||
|
||||
private final Bubble[] mBubbs = new Bubble[MAX_BUBBS];
|
||||
private int mNumBubbs;
|
||||
|
||||
@@ -342,17 +372,34 @@ public class PlatLogoActivity extends Activity {
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
if (getLevel() == 0) return;
|
||||
final float f = getLevel() / 10000f;
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
mPaint.setTextAlign(Paint.Align.CENTER);
|
||||
int drawn = 0;
|
||||
for (int j = 0; j < mNumBubbs; j++) {
|
||||
if (mBubbs[j].color == 0 || mBubbs[j].r == 0) continue;
|
||||
mPaint.setColor(mBubbs[j].color);
|
||||
canvas.drawCircle(mBubbs[j].x, mBubbs[j].y, mBubbs[j].r * f, mPaint);
|
||||
if (mBubbs[j].text != null) {
|
||||
mPaint.setTextSize(mBubbs[j].r * 1.75f);
|
||||
canvas.drawText(mBubbs[j].text, mBubbs[j].x,
|
||||
mBubbs[j].y + mBubbs[j].r * f * 0.6f, mPaint);
|
||||
} else {
|
||||
mPaint.setColor(mBubbs[j].color);
|
||||
canvas.drawCircle(mBubbs[j].x, mBubbs[j].y, mBubbs[j].r * f, mPaint);
|
||||
}
|
||||
drawn++;
|
||||
}
|
||||
}
|
||||
|
||||
public void chooseEmojiSet() {
|
||||
mEmojiSet = (int) (Math.random() * EMOJI_SETS.length);
|
||||
final String[] emojiSet = EMOJI_SETS[mEmojiSet];
|
||||
for (int j = 0; j < mBubbs.length; j++) {
|
||||
mBubbs[j].text = emojiSet[(int) (Math.random() * emojiSet.length)];
|
||||
}
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onLevelChange(int level) {
|
||||
invalidateSelf();
|
||||
@@ -423,6 +470,13 @@ public class PlatLogoActivity extends Activity {
|
||||
public int getOpacity() {
|
||||
return TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
if (getLevel() == 0) return false;
|
||||
chooseEmojiSet();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6628,7 +6628,7 @@
|
||||
android:process=":ui">
|
||||
</activity>
|
||||
<activity android:name="com.android.internal.app.PlatLogoActivity"
|
||||
android:theme="@style/Theme.DeviceDefault.Wallpaper.NoTitleBar"
|
||||
android:theme="@style/Theme.Wallpaper.NoTitleBar.Fullscreen"
|
||||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
|
||||
android:icon="@drawable/platlogo"
|
||||
android:process=":ui">
|
||||
|
||||
@@ -19,17 +19,27 @@ Copyright (C) 2021 The Android Open Source Project
|
||||
android:viewportWidth="24"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path
|
||||
android:pathData="M11 0.51a2.06 2.06 0 0 1 2 0l0.58 0.37a4.15 4.15 0 0 0 2.23 0.55l0.69-0.06a2.07 2.07 0 0 1 1.81 0.95l0.33 0.6a4.14 4.14 0 0 0 1.72 1.52l0.64 0.27a2 2 0 0 1 1.16 1.68l0 0.69A4.12 4.12 0 0 0 23 9.23l0.44 0.53a2.06 2.06 0 0 1 0.24 2l-0.3 0.62a4.14 4.14 0 0 0-0.27 2.28l0.14 0.68a2.08 2.08 0 0 1-0.72 1.91l-0.56 0.41a4 4 0 0 0-1.3 1.89l-0.19 0.66A2.06 2.06 0 0 1 19 21.58l-0.68 0.11a4.09 4.09 0 0 0-2 1.07l-0.48 0.5a2.08 2.08 0 0 1-2 0.49l-0.65-0.23a4.28 4.28 0 0 0-2.3 0l-0.65 0.23a2.08 2.08 0 0 1-2-0.49l-0.48-0.5a4 4 0 0 0-2-1.07L5 21.58A2.06 2.06 0 0 1 3.5 20.23l-0.19-0.66A4 4 0 0 0 2 17.68l-0.56-0.41a2.08 2.08 0 0 1-0.72-1.91l0.14-0.68A4.14 4.14 0 0 0 0.6 12.4l-0.3-0.62a2.06 2.06 0 0 1 0.24-2L1 9.23A4.16 4.16 0 0 0 1.8 7.08l0-0.69A2 2 0 0 1 3 4.71l0.64-0.27A4.14 4.14 0 0 0 5.34 2.92l0.33-0.6a2.07 2.07 0 0 1 1.81-0.95l0.69 0.06A4.15 4.15 0 0 0 10.4 0.88Z"
|
||||
android:fillColor="@android:color/system_accent3_400"
|
||||
android:fillColor="@android:color/system_accent1_400"
|
||||
android:pathData="M11,0.3c0.6,-0.3 1.4,-0.3 2,0l0.6,0.4c0.7,0.4 1.4,0.6 2.2,0.6l0.7,-0.1c0.7,0 1.4,0.3 1.8,0.9l0.3,0.6c0.4,0.7 1,1.2 1.7,1.5L21,4.5c0.7,0.3 1.1,0.9 1.2,1.7v0.7C22.2,7.7 22.5,8.4 23,9l0.4,0.5c0.4,0.6 0.5,1.3 0.2,2l-0.3,0.6c-0.3,0.7 -0.4,1.5 -0.3,2.3l0.1,0.7c0.1,0.7 -0.2,1.4 -0.7,1.9L22,17.5c-0.6,0.5 -1.1,1.1 -1.3,1.9L20.5,20c-0.2,0.7 -0.8,1.2 -1.5,1.4l-0.7,0.1c-0.8,0.2 -1.4,0.5 -2,1.1l-0.5,0.5c-0.5,0.5 -1.3,0.7 -2,0.5l-0.6,-0.2c-0.8,-0.2 -1.5,-0.2 -2.3,0l-0.6,0.2c-0.7,0.2 -1.5,0 -2,-0.5l-0.5,-0.5c-0.5,-0.5 -1.2,-0.9 -2,-1.1L5,21.4c-0.7,-0.2 -1.3,-0.7 -1.5,-1.4l-0.2,-0.7C3.1,18.6 2.6,18 2,17.5l-0.6,-0.4c-0.6,-0.5 -0.8,-1.2 -0.7,-1.9l0.1,-0.7c0.1,-0.8 0,-1.6 -0.3,-2.3l-0.3,-0.6c-0.3,-0.7 -0.2,-1.4 0.2,-2L1,9c0.5,-0.6 0.7,-1.4 0.8,-2.2V6.2C1.9,5.5 2.3,4.8 3,4.5l0.6,-0.3c0.7,-0.3 1.3,-0.9 1.7,-1.5l0.3,-0.6c0.4,-0.6 1.1,-1 1.8,-0.9l0.7,0.1c0.8,0 1.6,-0.2 2.2,-0.6L11,0.3z"
|
||||
/>
|
||||
<path
|
||||
android:pathData="M12.34 6.53h4.05l-2 4.05a3.95 3.95 0 0 1-0.57 7.85 4.1 4.1 0 0 1-1.45-0.27"
|
||||
android:strokeColor="@android:color/system_accent1_800"
|
||||
android:strokeWidth="2"/>
|
||||
android:pathData="M6.3,6.5l3,0l0,12.2"
|
||||
android:strokeWidth="2.22"
|
||||
android:strokeColor="@android:color/system_accent3_800"
|
||||
/>
|
||||
<path
|
||||
android:pathData="M12.34 6.53h4.05l-2 4.05a3.95 3.95 0 0 1-0.57 7.85 4.1 4.1 0 0 1-1.45-0.27"
|
||||
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="2.22"
|
||||
android:strokeColor="@android:color/system_accent3_800"
|
||||
/>
|
||||
<path
|
||||
android:pathData="M6.3,6.5l3,0l0,12.2"
|
||||
android:strokeWidth="0.56"
|
||||
android:strokeColor="@android:color/system_neutral1_100"
|
||||
android:strokeWidth="0.5"/>
|
||||
|
||||
/>
|
||||
<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="@android:color/system_neutral1_100"
|
||||
/>
|
||||
</vector>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user