1 package org.openintents.filemanager;
\r
3 /* $Id: BulletedTextView.java 57 2007-11-21 18:31:52Z steven $
\r
5 * Copyright 2007 Steven Osborn
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
21 * Dec 7, 2008: Peli: Use inflated layout.
\r
24 import android.content.Context;
\r
25 import android.graphics.Bitmap;
\r
26 import android.graphics.Color;
\r
27 import android.graphics.drawable.Drawable;
\r
28 import android.util.Log;
\r
29 import android.view.LayoutInflater;
\r
30 import android.view.View;
\r
31 import android.widget.CheckBox;
\r
32 import android.widget.CompoundButton;
\r
33 import android.widget.ImageView;
\r
34 import android.widget.LinearLayout;
\r
35 import android.widget.TextView;
\r
37 public class IconifiedTextView extends LinearLayout {
\r
39 private TextView mText;
\r
40 private TextView mInfo;
\r
41 private ImageView mIcon;
\r
42 private ImageView mCheckIcon;
\r
44 public IconifiedTextView(Context context, final IconifiedText aIconifiedText) {
\r
48 LayoutInflater inflater = (LayoutInflater) context
\r
49 .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
\r
52 R.layout.filelist_item, this, true);
\r
54 mIcon = (ImageView) findViewById(R.id.icon);
\r
55 mText = (TextView) findViewById(R.id.text);
\r
56 mInfo = (TextView) findViewById(R.id.info);
\r
57 mCheckIcon = (ImageView) findViewById(R.id.select_icon);
\r
60 public ImageView getImageView() {
\r
64 public void setText(String words) {
\r
65 mText.setText(words);
\r
67 int height = getHeight();
\r
70 ThumbnailLoader.setThumbnailHeight(height);
\r
74 public void setInfo(String info) {
\r
75 mInfo.setText(info);
\r
78 public void setIcon(Drawable bullet) {
\r
79 mIcon.setImageDrawable(bullet);
\r
82 public void setIcon(Bitmap bitmap) {
\r
83 mIcon.setImageBitmap(bitmap);
\r
86 public void setCheckVisible(boolean visible) {
\r
87 mCheckIcon.setVisibility((visible) ? View.VISIBLE : View.GONE);
\r
90 public void setCheckDrawable(Drawable icon) {
\r
91 mCheckIcon.setImageDrawable(icon);
\r