¡@

Home 

2014/10/16 ¤W¤È 08:19:02

android Programming Glossary: mdrawable

Draw Rectangle Over ImageView for highlight that can be zoom in-out in android

http://stackoverflow.com/questions/10482229/draw-rectangle-over-imageview-for-highlight-that-can-be-zoom-in-out-in-android

canvas.setMatrix mCanvasMatrix canvas.setMatrix mMatrix if mDrawable null mDrawable.draw canvas Log.v Log_tag draw with Canvas is.. mCanvasMatrix canvas.setMatrix mMatrix if mDrawable null mDrawable.draw canvas Log.v Log_tag draw with Canvas is done W canavs_width.. new float 9 RectF orignalRect private Drawable mDrawable private ImageView mImageView display width height. private int..

Html.ImageGetter TextView

http://stackoverflow.com/questions/16179285/html-imagegetter-textview

AsyncTask Object Void Bitmap private LevelListDrawable mDrawable @Override protected Bitmap doInBackground Object... params .. Object... params String source String params 0 mDrawable LevelListDrawable params 1 Log.d TAG doInBackground source try.. Bitmap bitmap Log.d TAG onPostExecute drawable mDrawable Log.d TAG onPostExecute bitmap bitmap if bitmap null BitmapDrawable..

Changing gradient background colors on Android at runtime

http://stackoverflow.com/questions/4941606/changing-gradient-background-colors-on-android-at-runtime

ListAdapter I just had to int h v.getHeight ShapeDrawable mDrawable new ShapeDrawable new RectShape mDrawable.getPaint .setShader.. ShapeDrawable mDrawable new ShapeDrawable new RectShape mDrawable.getPaint .setShader new LinearGradient 0 0 0 h Color.parseColor.. #110000FF Shader.TileMode.REPEAT v.setBackgroundDrawable mDrawable And that gave me the same result as the XML background above...

Moving an image using Accelerometer of android

http://stackoverflow.com/questions/6457768/moving-an-image-using-accelerometer-of-android

Called when the activity is first created. CustomDrawableView mCustomDrawableView null ShapeDrawable mDrawable new ShapeDrawable.. the activity is first created. CustomDrawableView mCustomDrawableView null ShapeDrawable mDrawable new ShapeDrawable int x int.. CustomDrawableView mCustomDrawableView null ShapeDrawable mDrawable new ShapeDrawable int x int y private SensorManager sensorManager..

How to add animated emoticon in TextView or EditText in Android

http://stackoverflow.com/questions/8632801/how-to-add-animated-emoticon-in-textview-or-edittext-in-android

extends DynamicDrawableSpan private Drawable mDrawable public AnimatedImageSpan Drawable d super mDrawable d Use handler.. mDrawable public AnimatedImageSpan Drawable d super mDrawable d Use handler for 'ticks' to proceed to next frame final Handler.. new Runnable public void run AnimatedGifDrawable mDrawable .nextFrame Set next with a delay depending on the duration..

ImageView with rounded corners and inner shadow

http://stackoverflow.com/questions/9469748/imageview-with-rounded-corners-and-inner-shadow

is initialized in the ImageView constructor like this mDrawable getDrawable if mDrawable null mBitmap BitmapDrawable mDrawable.. ImageView constructor like this mDrawable getDrawable if mDrawable null mBitmap BitmapDrawable mDrawable .getBitmap The problem.. getDrawable if mDrawable null mBitmap BitmapDrawable mDrawable .getBitmap The problem is that I am overriding onDraw completely..

Draw Rectangle Over ImageView for highlight that can be zoom in-out in android

http://stackoverflow.com/questions/10482229/draw-rectangle-over-imageview-for-highlight-that-can-be-zoom-in-out-in-android

canvas.getWidth int canavs_height canvas.getHeight canvas.setMatrix mCanvasMatrix canvas.setMatrix mMatrix if mDrawable null mDrawable.draw canvas Log.v Log_tag draw with Canvas is done W canavs_width H canavs_height canvas.restore private.. int canavs_height canvas.getHeight canvas.setMatrix mCanvasMatrix canvas.setMatrix mMatrix if mDrawable null mDrawable.draw canvas Log.v Log_tag draw with Canvas is done W canavs_width H canavs_height canvas.restore private float MAX_SCALE.. float mCanvasMatrixValues new float 9 private final float mMatrixValues new float 9 RectF orignalRect private Drawable mDrawable private ImageView mImageView display width height. private int mWidth private int mHeight private int mIntrinsicWidth private..

Html.ImageGetter TextView

http://stackoverflow.com/questions/16179285/html-imagegetter-textview

LoadImage .execute source d return d class LoadImage extends AsyncTask Object Void Bitmap private LevelListDrawable mDrawable @Override protected Bitmap doInBackground Object... params String source String params 0 mDrawable LevelListDrawable params.. LevelListDrawable mDrawable @Override protected Bitmap doInBackground Object... params String source String params 0 mDrawable LevelListDrawable params 1 Log.d TAG doInBackground source try InputStream is new URL source .openStream return BitmapFactory.decodeStream.. e.printStackTrace return null @Override protected void onPostExecute Bitmap bitmap Log.d TAG onPostExecute drawable mDrawable Log.d TAG onPostExecute bitmap bitmap if bitmap null BitmapDrawable d new BitmapDrawable bitmap mDrawable.addLevel 1 1..

Changing gradient background colors on Android at runtime

http://stackoverflow.com/questions/4941606/changing-gradient-background-colors-on-android-at-runtime

but here's how I did it On my getView overloaded function ListAdapter I just had to int h v.getHeight ShapeDrawable mDrawable new ShapeDrawable new RectShape mDrawable.getPaint .setShader new LinearGradient 0 0 0 h Color.parseColor #330000FF Color.parseColor.. function ListAdapter I just had to int h v.getHeight ShapeDrawable mDrawable new ShapeDrawable new RectShape mDrawable.getPaint .setShader new LinearGradient 0 0 0 h Color.parseColor #330000FF Color.parseColor #110000FF Shader.TileMode.REPEAT.. 0 0 0 h Color.parseColor #330000FF Color.parseColor #110000FF Shader.TileMode.REPEAT v.setBackgroundDrawable mDrawable And that gave me the same result as the XML background above. Now I can programmatically set the background color. share..

Moving an image using Accelerometer of android

http://stackoverflow.com/questions/6457768/moving-an-image-using-accelerometer-of-android

class Accelerometer extends Activity implements SensorEventListener Called when the activity is first created. CustomDrawableView mCustomDrawableView null ShapeDrawable mDrawable new ShapeDrawable int x int y private SensorManager sensorManager null.. extends Activity implements SensorEventListener Called when the activity is first created. CustomDrawableView mCustomDrawableView null ShapeDrawable mDrawable new ShapeDrawable int x int y private SensorManager sensorManager null Called when the.. Called when the activity is first created. CustomDrawableView mCustomDrawableView null ShapeDrawable mDrawable new ShapeDrawable int x int y private SensorManager sensorManager null Called when the activity is first created. @Override..

How to add animated emoticon in TextView or EditText in Android

http://stackoverflow.com/questions/8632801/how-to-add-animated-emoticon-in-textview-or-edittext-in-android

void update AnimatedImageSpan.java public class AnimatedImageSpan extends DynamicDrawableSpan private Drawable mDrawable public AnimatedImageSpan Drawable d super mDrawable d Use handler for 'ticks' to proceed to next frame final Handler mHandler.. AnimatedImageSpan extends DynamicDrawableSpan private Drawable mDrawable public AnimatedImageSpan Drawable d super mDrawable d Use handler for 'ticks' to proceed to next frame final Handler mHandler new Handler mHandler.post new Runnable public.. to next frame final Handler mHandler new Handler mHandler.post new Runnable public void run AnimatedGifDrawable mDrawable .nextFrame Set next with a delay depending on the duration for this frame mHandler.postDelayed this AnimatedGifDrawable..

ImageView with rounded corners and inner shadow

http://stackoverflow.com/questions/9469748/imageview-with-rounded-corners-and-inner-shadow

on top of it. The result is what I want The mBitmap value is initialized in the ImageView constructor like this mDrawable getDrawable if mDrawable null mBitmap BitmapDrawable mDrawable .getBitmap The problem is that I am overriding onDraw completely.. result is what I want The mBitmap value is initialized in the ImageView constructor like this mDrawable getDrawable if mDrawable null mBitmap BitmapDrawable mDrawable .getBitmap The problem is that I am overriding onDraw completely no super.onDraw is.. is initialized in the ImageView constructor like this mDrawable getDrawable if mDrawable null mBitmap BitmapDrawable mDrawable .getBitmap The problem is that I am overriding onDraw completely no super.onDraw is called so I have to pre scale all images..