summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/widget/AnalogClock.java20
-rw-r--r--core/java/com/android/internal/app/PlatLogoActivity.java476
-rw-r--r--core/res/AndroidManifest.xml4
-rw-r--r--core/res/res/drawable-hdpi/clock_dial.pngbin10519 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/clock_hand_hour.pngbin2196 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/clock_hand_minute.pngbin2518 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/clock_dial.pngbin3086 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/clock_hand_hour.pngbin820 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/clock_hand_minute.pngbin913 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/clock_dial.pngbin7384 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/clock_hand_hour.pngbin1412 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/clock_hand_minute.pngbin1550 -> 0 bytes
-rw-r--r--core/res/res/drawable-nodpi/clock_dial.xml10
-rw-r--r--core/res/res/drawable-nodpi/clock_hand_hour.xml10
-rw-r--r--core/res/res/drawable-nodpi/clock_hand_minute.xml10
-rw-r--r--core/res/res/drawable-nodpi/platlogo.xml82
-rw-r--r--core/res/res/drawable-xhdpi/clock_dial.pngbin12539 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/clock_hand_hour.pngbin2642 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/clock_hand_minute.pngbin3115 -> 0 bytes
19 files changed, 312 insertions, 300 deletions
diff --git a/core/java/android/widget/AnalogClock.java b/core/java/android/widget/AnalogClock.java
index 9c1285064afb..3df09c24ca30 100644
--- a/core/java/android/widget/AnalogClock.java
+++ b/core/java/android/widget/AnalogClock.java
@@ -740,8 +740,22 @@ public class AnalogClock extends View {
}
}
- private void onTimeChanged() {
- Instant now = mClock.instant();
+ /**
+ * Return the current Instant to be used for drawing the clockface. Protected to allow
+ * subclasses to override this to show a different time from the system clock.
+ *
+ * @return the Instant to be shown on the clockface
+ * @hide
+ */
+ protected Instant now() {
+ return mClock.instant();
+ }
+
+ /**
+ * @hide
+ */
+ protected void onTimeChanged() {
+ Instant now = now();
onTimeChanged(now.atZone(mClock.getZone()).toLocalTime(), now.toEpochMilli());
}
@@ -789,7 +803,7 @@ public class AnalogClock extends View {
return;
}
- Instant now = mClock.instant();
+ Instant now = now();
ZonedDateTime zonedDateTime = now.atZone(mClock.getZone());
LocalTime localTime = zonedDateTime.toLocalTime();
diff --git a/core/java/com/android/internal/app/PlatLogoActivity.java b/core/java/com/android/internal/app/PlatLogoActivity.java
index 986bbc8628ec..b7f6a615a452 100644
--- a/core/java/com/android/internal/app/PlatLogoActivity.java
+++ b/core/java/com/android/internal/app/PlatLogoActivity.java
@@ -16,9 +16,9 @@
package com.android.internal.app;
+import static android.graphics.PixelFormat.TRANSLUCENT;
+
import android.animation.ObjectAnimator;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.app.ActionBar;
import android.app.Activity;
import android.content.ActivityNotFoundException;
@@ -26,22 +26,21 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
-import android.graphics.Color;
import android.graphics.ColorFilter;
-import android.graphics.LinearGradient;
import android.graphics.Paint;
-import android.graphics.PixelFormat;
import android.graphics.Rect;
-import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.provider.Settings;
-import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
+import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
import android.view.View;
-import android.view.animation.PathInterpolator;
+import android.view.animation.DecelerateInterpolator;
+import android.view.animation.OvershootInterpolator;
+import android.widget.AnalogClock;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -49,17 +48,22 @@ import com.android.internal.R;
import org.json.JSONObject;
+import java.time.Clock;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+
/**
* @hide
*/
public class PlatLogoActivity extends Activity {
- private static final boolean WRITE_SETTINGS = true;
-
- private static final String R_EGG_UNLOCK_SETTING = "egg_mode_r";
+ private static final String TAG = "PlatLogoActivity";
- private static final int UNLOCK_TRIES = 3;
+ private static final String S_EGG_UNLOCK_SETTING = "egg_mode_s";
- BigDialView mDialView;
+ private SettableAnalogClock mClock;
+ private ImageView mLogo;
+ private BubblesDrawable mBg;
@Override
protected void onPause() {
@@ -69,42 +73,81 @@ public class PlatLogoActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- final float dp = getResources().getDisplayMetrics().density;
- getWindow().getDecorView().setSystemUiVisibility(
- View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
getWindow().setNavigationBarColor(0);
getWindow().setStatusBarColor(0);
final ActionBar ab = getActionBar();
if (ab != null) ab.hide();
- mDialView = new BigDialView(this, null);
- if (Settings.System.getLong(getContentResolver(),
- R_EGG_UNLOCK_SETTING, 0) == 0) {
- mDialView.setUnlockTries(UNLOCK_TRIES);
- } else {
- mDialView.setUnlockTries(0);
- }
-
final FrameLayout layout = new FrameLayout(this);
- layout.setBackgroundColor(0xFFFF0000);
- layout.addView(mDialView, FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT);
+
+ mClock = new SettableAnalogClock(this);
+
+ final DisplayMetrics dm = getResources().getDisplayMetrics();
+ final float dp = dm.density;
+ final int minSide = Math.min(dm.widthPixels, dm.heightPixels);
+ final int widgetSize = (int) (minSide * 0.75);
+ final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(widgetSize, widgetSize);
+ lp.gravity = Gravity.CENTER;
+ layout.addView(mClock, lp);
+
+ mLogo = new ImageView(this);
+ mLogo.setVisibility(View.GONE);
+ mLogo.setImageResource(R.drawable.platlogo);
+ layout.addView(mLogo, lp);
+
+ mBg = new BubblesDrawable();
+ mBg.setLevel(0);
+ mBg.avoid = widgetSize / 2;
+ mBg.padding = 0.5f * dp;
+ mBg.minR = 1 * dp;
+ layout.setBackground(mBg);
+
setContentView(layout);
}
+ private boolean shouldWriteSettings() {
+ return getPackageName().equals("android");
+ }
+
private void launchNextStage(boolean locked) {
+ mClock.animate()
+ .alpha(0f).scaleX(0.5f).scaleY(0.5f)
+ .withEndAction(() -> mClock.setVisibility(View.GONE))
+ .start();
+
+ mLogo.setAlpha(0f);
+ mLogo.setScaleX(0.5f);
+ mLogo.setScaleY(0.5f);
+ mLogo.setVisibility(View.VISIBLE);
+ mLogo.animate()
+ .alpha(1f)
+ .scaleX(1f)
+ .scaleY(1f)
+ .setInterpolator(new OvershootInterpolator())
+ .start();
+
+ mLogo.postDelayed(() -> {
+ final ObjectAnimator anim = ObjectAnimator.ofInt(mBg, "level", 0, 10000);
+ anim.setInterpolator(new DecelerateInterpolator(1f));
+ anim.start();
+ },
+ 500
+ );
+
final ContentResolver cr = getContentResolver();
try {
- if (WRITE_SETTINGS) {
+ if (shouldWriteSettings()) {
+ Log.v(TAG, "Saving egg unlock=" + locked);
+ syncTouchPressure();
Settings.System.putLong(cr,
- R_EGG_UNLOCK_SETTING,
+ S_EGG_UNLOCK_SETTING,
locked ? 0 : System.currentTimeMillis());
}
} catch (RuntimeException e) {
- Log.e("com.android.internal.app.PlatLogoActivity", "Can't write settings", e);
+ Log.e(TAG, "Can't write settings", e);
}
try {
@@ -151,7 +194,7 @@ public class PlatLogoActivity extends Activity {
if (mPressureMax >= 0) {
touchData.put("min", mPressureMin);
touchData.put("max", mPressureMax);
- if (WRITE_SETTINGS) {
+ if (shouldWriteSettings()) {
Settings.System.putString(getContentResolver(), TOUCH_STATS,
touchData.toString());
}
@@ -173,44 +216,35 @@ public class PlatLogoActivity extends Activity {
super.onStop();
}
- class BigDialView extends ImageView {
- private static final int COLOR_GREEN = 0xff3ddc84;
- private static final int COLOR_BLUE = 0xff4285f4;
- private static final int COLOR_NAVY = 0xff073042;
- private static final int COLOR_ORANGE = 0xfff86734;
- private static final int COLOR_CHARTREUSE = 0xffeff7cf;
- private static final int COLOR_LIGHTBLUE = 0xffd7effe;
-
- private static final int STEPS = 11;
- private static final float VALUE_CHANGE_MAX = 1f / STEPS;
-
- private BigDialDrawable mDialDrawable;
- private boolean mWasLocked;
-
- BigDialView(Context context, @Nullable AttributeSet attrs) {
- super(context, attrs);
- init();
- }
-
- BigDialView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- init();
- }
-
- BigDialView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
- int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- init();
- }
+ /**
+ * Subclass of AnalogClock that allows the user to flip up the glass and adjust the hands.
+ */
+ public class SettableAnalogClock extends AnalogClock {
+ private int mOverrideHour = -1;
+ private int mOverrideMinute = -1;
+ private boolean mOverride = false;
- private void init() {
- mDialDrawable = new BigDialDrawable();
- setImageDrawable(mDialDrawable);
+ public SettableAnalogClock(Context context) {
+ super(context);
}
@Override
- public void onDraw(Canvas c) {
- super.onDraw(c);
+ protected Instant now() {
+ final Instant realNow = super.now();
+ final ZoneId tz = Clock.systemDefaultZone().getZone();
+ final ZonedDateTime zdTime = realNow.atZone(tz);
+ if (mOverride) {
+ if (mOverrideHour < 0) {
+ mOverrideHour = zdTime.getHour();
+ }
+ return Clock.fixed(zdTime
+ .withHour(mOverrideHour)
+ .withMinute(mOverrideMinute)
+ .withSecond(0)
+ .toInstant(), tz).instant();
+ } else {
+ return realNow;
+ }
}
double toPositiveDegrees(double rad) {
@@ -221,226 +255,174 @@ public class PlatLogoActivity extends Activity {
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
- mWasLocked = mDialDrawable.isLocked();
+ mOverride = true;
// pass through
case MotionEvent.ACTION_MOVE:
+ measureTouchPressure(ev);
+
float x = ev.getX();
float y = ev.getY();
- float cx = (getLeft() + getRight()) / 2f;
- float cy = (getTop() + getBottom()) / 2f;
+ float cx = getWidth() / 2f;
+ float cy = getHeight() / 2f;
float angle = (float) toPositiveDegrees(Math.atan2(x - cx, y - cy));
- final int oldLevel = mDialDrawable.getUserLevel();
- mDialDrawable.touchAngle(angle);
- final int newLevel = mDialDrawable.getUserLevel();
- if (oldLevel != newLevel) {
- performHapticFeedback(newLevel == STEPS
- ? HapticFeedbackConstants.CONFIRM
- : HapticFeedbackConstants.CLOCK_TICK);
+
+ int minutes = (75 - (int) (angle / 6)) % 60;
+ int minuteDelta = minutes - mOverrideMinute;
+ if (minuteDelta != 0) {
+ if (Math.abs(minuteDelta) > 45 && mOverrideHour >= 0) {
+ int hourDelta = (minuteDelta < 0) ? 1 : -1;
+ mOverrideHour = (mOverrideHour + 24 + hourDelta) % 24;
+ }
+ mOverrideMinute = minutes;
+ if (mOverrideMinute == 0) {
+ performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ if (getScaleX() == 1f) {
+ setScaleX(1.05f);
+ setScaleY(1.05f);
+ animate().scaleX(1f).scaleY(1f).setDuration(150).start();
+ }
+ } else {
+ performHapticFeedback(HapticFeedbackConstants.CLOCK_TICK);
+ }
+
+ onTimeChanged();
+ postInvalidate();
}
+
return true;
case MotionEvent.ACTION_UP:
- if (mWasLocked != mDialDrawable.isLocked()) {
- launchNextStage(mDialDrawable.isLocked());
+ if (mOverrideMinute == 0 && (mOverrideHour % 12) == 0) {
+ Log.v(TAG, "12:00 let's gooooo");
+ performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+ launchNextStage(false);
}
return true;
}
return false;
}
+ }
- @Override
- public boolean performClick() {
- if (mDialDrawable.getUserLevel() < STEPS - 1) {
- mDialDrawable.setUserLevel(mDialDrawable.getUserLevel() + 1);
- performHapticFeedback(HapticFeedbackConstants.CLOCK_TICK);
- }
- return true;
- }
-
- void setUnlockTries(int tries) {
- mDialDrawable.setUnlockTries(tries);
- }
+ static class Bubble {
+ public float x, y, r;
+ public int color;
+ }
- private class BigDialDrawable extends Drawable {
- public final int STEPS = 10;
- private int mUnlockTries = 0;
- final Paint mPaint = new Paint();
- final Drawable mEleven;
- private boolean mNightMode;
- private float mValue = 0f;
- float mElevenAnim = 0f;
- ObjectAnimator mElevenShowAnimator = ObjectAnimator.ofFloat(this, "elevenAnim", 0f,
- 1f).setDuration(300);
- ObjectAnimator mElevenHideAnimator = ObjectAnimator.ofFloat(this, "elevenAnim", 1f,
- 0f).setDuration(500);
-
- BigDialDrawable() {
- mNightMode = getContext().getResources().getConfiguration().isNightModeActive();
- mEleven = getContext().getDrawable(R.drawable.ic_number11);
- mElevenShowAnimator.setInterpolator(new PathInterpolator(0.4f, 0f, 0.2f, 1f));
- mElevenHideAnimator.setInterpolator(new PathInterpolator(0.8f, 0.2f, 0.6f, 1f));
- }
+ class BubblesDrawable extends Drawable {
+ private static final int MAX_BUBBS = 2000;
- public void setUnlockTries(int count) {
- if (mUnlockTries != count) {
- mUnlockTries = count;
- setValue(getValue());
- invalidateSelf();
- }
- }
+ private final int[] mColorIds = {
+ android.R.color.system_accent1_400,
+ android.R.color.system_accent1_500,
+ android.R.color.system_accent1_600,
- boolean isLocked() {
- return mUnlockTries > 0;
- }
+ android.R.color.system_accent2_400,
+ android.R.color.system_accent2_500,
+ android.R.color.system_accent2_600,
+ };
- public void setValue(float v) {
- // until the dial is "unlocked", you can't turn it all the way to 11
- final float max = isLocked() ? 1f - 1f / STEPS : 1f;
- mValue = v < 0f ? 0f : v > max ? max : v;
- invalidateSelf();
- }
+ private int[] mColors = new int[mColorIds.length];
- public float getValue() {
- return mValue;
- }
+ private final Bubble[] mBubbs = new Bubble[MAX_BUBBS];
+ private int mNumBubbs;
- public int getUserLevel() {
- return Math.round(getValue() * STEPS - 0.25f);
- }
+ private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
- public void setUserLevel(int i) {
- setValue(getValue() + ((float) i) / STEPS);
- }
+ public float avoid = 0f;
+ public float padding = 0f;
+ public float minR = 0f;
- public float getElevenAnim() {
- return mElevenAnim;
+ BubblesDrawable() {
+ for (int i = 0; i < mColorIds.length; i++) {
+ mColors[i] = getColor(mColorIds[i]);
}
-
- public void setElevenAnim(float f) {
- if (mElevenAnim != f) {
- mElevenAnim = f;
- invalidateSelf();
- }
+ for (int j = 0; j < mBubbs.length; j++) {
+ mBubbs[j] = new Bubble();
}
+ }
- @Override
- public void draw(@NonNull Canvas canvas) {
- final Rect bounds = getBounds();
- final int w = bounds.width();
- final int h = bounds.height();
- final float w2 = w / 2f;
- final float h2 = h / 2f;
- final float radius = w / 4f;
-
- canvas.drawColor(mNightMode ? COLOR_NAVY : COLOR_LIGHTBLUE);
-
- canvas.save();
- canvas.rotate(45, w2, h2);
- canvas.clipRect(w2, h2 - radius, Math.min(w, h), h2 + radius);
- final int gradientColor = mNightMode ? 0x60000020 : (0x10FFFFFF & COLOR_NAVY);
- mPaint.setShader(
- new LinearGradient(w2, h2, Math.min(w, h), h2, gradientColor,
- 0x00FFFFFF & gradientColor, Shader.TileMode.CLAMP));
- mPaint.setColor(Color.BLACK);
- canvas.drawPaint(mPaint);
- mPaint.setShader(null);
- canvas.restore();
-
- mPaint.setStyle(Paint.Style.FILL);
- mPaint.setColor(COLOR_GREEN);
-
- canvas.drawCircle(w2, h2, radius, mPaint);
-
- mPaint.setColor(mNightMode ? COLOR_LIGHTBLUE : COLOR_NAVY);
- final float cx = w * 0.85f;
- for (int i = 0; i < STEPS; i++) {
- final float f = (float) i / STEPS;
- canvas.save();
- final float angle = valueToAngle(f);
- canvas.rotate(-angle, w2, h2);
- canvas.drawCircle(cx, h2, (i <= getUserLevel()) ? 20 : 5, mPaint);
- canvas.restore();
- }
-
- if (mElevenAnim > 0f) {
- final int color = COLOR_ORANGE;
- final int size2 = (int) ((0.5 + 0.5f * mElevenAnim) * w / 14);
- final float cx11 = cx + size2 / 4f;
- mEleven.setBounds((int) cx11 - size2, (int) h2 - size2,
- (int) cx11 + size2, (int) h2 + size2);
- final int alpha = 0xFFFFFF | ((int) clamp(0xFF * 2 * mElevenAnim, 0, 0xFF)
- << 24);
- mEleven.setTint(alpha & color);
- mEleven.draw(canvas);
- }
-
- // don't want to use the rounded value here since the quantization will be visible
- final float angle = valueToAngle(mValue);
-
- // it's easier to draw at far-right and rotate backwards
- canvas.rotate(-angle, w2, h2);
- mPaint.setColor(Color.WHITE);
- final float dimple = w2 / 12f;
- canvas.drawCircle(w - radius - dimple * 2, h2, dimple, mPaint);
+ @Override
+ public void draw(Canvas canvas) {
+ final float f = getLevel() / 10000f;
+ mPaint.setStyle(Paint.Style.FILL);
+ 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);
+ drawn++;
}
+ }
- float clamp(float x, float a, float b) {
- return x < a ? a : x > b ? b : x;
- }
+ @Override
+ protected boolean onLevelChange(int level) {
+ invalidateSelf();
+ return true;
+ }
- float angleToValue(float a) {
- return 1f - clamp(a / (360 - 45), 0f, 1f);
- }
+ @Override
+ protected void onBoundsChange(Rect bounds) {
+ super.onBoundsChange(bounds);
+ randomize();
+ }
- // rotation: min is at 4:30, max is at 3:00
- float valueToAngle(float v) {
- return (1f - v) * (360 - 45);
+ private void randomize() {
+ final float w = getBounds().width();
+ final float h = getBounds().height();
+ final float maxR = Math.min(w, h) / 3f;
+ mNumBubbs = 0;
+ if (avoid > 0f) {
+ mBubbs[mNumBubbs].x = w / 2f;
+ mBubbs[mNumBubbs].y = h / 2f;
+ mBubbs[mNumBubbs].r = avoid;
+ mBubbs[mNumBubbs].color = 0;
+ mNumBubbs++;
}
-
- public void touchAngle(float a) {
- final int oldUserLevel = getUserLevel();
- final float newValue = angleToValue(a);
- // this is how we prevent the knob from snapping from max back to min, or from
- // jumping around wherever the user presses. The new value must be pretty close
- // to the
- // previous one.
- if (Math.abs(newValue - getValue()) < VALUE_CHANGE_MAX) {
- setValue(newValue);
-
- if (isLocked() && oldUserLevel != STEPS - 1 && getUserLevel() == STEPS - 1) {
- mUnlockTries--;
- } else if (!isLocked() && getUserLevel() == 0) {
- mUnlockTries = UNLOCK_TRIES;
+ for (int j = 0; j < MAX_BUBBS; j++) {
+ // a simple but time-tested bubble-packing algorithm:
+ // 1. pick a spot
+ // 2. shrink the bubble until it is no longer overlapping any other bubble
+ // 3. if the bubble hasn't popped, keep it
+ int tries = 5;
+ while (tries-- > 0) {
+ float x = (float) Math.random() * w;
+ float y = (float) Math.random() * h;
+ float r = Math.min(Math.min(x, w - x), Math.min(y, h - y));
+
+ // shrink radius to fit other bubbs
+ for (int i = 0; i < mNumBubbs; i++) {
+ r = (float) Math.min(r,
+ Math.hypot(x - mBubbs[i].x, y - mBubbs[i].y) - mBubbs[i].r
+ - padding);
+ if (r < minR) break;
}
- if (!isLocked()) {
- if (getUserLevel() == STEPS && mElevenAnim != 1f
- && !mElevenShowAnimator.isRunning()) {
- mElevenHideAnimator.cancel();
- mElevenShowAnimator.start();
- } else if (getUserLevel() != STEPS && mElevenAnim == 1f
- && !mElevenHideAnimator.isRunning()) {
- mElevenShowAnimator.cancel();
- mElevenHideAnimator.start();
- }
+ if (r >= minR) {
+ // we have found a spot for this bubble to live, let's save it and move on
+ r = Math.min(maxR, r);
+
+ mBubbs[mNumBubbs].x = x;
+ mBubbs[mNumBubbs].y = y;
+ mBubbs[mNumBubbs].r = r;
+ mBubbs[mNumBubbs].color = mColors[(int) (Math.random() * mColors.length)];
+ mNumBubbs++;
+ break;
}
}
}
+ Log.v(TAG, String.format("successfully placed %d bubbles (%d%%)",
+ mNumBubbs, (int) (100f * mNumBubbs / MAX_BUBBS)));
+ }
- @Override
- public void setAlpha(int i) {
- }
+ @Override
+ public void setAlpha(int alpha) { }
- @Override
- public void setColorFilter(@Nullable ColorFilter colorFilter) {
- }
+ @Override
+ public void setColorFilter(ColorFilter colorFilter) { }
- @Override
- public int getOpacity() {
- return PixelFormat.TRANSLUCENT;
- }
+ @Override
+ public int getOpacity() {
+ return TRANSLUCENT;
}
}
-}
-
-
+}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 7b97902da0b1..4dec0ffccb5e 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -5902,8 +5902,8 @@
android:process=":ui">
</activity>
<activity android:name="com.android.internal.app.PlatLogoActivity"
- android:theme="@style/Theme.DeviceDefault.DayNight"
- android:configChanges="orientation|keyboardHidden"
+ android:theme="@style/Theme.DeviceDefault.Wallpaper.NoTitleBar"
+ android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
android:icon="@drawable/platlogo"
android:process=":ui">
</activity>
diff --git a/core/res/res/drawable-hdpi/clock_dial.png b/core/res/res/drawable-hdpi/clock_dial.png
deleted file mode 100644
index 9de29bc0e53e..000000000000
--- a/core/res/res/drawable-hdpi/clock_dial.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/clock_hand_hour.png b/core/res/res/drawable-hdpi/clock_hand_hour.png
deleted file mode 100644
index 9f7e5c02d49c..000000000000
--- a/core/res/res/drawable-hdpi/clock_hand_hour.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/clock_hand_minute.png b/core/res/res/drawable-hdpi/clock_hand_minute.png
deleted file mode 100644
index 2eec38060c45..000000000000
--- a/core/res/res/drawable-hdpi/clock_hand_minute.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/clock_dial.png b/core/res/res/drawable-ldpi/clock_dial.png
deleted file mode 100644
index cbc996185cc7..000000000000
--- a/core/res/res/drawable-ldpi/clock_dial.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/clock_hand_hour.png b/core/res/res/drawable-ldpi/clock_hand_hour.png
deleted file mode 100644
index 3362fd0775d5..000000000000
--- a/core/res/res/drawable-ldpi/clock_hand_hour.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/clock_hand_minute.png b/core/res/res/drawable-ldpi/clock_hand_minute.png
deleted file mode 100644
index 5c73d45ada5c..000000000000
--- a/core/res/res/drawable-ldpi/clock_hand_minute.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/clock_dial.png b/core/res/res/drawable-mdpi/clock_dial.png
deleted file mode 100644
index 82f73fec0423..000000000000
--- a/core/res/res/drawable-mdpi/clock_dial.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/clock_hand_hour.png b/core/res/res/drawable-mdpi/clock_hand_hour.png
deleted file mode 100644
index 1f0aec80ba14..000000000000
--- a/core/res/res/drawable-mdpi/clock_hand_hour.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/clock_hand_minute.png b/core/res/res/drawable-mdpi/clock_hand_minute.png
deleted file mode 100644
index 6cd8a4bfa48d..000000000000
--- a/core/res/res/drawable-mdpi/clock_hand_minute.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-nodpi/clock_dial.xml b/core/res/res/drawable-nodpi/clock_dial.xml
new file mode 100644
index 000000000000..5263218ef880
--- /dev/null
+++ b/core/res/res/drawable-nodpi/clock_dial.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="380dp"
+ android:height="380dp"
+ android:viewportWidth="380"
+ android:viewportHeight="380">
+ <path
+ android:pathData="M177.389,2.803C185.381,-0.934 194.619,-0.934 202.611,2.803L231.193,16.169C234.358,17.649 237.76,18.56 241.242,18.861L272.677,21.577C281.467,22.336 289.468,26.956 294.52,34.188L312.59,60.054C314.591,62.919 317.081,65.409 319.946,67.41L345.812,85.48C353.044,90.533 357.664,98.533 358.423,107.323L361.139,138.758C361.44,142.24 362.351,145.642 363.832,148.807L377.197,177.389C380.934,185.381 380.934,194.619 377.197,202.611L363.832,231.193C362.351,234.359 361.44,237.76 361.139,241.242L358.423,272.677C357.664,281.467 353.044,289.468 345.812,294.52L319.946,312.59C317.081,314.591 314.591,317.081 312.59,319.946L294.52,345.812C289.468,353.044 281.467,357.664 272.677,358.423L241.242,361.139C237.76,361.44 234.359,362.351 231.193,363.832L202.611,377.197C194.619,380.934 185.381,380.934 177.389,377.197L148.807,363.832C145.642,362.351 142.24,361.44 138.758,361.139L107.323,358.423C98.533,357.664 90.533,353.044 85.48,345.812L67.41,319.946C65.409,317.081 62.919,314.591 60.054,312.59L34.188,294.52C26.956,289.468 22.336,281.467 21.577,272.677L18.861,241.242C18.56,237.76 17.649,234.359 16.169,231.193L2.803,202.611C-0.934,194.619 -0.934,185.381 2.803,177.389L16.169,148.807C17.649,145.642 18.56,142.24 18.861,138.758L21.577,107.323C22.336,98.533 26.956,90.533 34.188,85.48L60.054,67.41C62.919,65.409 65.409,62.919 67.41,60.054L85.48,34.188C90.533,26.956 98.533,22.336 107.323,21.577L138.758,18.861C142.24,18.56 145.642,17.649 148.807,16.169L177.389,2.803Z"
+ android:fillColor="@color/system_neutral1_200"/>
+</vector>
diff --git a/core/res/res/drawable-nodpi/clock_hand_hour.xml b/core/res/res/drawable-nodpi/clock_hand_hour.xml
new file mode 100644
index 000000000000..de165a429a57
--- /dev/null
+++ b/core/res/res/drawable-nodpi/clock_hand_hour.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="380dp"
+ android:height="380dp"
+ android:viewportWidth="380"
+ android:viewportHeight="380">
+ <path
+ android:pathData="M190,96L190,96A16,16 0,0 1,206 112L206,190A16,16 0,0 1,190 206L190,206A16,16 0,0 1,174 190L174,112A16,16 0,0 1,190 96z"
+ android:fillColor="@color/system_accent1_700"/>
+</vector>
diff --git a/core/res/res/drawable-nodpi/clock_hand_minute.xml b/core/res/res/drawable-nodpi/clock_hand_minute.xml
new file mode 100644
index 000000000000..72cac6e88597
--- /dev/null
+++ b/core/res/res/drawable-nodpi/clock_hand_minute.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="380dp"
+ android:height="380dp"
+ android:viewportWidth="380"
+ android:viewportHeight="380">
+ <path
+ android:pathData="M190,60L190,60A16,16 0,0 1,206 76L206,190A16,16 0,0 1,190 206L190,206A16,16 0,0 1,174 190L174,76A16,16 0,0 1,190 60z"
+ android:fillColor="@color/system_accent2_500"/>
+</vector>
diff --git a/core/res/res/drawable-nodpi/platlogo.xml b/core/res/res/drawable-nodpi/platlogo.xml
index b01eb3944b50..1d67570cf485 100644
--- a/core/res/res/drawable-nodpi/platlogo.xml
+++ b/core/res/res/drawable-nodpi/platlogo.xml
@@ -1,50 +1,36 @@
+<!--
+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="512dp"
- android:height="512dp"
- android:viewportWidth="512"
- android:viewportHeight="512">
- <path
- android:fillColor="#F86734"
- android:pathData="M416.23 236.62h-10.67c-1.46 0-2.65-1.19-2.65-2.65v-9.85c0-1.47 1.19-2.65 2.65-2.65h23.37c1.47 0 2.66 1.19 2.66 2.65v66.9c0 1.46-1.2 2.65-2.66 2.65H418.9c-1.47 0-2.66-1.19-2.66-2.65v-54.4z"/>
- <path
- android:fillColor="#F86734"
- android:pathData="M455.51 236.62h-10.67c-1.47 0-2.65-1.19-2.65-2.65v-9.85c0-1.47 1.18-2.65 2.65-2.65h23.37c1.47 0 2.66 1.19 2.66 2.65v66.9c0 1.46-1.2 2.65-2.66 2.65h-10.05c-1.46 0-2.65-1.19-2.65-2.65v-54.4z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M364.12 400.25a4.34 4.34 0 1 0 0 8.68a4.34 4.34 0 1 0 0-8.68z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M275.46 433.53a4.84 4.84 0 1 0 0 9.68a4.84 4.84 0 1 0 0-9.68z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M184.52 418.83a5.36 5.36 0 1 0 0 10.72a5.36 5.36 0 1 0 0-10.72z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M110.42 359.19a5.89 5.89 0 1 0 0 11.78a5.89 5.89 0 1 0 0-11.78z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M75.94 270.17a6.43 6.43 0 1 0 0 12.86a6.43 6.43 0 1 0 0-12.86z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M89.48 178.57a6.98 6.98 0 1 0 0 13.96a6.98 6.98 0 1 0 0-13.96z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M147.97 103.54a7.54 7.54 0 1 0 0 15.08a7.54 7.54 0 1 0 0-15.08z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M236.63 66.7a8.1 8.1 0 1 0 0 16.2a8.1 8.1 0 1 0 0-16.2z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M327.09 78.3a8.66 8.66 0 1 0 0 17.32a8.66 8.66 0 1 0 0-17.32z"/>
- <path
- android:fillColor="#D6F0FF"
- android:pathData="M401.05 136.97a9.22 9.22 0 1 0 0 18.44a9.22 9.22 0 1 0 0-18.44z"/>
- <group>
- <path
- android:fillColor="#3DDB85"
- android:pathData="M255.45 129.46a128.11 128.11 0 1 0 0 256.22a128.11 128.11 0 1 0 0-256.22z"/>
- <path
- android:fillColor="#FFF"
- android:pathData="M339.23 236.09a21.48 21.48 0 1 0 0 42.96a21.48 21.48 0 1 0 0-42.96z"/>
- </group>
+ android:width="128dp"
+ android:height="128dp"
+ android:viewportWidth="128"
+ android:viewportHeight="128">
+ <path
+ android:pathData="M64,64m-64,0a64,64 0,1 1,128 0a64,64 0,1 1,-128 0"
+ android:fillColor="@android:color/system_accent3_500"/>
+ <path
+ android:pathData="M32.5,34.15a10,10 0,0 1,9.94 10V93.85"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#fff"
+ android:strokeLineCap="round"/>
+ <path
+ 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:fillColor="#00000000"
+ android:strokeColor="#fff"
+ android:strokeLineCap="round"/>
</vector>
diff --git a/core/res/res/drawable-xhdpi/clock_dial.png b/core/res/res/drawable-xhdpi/clock_dial.png
deleted file mode 100644
index 6cb60a296ed8..000000000000
--- a/core/res/res/drawable-xhdpi/clock_dial.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/clock_hand_hour.png b/core/res/res/drawable-xhdpi/clock_hand_hour.png
deleted file mode 100644
index bc0c5bd4d59f..000000000000
--- a/core/res/res/drawable-xhdpi/clock_hand_hour.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/clock_hand_minute.png b/core/res/res/drawable-xhdpi/clock_hand_minute.png
deleted file mode 100644
index 01d611fbbdcd..000000000000
--- a/core/res/res/drawable-xhdpi/clock_hand_minute.png
+++ /dev/null
Binary files differ