1/* 2 * Copyright (C) 2008 Esmertec AG. 3 * Copyright (C) 2008 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18package com.android.mms.ui; 19 20import java.util.Map; 21 22import android.content.Context; 23import android.graphics.Bitmap; 24import android.graphics.BitmapFactory; 25import android.net.Uri; 26import android.util.AttributeSet; 27import android.util.Log; 28import android.view.View; 29import android.widget.ImageView; 30import android.widget.LinearLayout; 31 32import com.android.mms.LogTag; 33import com.android.mms.R; 34 35/** 36 * This class provides an embedded editor/viewer of picture attachment. 37 */ 38public class ImageAttachmentView extends LinearLayout implements SlideViewInterface { 39 private ImageView mImageView; 40 private static final String TAG = LogTag.TAG; 41 42 public ImageAttachmentView(Context context) { 43 super(context); 44 } 45 46 public ImageAttachmentView(Context context, AttributeSet attrs) { 47 super(context, attrs); 48 } 49 50 @Override 51 protected void onFinishInflate() { 52 mImageView = (ImageView) findViewById(R.id.image_content); 53 } 54 55 public void startAudio() { 56 // TODO Auto-generated method stub 57 58 } 59 60 public void startVideo() { 61 // TODO Auto-generated method stub 62 63 } 64 65 public void setAudio(Uri audio, String name, Map<String, ?> extras) { 66 // TODO Auto-generated method stub 67 68 } 69 70 public void setImage(String name, Bitmap bitmap) { 71 try { 72 if (null == bitmap) { 73 bitmap = BitmapFactory.decodeResource(getResources(), 74 R.drawable.ic_missing_thumbnail_picture); 75 } 76 mImageView.setImageBitmap(bitmap); 77 } catch (java.lang.OutOfMemoryError e) { 78 Log.e(TAG, "setImage: out of memory: ", e); 79 } 80 } 81 82 public void setImageRegionFit(String fit) { 83 // TODO Auto-generated method stub 84 85 } 86 87 public void setImageVisibility(boolean visible) { 88 // TODO Auto-generated method stub 89 90 } 91 92 public void setText(String name, String text) { 93 // TODO Auto-generated method stub 94 95 } 96 97 public void setTextVisibility(boolean visible) { 98 // TODO Auto-generated method stub 99 100 } 101 102 public void setVideo(String name, Uri video) { 103 // TODO Auto-generated method stub 104 105 } 106 107 public void setVideoThumbnail(String name, Bitmap bitmap) { 108 } 109 110 public void setVideoVisibility(boolean visible) { 111 // TODO Auto-generated method stub 112 113 } 114 115 public void stopAudio() { 116 // TODO Auto-generated method stub 117 118 } 119 120 public void stopVideo() { 121 // TODO Auto-generated method stub 122 123 } 124 125 public void reset() { 126 mImageView.setImageDrawable(null); 127 } 128 129 public void setVisibility(boolean visible) { 130 setVisibility(visible ? View.VISIBLE : View.GONE); 131 } 132 133 public void pauseAudio() { 134 // TODO Auto-generated method stub 135 136 } 137 138 public void pauseVideo() { 139 // TODO Auto-generated method stub 140 141 } 142 143 public void seekAudio(int seekTo) { 144 // TODO Auto-generated method stub 145 146 } 147 148 public void seekVideo(int seekTo) { 149 // TODO Auto-generated method stub 150 151 } 152} 153