--- /dev/null
+package org.openintents.filemanager;\r
+\r
+/* $Id: BulletedTextView.java 57 2007-11-21 18:31:52Z steven $ \r
+ * \r
+ * Copyright 2007 Steven Osborn \r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License"); \r
+ * you may not use this file except in compliance with the License. \r
+ * You may obtain a copy of the License at \r
+ * \r
+ * http://www.apache.org/licenses/LICENSE-2.0 \r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software \r
+ * distributed under the License is distributed on an "AS IS" BASIS, \r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \r
+ * See the License for the specific language governing permissions and \r
+ * limitations under the License. \r
+ */ \r
+\r
+/**\r
+ * Dec 7, 2008: Peli: Use inflated layout.\r
+ */\r
+\r
+import android.content.Context; \r
+import android.graphics.Bitmap;\r
+import android.graphics.Color;\r
+import android.graphics.drawable.Drawable; \r
+import android.util.Log;\r
+import android.view.LayoutInflater;\r
+import android.view.View;\r
+import android.widget.CheckBox;\r
+import android.widget.CompoundButton;\r
+import android.widget.ImageView; \r
+import android.widget.LinearLayout; \r
+import android.widget.TextView; \r
+\r
+public class IconifiedTextView extends LinearLayout { \r
+ \r
+ private TextView mText; \r
+ private TextView mInfo; \r
+ private ImageView mIcon; \r
+ private ImageView mCheckIcon;\r
+ \r
+ public IconifiedTextView(Context context, final IconifiedText aIconifiedText) { \r
+ super(context); \r
+ \r
+ // inflate rating\r
+ LayoutInflater inflater = (LayoutInflater) context\r
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r
+ \r
+ inflater.inflate(\r
+ R.layout.filelist_item, this, true);\r
+ \r
+ mIcon = (ImageView) findViewById(R.id.icon);\r
+ mText = (TextView) findViewById(R.id.text);\r
+ mInfo = (TextView) findViewById(R.id.info);\r
+ mCheckIcon = (ImageView) findViewById(R.id.select_icon);\r
+ } \r
+\r
+ public ImageView getImageView() {\r
+ return mIcon;\r
+ }\r
+ \r
+ public void setText(String words) { \r
+ mText.setText(words); \r
+\r
+ int height = getHeight();\r
+ \r
+ if (height > 0) {\r
+ ThumbnailLoader.setThumbnailHeight(height);\r
+ }\r
+ } \r
+ \r
+ public void setInfo(String info) { \r
+ mInfo.setText(info);\r
+ } \r
+ \r
+ public void setIcon(Drawable bullet) { \r
+ mIcon.setImageDrawable(bullet); \r
+ }\r
+ \r
+ public void setIcon(Bitmap bitmap) {\r
+ mIcon.setImageBitmap(bitmap);\r
+ }\r
+ \r
+ public void setCheckVisible(boolean visible) {\r
+ mCheckIcon.setVisibility((visible) ? View.VISIBLE : View.GONE);\r
+ }\r
+ \r
+ public void setCheckDrawable(Drawable icon) {\r
+ mCheckIcon.setImageDrawable(icon);\r
+ }\r
+}
\ No newline at end of file