android-imageview

How to access res/drawable/“folder”

喜夏-厌秋 提交于 2019-12-18 02:51:34
问题 On my application I have many pictures which I have grouped in folder under res/drawable. But Android dosen't let me access them trough "R". Is there a way to access those folders. This is the Code im using for. ImageView iv = new ImageView(conext); iv.setImageResource(R.drawable.**smiley.666**); I marked the part which I can't access. Thx in Advance safari 回答1: No, Android does not allow subfolders under /res/drawable : Can the Android drawable directory contain subdirectories? You can

How to access res/drawable/“folder”

怎甘沉沦 提交于 2019-12-18 02:51:01
问题 On my application I have many pictures which I have grouped in folder under res/drawable. But Android dosen't let me access them trough "R". Is there a way to access those folders. This is the Code im using for. ImageView iv = new ImageView(conext); iv.setImageResource(R.drawable.**smiley.666**); I marked the part which I can't access. Thx in Advance safari 回答1: No, Android does not allow subfolders under /res/drawable : Can the Android drawable directory contain subdirectories? You can

How to make view resizable on touch event

一世执手 提交于 2019-12-18 01:26:29
问题 See the following image I want to change the shape of highlighted view by dragging its corner.. not necessory the view after dragging the corner should be rectangle it can be any arbitary shape how to achive this?? now i have done the 4 corners movable on touch event but the shape is not changing package com.assignment.DragDrop; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import

How to send image from one activity to another in android?

ⅰ亾dé卋堺 提交于 2019-12-17 19:53:41
问题 I am having a imageView in one class and on clicking the imageView a dialog box appear which has two option to take a image from camera or open the image gallery of device. I want to send image from one class to another so it can appear in ImageView. I am searching from many hour but i got only about sending text data from one class to another.Can any one tell about sending an image from one class to another? This is code from sender class which will take image. takeImg.setOnTouchListener(new

How to draw lines over ImageView on Android?

风流意气都作罢 提交于 2019-12-17 19:44:40
问题 I am trying to develop a simple map application, which will display a map in the screen. When the user moves the cursor on screen, I want to display 2 perpendicular lines over my map. I had tried many examples to get an idea for that, but unfortunately, didn't succeed. How can I make this? And as one previous questionhere I had tried. but didn't get the answer. Can anyone guide me? My main.xml is as following: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas

HorizontalScrollView or Carrousel?

为君一笑 提交于 2019-12-17 18:33:39
问题 I want to create a HorizontalScrollView , but with some "effects" in it, like this example, or this other example. The thing is that I don't know how many items I'll have to use; I get the ImageView from an API so it should be dynamic. How can I make that effect that if it's selected it becomes bigger with the TextView below? The closest example I found on SO is here. That's exactly what I need, but I've tested the answer given and it doesn't work for me ... but the image from the question is

get ImageView's image and send it to an activity with Intent

纵然是瞬间 提交于 2019-12-17 16:25:22
问题 I have a grid of many products in my app. when the user selects one of the item in the grid, I am starting a new activity as DIALOG box and display the item's name,quantity and image. But I cannot send the image source dynamically. here is my code gridView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v,int position, long id) { //Toast.makeText(getApplicationContext(),((TextView) v.findViewById(R.id.grid_item_label)).getText(), Toast

How to animate ImageView from center-crop to fill the screen and vice versa (facebook style)?

六月ゝ 毕业季﹏ 提交于 2019-12-17 10:37:13
问题 Background Facebook app has a nice transition animation between a small image on a post, and an enlarged mode of it that the user can also zoom to it. As I see it, the animation not only enlarges and moves the imageView according to its previous location and size, but also reveals content instead of stretching the content of the imageView. This can be seen using the next sketch i've made: The question How did they do it? did they really have 2 views animating to reveal the content? How did

When it's necessary to execute invalidate() on a View?

廉价感情. 提交于 2019-12-17 10:23:24
问题 My answer to this question was just accepted but I started to wonder when exactly one needs to invalidate() a View and when it is not necessary? After a bit of thinking I came to realization that it should work more or less like this: actual drawing of "everything" occurs after onResume() in "free" time parts of the screen can be redrawn but only those that were invalidated (and everything underneath) Therefore, it would seem, if I change something after onResume() (e.g. as a response to a

Android: Is it possible to update a ImageView/ImageButton with a number to show the number of new messages?

拟墨画扇 提交于 2019-12-17 07:18:11
问题 In iOS we have a feature to update the app icon with the new pending messages for the user by showing a small number on the right-top corner of the icon and similarly I would like to know if we have method to update a ImageView/ImageButton in android(Here I am not looking to update the icon on the home screen but inside my app). For example, the pic shows the red background icon with the number of messages pending to be read in red and if there are no messages it shows with a gray background.