aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-10-03 23:52:22 +0200
committerJorge Ruesga <jorge@ruesga.com>2013-10-03 23:52:22 +0200
commit059fa42d786915d7725e4fcf79f9de36e84f08c7 (patch)
treee2f4555011f9b61dcf25b3b2d3d8a4dee854cbdb /src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java
parent20574cf663cc4c24d4eb64a8f879632bcddf8828 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-059fa42d786915d7725e4fcf79f9de36e84f08c7.tar.gz
android_packages_wallpapers_PhotoPhase-059fa42d786915d7725e4fcf79f9de36e84f08c7.tar.bz2
android_packages_wallpapers_PhotoPhase-059fa42d786915d7725e4fcf79f9de36e84f08c7.zip
Change author and copyright
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java')
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java171
1 files changed, 0 insertions, 171 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java
deleted file mode 100644
index 973618d..0000000
--- a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseActivity.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2013 The CyanogenMod 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.
- */
-
-package org.cyanogenmod.wallpapers.photophase;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnTouchListener;
-import android.view.Window;
-import android.view.WindowManager;
-
-import org.cyanogenmod.wallpapers.photophase.preferences.PhotoPhasePreferences;
-import org.cyanogenmod.wallpapers.photophase.preferences.PreferencesProvider;
-
-/**
- * A testing activity to simulate the PhotoPhase Live Wallpaper inside an GLES activity.
- */
-public class PhotoPhaseActivity extends Activity implements OnTouchListener {
-
- private static final String TAG = "PhotoPhaseActivity";
-
- private static final boolean DEBUG = false;
-
- private GLSurfaceView mGLSurfaceView;
- private PhotoPhaseRenderer mRenderer;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- if (DEBUG) Log.d(TAG, "onCreate");
- super.onCreate(savedInstanceState);
-
- boolean preserveEglCtx = getResources().getBoolean(R.bool.config_preserve_egl_context);
-
- // Instance the application
- PreferencesProvider.reload(this);
- Colors.register(this);
-
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
-
- // Configure the EGL context
- mGLSurfaceView = new GLSurfaceView(getApplicationContext());
- mGLSurfaceView.setEGLContextClientVersion(2);
- mGLSurfaceView.setEGLConfigChooser(false);
- mRenderer = new PhotoPhaseRenderer(this, new GLESSurfaceDispatcher(mGLSurfaceView));
- mGLSurfaceView.setRenderer(mRenderer);
- mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
- mGLSurfaceView.setPreserveEGLContextOnPause(preserveEglCtx);
- mGLSurfaceView.setOnTouchListener(this);
- setContentView(mGLSurfaceView);
-
- mRenderer.onCreate();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onDestroy() {
- if (DEBUG) Log.d(TAG, "onDestroy");
- super.onDestroy();
- mRenderer.onDestroy();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onResume() {
- super.onResume();
- if (DEBUG) Log.d(TAG, "onResume");
- mGLSurfaceView.onResume();
- mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
- if (mRenderer != null) {
- mRenderer.onResume();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void onPause() {
- super.onPause();
- if (DEBUG) Log.d(TAG, "onPause");
- mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
- mRenderer.onPause();
- mGLSurfaceView.onPause();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.main, menu);
- return super.onCreateOptionsMenu(menu);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.mnu_settings:
- Intent settings = new Intent(this, PhotoPhasePreferences.class);
- startActivity(settings);
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- int action = event.getAction();
- float x = event.getX();
- float y = event.getY();
- switch (action) {
- case MotionEvent.ACTION_UP:
- mRenderer.onTouch(x, y);
- return true;
-
- default:
- break;
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onLowMemory() {
- super.onLowMemory();
- Log.i(TAG, "onLowMemory");
- // Pause the wallpaper and destroy the cached textures
- mRenderer.onPause();
- mRenderer.onLowMemory();
- }
-}