diff options
author | Xin Li <delphij@google.com> | 2018-06-08 11:08:10 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2018-06-08 11:08:10 -0700 |
commit | 86eb4b9266128f0b15cfcce7a5ba6b82babb7ea1 (patch) | |
tree | 370072986bf76f0d9cb75c973b87f251d8fe2644 | |
parent | eb7744a6da2756ee1e4508fa799d7c1aef7ed665 (diff) | |
parent | 5c927bff323f902ffdde89d5115714d3e0b91a7a (diff) | |
download | android_packages_screensavers_Basic-86eb4b9266128f0b15cfcce7a5ba6b82babb7ea1.tar.gz android_packages_screensavers_Basic-86eb4b9266128f0b15cfcce7a5ba6b82babb7ea1.tar.bz2 android_packages_screensavers_Basic-86eb4b9266128f0b15cfcce7a5ba6b82babb7ea1.zip |
Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master
Bug: 79597307
Change-Id: I4a76da0091e9b63c1e8378eda89b532c4118bee4
-rw-r--r-- | res/values-as/strings.xml | 21 | ||||
-rw-r--r-- | res/values-en-rCA/strings.xml | 21 | ||||
-rw-r--r-- | res/values-en-rXC/strings.xml | 21 | ||||
-rw-r--r-- | res/values-or/strings.xml | 21 | ||||
-rw-r--r-- | res/values-si/strings.xml | 2 | ||||
-rw-r--r-- | res/values-uz/strings.xml | 2 | ||||
-rw-r--r-- | src/com/android/dreams/basic/Colors.java | 39 | ||||
-rw-r--r-- | src/com/android/dreams/basic/ColorsGLRenderer.java | 5 |
8 files changed, 105 insertions, 27 deletions
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml new file mode 100644 index 0000000..57c38e9 --- /dev/null +++ b/res/values-as/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2012 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. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="app_name" msgid="6121278918841215202">"ডে\'ড্ৰিমৰ প্ৰাথমিক সংস্কৰণ"</string> + <string name="color_dream_name" msgid="9063813186991472050">"ৰং"</string> +</resources> diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml new file mode 100644 index 0000000..5c0ad62 --- /dev/null +++ b/res/values-en-rCA/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2012 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. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="app_name" msgid="6121278918841215202">"Basic Daydreams"</string> + <string name="color_dream_name" msgid="9063813186991472050">"Colours"</string> +</resources> diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml new file mode 100644 index 0000000..a0f9676 --- /dev/null +++ b/res/values-en-rXC/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2012 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. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="app_name" msgid="6121278918841215202">"Basic Daydreams"</string> + <string name="color_dream_name" msgid="9063813186991472050">"Colors"</string> +</resources> diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml new file mode 100644 index 0000000..6dd4b1e --- /dev/null +++ b/res/values-or/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright (C) 2012 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. + --> + +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="app_name" msgid="6121278918841215202">"ସାଧାରଣ ଡେ-ଡ୍ରିମ୍"</string> + <string name="color_dream_name" msgid="9063813186991472050">"ରଙ୍ଗଗୁଡିକ"</string> +</resources> diff --git a/res/values-si/strings.xml b/res/values-si/strings.xml index 6b71627..2213767 100644 --- a/res/values-si/strings.xml +++ b/res/values-si/strings.xml @@ -16,6 +16,6 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="app_name" msgid="6121278918841215202">"මූලික දවල් හීන"</string> + <string name="app_name" msgid="6121278918841215202">"මූලික ඩෙ-ඩ්රීම්"</string> <string name="color_dream_name" msgid="9063813186991472050">"වර්ණ"</string> </resources> diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml index 593e1d2..e1d392f 100644 --- a/res/values-uz/strings.xml +++ b/res/values-uz/strings.xml @@ -16,6 +16,6 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="app_name" msgid="6121278918841215202">"Tush ko\'rish hotati standart ekrlan lavhalari"</string> + <string name="app_name" msgid="6121278918841215202">"Standart ekran lavhalari"</string> <string name="color_dream_name" msgid="9063813186991472050">"Ranglar"</string> </resources> diff --git a/src/com/android/dreams/basic/Colors.java b/src/com/android/dreams/basic/Colors.java index aaacfcd..9a75146 100644 --- a/src/com/android/dreams/basic/Colors.java +++ b/src/com/android/dreams/basic/Colors.java @@ -16,10 +16,10 @@ package com.android.dreams.basic; -import android.graphics.SurfaceTexture; import android.service.dreams.DreamService; import android.util.Log; -import android.view.TextureView; +import android.view.SurfaceHolder; +import android.view.SurfaceView; import android.os.Handler; import android.os.HandlerThread; @@ -29,7 +29,7 @@ import android.os.HandlerThread; * This dream performs its rendering using OpenGL on a separate rendering thread. * </p> */ -public class Colors extends DreamService implements TextureView.SurfaceTextureListener { +public class Colors extends DreamService implements SurfaceHolder.Callback { static final String TAG = Colors.class.getSimpleName(); static final boolean DEBUG = false; @@ -38,7 +38,7 @@ public class Colors extends DreamService implements TextureView.SurfaceTextureLi Log.v(TAG, String.format(fmt, args)); } - private TextureView mTextureView; + private SurfaceView mSurfaceView; // The handler thread and handler on which the GL renderer is running. private HandlerThread mRendererHandlerThread; @@ -53,8 +53,8 @@ public class Colors extends DreamService implements TextureView.SurfaceTextureLi setInteractive(false); - mTextureView = new TextureView(this); - mTextureView.setSurfaceTextureListener(this); + mSurfaceView = new SurfaceView(this); + mSurfaceView.getHolder().addCallback(this); if (mRendererHandlerThread == null) { mRendererHandlerThread = new HandlerThread(TAG); @@ -69,13 +69,13 @@ public class Colors extends DreamService implements TextureView.SurfaceTextureLi setInteractive(false); setLowProfile(true); setFullscreen(true); - setContentView(mTextureView); + setContentView(mSurfaceView); } @Override - public void onSurfaceTextureAvailable(final SurfaceTexture surface, - final int width, final int height) { - LOG("onSurfaceTextureAvailable(%s, %d, %d)", surface, width, height); + public void surfaceCreated(SurfaceHolder holder) { + LOG("surfaceCreated(%s, %d, %d)", holder.getSurface(), + holder.getSurfaceFrame().width(), holder.getSurfaceFrame().height()); mRendererHandler.post(new Runnable() { @Override @@ -83,16 +83,16 @@ public class Colors extends DreamService implements TextureView.SurfaceTextureLi if (mRenderer != null) { mRenderer.stop(); } - mRenderer = new ColorsGLRenderer(surface, width, height); + mRenderer = new ColorsGLRenderer(holder.getSurface(), + holder.getSurfaceFrame().width(), holder.getSurfaceFrame().height()); mRenderer.start(); } }); } @Override - public void onSurfaceTextureSizeChanged(SurfaceTexture surface, - final int width, final int height) { - LOG("onSurfaceTextureSizeChanged(%s, %d, %d)", surface, width, height); + public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { + LOG("surfaceChanged(%s, %d, %d, %d)", holder.getSurface(), format, width, height); mRendererHandler.post(new Runnable() { @Override @@ -105,8 +105,8 @@ public class Colors extends DreamService implements TextureView.SurfaceTextureLi } @Override - public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { - LOG("onSurfaceTextureDestroyed(%s)", surface); + public void surfaceDestroyed(SurfaceHolder holder) { + LOG("surfaceDestroyed(%s)", holder.getSurface()); mRendererHandler.post(new Runnable() { @Override @@ -124,12 +124,5 @@ public class Colors extends DreamService implements TextureView.SurfaceTextureLi } catch (InterruptedException e) { LOG("Error while waiting for renderer", e); } - - return true; - } - - @Override - public void onSurfaceTextureUpdated(SurfaceTexture surface) { - LOG("onSurfaceTextureUpdated(%s)", surface); } } diff --git a/src/com/android/dreams/basic/ColorsGLRenderer.java b/src/com/android/dreams/basic/ColorsGLRenderer.java index 91e4432..6c4b466 100644 --- a/src/com/android/dreams/basic/ColorsGLRenderer.java +++ b/src/com/android/dreams/basic/ColorsGLRenderer.java @@ -20,6 +20,7 @@ import android.graphics.Color; import android.graphics.SurfaceTexture; import android.util.Log; import android.view.Choreographer; +import android.view.Surface; import android.os.SystemClock; import javax.microedition.khronos.egl.EGL10; @@ -54,7 +55,7 @@ final class ColorsGLRenderer implements Choreographer.FrameCallback { Log.v(TAG, String.format(fmt, args)); } - private final SurfaceTexture mSurface; + private final Surface mSurface; private int mWidth; private int mHeight; @@ -70,7 +71,7 @@ final class ColorsGLRenderer implements Choreographer.FrameCallback { private EGLContext mEglContext; private EGLSurface mEglSurface; - public ColorsGLRenderer(SurfaceTexture surface, int width, int height) { + public ColorsGLRenderer(Surface surface, int width, int height) { mSurface = surface; mWidth = width; mHeight = height; |