From 281be5337852cb4b5d24e0a0440c426cb96bbebd Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Wed, 3 Mar 2010 21:12:40 +0800 Subject: Add pixel density concept to the code. So, it draw about the same size on mdpi and hdpi devices. Update the UI assets for mdpi Fix a issue that GLSurfaceView didn't call onPause and onResume in Camera. Refactor. Improve the drawing and animation. Also fix the RawTexture unsupported operation bugs and the NullPointerException in GLRootView. Change-Id: I7aeadcad72d64a665828a6bb4f0f73e685fde632 --- src/com/android/camera/ui/AbstractIndicator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/com/android/camera/ui/AbstractIndicator.java') diff --git a/src/com/android/camera/ui/AbstractIndicator.java b/src/com/android/camera/ui/AbstractIndicator.java index 531640d..77fbc87 100644 --- a/src/com/android/camera/ui/AbstractIndicator.java +++ b/src/com/android/camera/ui/AbstractIndicator.java @@ -1,17 +1,19 @@ package com.android.camera.ui; +import android.content.Context; import android.graphics.Rect; import javax.microedition.khronos.opengles.GL11; public abstract class AbstractIndicator extends GLView { - private static final int DEFAULT_PADDING = 5; + private static final int DEFAULT_PADDING = 3; abstract protected ResourceTexture getIcon(); - public AbstractIndicator() { - setPaddings(DEFAULT_PADDING, 0, DEFAULT_PADDING, 0); + public AbstractIndicator(Context context) { + int padding = GLRootView.dpToPixel(context, DEFAULT_PADDING); + setPaddings(padding, 0, padding, 0); } @Override -- cgit v1.1