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 com.android.mms.R; 21 22import android.content.Context; 23import android.graphics.Bitmap; 24import android.graphics.BitmapFactory; 25import android.net.Uri; 26import android.util.AttributeSet; 27import android.view.View; 28import android.widget.ImageView; 29import android.widget.LinearLayout; 30 31import java.util.Map; 32 33/** 34 * This class provides an embedded editor/viewer of picture attachment. 35 */ 36public class ImageAttachmentView extends LinearLayout implements SlideViewInterface { 37 private ImageView mImageView; 38 39 public ImageAttachmentView(Context context) { 40 super(context); 41 } 42 43 public ImageAttachmentView(Context context, AttributeSet attrs) { 44 super(context, attrs); 45 } 46 47 @Override 48 protected void onFinishInflate() { 49 mImageView = (ImageView) findViewById(R.id.image_content); 50 } 51 52 public void startAudio() { 53 // TODO Auto-generated method stub 54 55 } 56 57 public void startVideo() { 58 // TODO Auto-generated method stub 59 60 } 61 62 public void setAudio(Uri audio, String name, Map<String, ?> extras) { 63 // TODO Auto-generated method stub 64 65 } 66 67 public void setImage(String name, Bitmap bitmap) { 68 if (null == bitmap) { 69 bitmap = BitmapFactory.decodeResource(getResources(), 70 R.drawable.ic_missing_thumbnail_picture); 71 } 72 mImageView.setImageBitmap(bitmap); 73 } 74 75 public void setImageRegionFit(String fit) { 76 // TODO Auto-generated method stub 77 78 } 79 80 public void setImageVisibility(boolean visible) { 81 // TODO Auto-generated method stub 82 83 } 84 85 public void setText(String name, String text) { 86 // TODO Auto-generated method stub 87 88 } 89 90 public void setTextVisibility(boolean visible) { 91 // TODO Auto-generated method stub 92 93 } 94 95 public void setVideo(String name, Uri video) { 96 // TODO Auto-generated method stub 97 98 } 99 100 public void setVideoVisibility(boolean visible) { 101 // TODO Auto-generated method stub 102 103 } 104 105 public void stopAudio() { 106 // TODO Auto-generated method stub 107 108 } 109 110 public void stopVideo() { 111 // TODO Auto-generated method stub 112 113 } 114 115 public void reset() { 116 mImageView.setImageDrawable(null); 117 } 118 119 public void setVisibility(boolean visible) { 120 setVisibility(visible ? View.VISIBLE : View.GONE); 121 } 122 123 public void pauseAudio() { 124 // TODO Auto-generated method stub 125 126 } 127 128 public void pauseVideo() { 129 // TODO Auto-generated method stub 130 131 } 132 133 public void seekAudio(int seekTo) { 134 // TODO Auto-generated method stub 135 136 } 137 138 public void seekVideo(int seekTo) { 139 // TODO Auto-generated method stub 140 141 } 142} 143