android-imageview

How does Facebook Messenger draw a chathead? (Android)

非 Y 不嫁゛ 提交于 2020-01-10 04:07:05
问题 I know this has already been asked a lot of times here on StackOverflow, but I'm fascinated how Facebook Messenger draws the Chatheads. I followed this tutorial to place an ImageView as an overlay. However, dragging it around is very sluggish, unlike Chatheads which show extremely smooth animation. Turning on the "Show GPU view updates" option in Developer options flashes the screen while a Chathead is being dragged. However, dragging my ImageView doesn't trigger any flashing. Here's a small

Using an ImageView transform matrix instead of canvas.scale(float, float, float, float)

泪湿孤枕 提交于 2020-01-06 13:36:36
问题 I need to change the way I am scaling and moving my imageview to using a matrix instead of calling canvas.scale(,,,,) , but I cannot figure out the proper calls to do this. I had this in my ScaleListener listener class's onScale method public boolean onScale(ScaleGestureDetector detector) { ...//determining zoom level and pivot points offset child.zoom(scaleFactor, zoomCenter[0], zoomCenter[1]); } I had in the child ImageView's onDraw method: protected void onDraw(Canvas canvas){ super.onDraw

GridView Image (from URL) to Second Activity by using Intent

回眸只為那壹抹淺笑 提交于 2020-01-06 10:43:09
问题 First of all im giving the codes what i'm using currently MainActivity static final String URL = "http://my .com/images/rss.xml"; static final String KEY_TITLE = "item"; static final String KEY_THUMB_URL = "thumb_url"; // Click event for single list row gridView.setOnItemClickListener(new OnItemClickListener() { @SuppressWarnings("unchecked") @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HashMap<String, String> map2 = (HashMap<String, String>)

GridView Image (from URL) to Second Activity by using Intent

时光怂恿深爱的人放手 提交于 2020-01-06 10:42:24
问题 First of all im giving the codes what i'm using currently MainActivity static final String URL = "http://my .com/images/rss.xml"; static final String KEY_TITLE = "item"; static final String KEY_THUMB_URL = "thumb_url"; // Click event for single list row gridView.setOnItemClickListener(new OnItemClickListener() { @SuppressWarnings("unchecked") @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HashMap<String, String> map2 = (HashMap<String, String>)

GridView Image (from URL) to Second Activity by using Intent

不想你离开。 提交于 2020-01-06 10:42:04
问题 First of all im giving the codes what i'm using currently MainActivity static final String URL = "http://my .com/images/rss.xml"; static final String KEY_TITLE = "item"; static final String KEY_THUMB_URL = "thumb_url"; // Click event for single list row gridView.setOnItemClickListener(new OnItemClickListener() { @SuppressWarnings("unchecked") @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HashMap<String, String> map2 = (HashMap<String, String>)

How can I fill an ImageView in an Appwidget while mainiting the aspect ratio?

半腔热情 提交于 2020-01-06 08:21:28
问题 I have a simple widget containing an ImageView . I'd like to fetch an image from the web and display it in the ImageView while maintaining the aspect ratio. Here's the layout definition for the widget: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget_layout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/quality_image" android:layout_width="fill_parent"

How do I get the raw dimensions of a bitmap in an ImageView?

谁都会走 提交于 2020-01-06 08:12:20
问题 It seems like I might be overlooking something obvious, but I can't figure out how to retrieve the raw (unscaled) dimensions of a bitmap being displayed in an ImageView. For example, if I load a bitmap using Bitmap b = BitmapFactory.decodeResource(...) , I can get those dimensions from b.getWidth() and b.getHeight() , and I could pass the bitmap into an ImageView using setImageBitmap(b) . But if I have a subclass of ImageView, is there any way to retrieve those dimensions without having to

How do I get the raw dimensions of a bitmap in an ImageView?

£可爱£侵袭症+ 提交于 2020-01-06 08:12:12
问题 It seems like I might be overlooking something obvious, but I can't figure out how to retrieve the raw (unscaled) dimensions of a bitmap being displayed in an ImageView. For example, if I load a bitmap using Bitmap b = BitmapFactory.decodeResource(...) , I can get those dimensions from b.getWidth() and b.getHeight() , and I could pass the bitmap into an ImageView using setImageBitmap(b) . But if I have a subclass of ImageView, is there any way to retrieve those dimensions without having to

Android place ImageView on top of Canvas

回眸只為那壹抹淺笑 提交于 2020-01-05 11:39:48
问题 how can I display a programmatically created ImageView on top of a previously created View Canvas? I tried using bringToFront(), but without success. Code: RelativeLayout root = findViewById(R.id.layout); ImageView img = new ImageView(GameGuessActivity.context); img.setImageResource(R.drawable.image); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(width, height); params.leftMargin = x; params.topMargin = y; root.addView(img, params); img.bringToFront(); The Image is

how we can design imageView in corner of textView in android? [duplicate]

若如初见. 提交于 2020-01-04 18:30:06
问题 This question already has answers here : How to layout text to flow around an image (9 answers) Closed 2 years ago . I am new in android so I am confuse in this design so please help me. I want to design this type 回答1: Have you tried FlowTextView How to use Add to your XML layout with your child views inside it: <uk.co.deanwild.flowtextview.FlowTextView android:id="@+id/ftv" android:layout_width="fill_parent" android:layout_height="wrap_content" > <ImageView android:layout_width="wrap_content