android-imageview

Android - ImageView with rounded only one corner

蹲街弑〆低调 提交于 2020-01-24 05:14:10
问题 I want to create ImageView like this (right side of the image): I have it in CardView layout so I have rounded corners of the card but I need to create rounded left bottom corner of the image alone (or with top right). I tried several options but nothing work correctly. How can I do this? Do you have some tip? 回答1: You can use this library and put your ImageView inside the Layout https://github.com/JcMinarro/RoundKornerLayouts and can set the radius for specific corners like this

Does android reuse images loaded from resource?

空扰寡人 提交于 2020-01-24 04:09:47
问题 So I have several ImageViews in a single Activity and all of them use the same image bitmap from a resource. ImageViewOne.setImageResource(R.drawable.frequently_used_image); ImageViewTwo.setImageResource(R.drawable.frequently_used_image); ImageViewThree.setImageResource(R.drawable.frequently_used_image); Does android allocate memory to load the bitmap once and reuse it for all other ImageViews using the same resource? Or does it load the bitmap each time it is set to an ImageView? Thanks! 回答1

How to know if two images are intersect while one image moving in android?

扶醉桌前 提交于 2020-01-22 21:28:40
问题 In my application, i am moving image around the screen by using onTouchListener . I have another two images in the same view. My problem is that, when the moving image, touches any of the other images, i need to perform a certain action (that means if images are intersected, then do something). How can this be achieved?.Please help me asap Thanks in Advance. 回答1: You should be able to use Rect.intersects(Rect, Rect) , like this example: Rect myViewRect = new Rect(); myView.getHitRect

Android change background image with fade in/out animation

假如想象 提交于 2020-01-20 19:14:10
问题 I wrote code which can change background image random every 5 second.now i want to use fade in/out animation to change background image,but I do not know how I can use this animation. This is a my source: void handlechange() { Handler hand = new Handler(); hand.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub // change image here change(); } private void change() { // TODO Auto-generated method stub Random rand = new Random(); int index = rand

Creating bitmap from area selected by touch, returns wrong image part android

淺唱寂寞╮ 提交于 2020-01-17 15:18:46
问题 I use custom view placed over an image view like that <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="5" tools:context=".TextRecognitionActivity"> <ImageView android:id="@+id/surfaceViewImage" android:layout_width="match_parent" android:layout_height="match_parent

Creating bitmap from area selected by touch, returns wrong image part android

∥☆過路亽.° 提交于 2020-01-17 15:17:05
问题 I use custom view placed over an image view like that <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightSum="5" tools:context=".TextRecognitionActivity"> <ImageView android:id="@+id/surfaceViewImage" android:layout_width="match_parent" android:layout_height="match_parent

Image View problem

妖精的绣舞 提交于 2020-01-16 19:09:10
问题 ImageView img; TextView tv; Parser p= new Parser(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView) findViewById(R.id.txt); img = (ImageView) findViewById(R.id.cover); new AsyncTask<Void, Double, Void>() { @Override protected Void doInBackground(Void... params) { while (true) { publishProgress(Math.random()); SystemClock.sleep(3000); } } @Override protected void onProgressUpdate(Double... values) {

How to add a image inside a edit text android [duplicate]

左心房为你撑大大i 提交于 2020-01-15 16:48:40
问题 This question already has answers here : how to insert image to a editText (6 answers) Closed 4 years ago . I want to add image inside edittext view . For example i have image that size is 250*250 i want to show text left to image for height of 250 after that have to show text in normal left position. Some text some text some text Some image Some text some text some text Some text some text some text Some text some text some text Some text some text some text some text some text Some text

Using the default android image Viewer to show pics

流过昼夜 提交于 2020-01-15 06:57:19
问题 I know that I can open an image using the default android image Viewer, for example with new Intent(Intent.ACTION_VIEW) etc. If I open the image and then I swipe left/right I'll see the other images saved on the device. For example, if I open one of whatsapp images, swiping left/right I'll see all other images saved inside whatsapp folder. Is there a way to pass the default android image Viewer a List / Array of uri, in order to prevent users from swiping left/right and see all the images on

onTouchListener in ViewPager

最后都变了- 提交于 2020-01-15 03:18:52
问题 I have an ImageView with onTouchListener inside a ViewPager . Of course the ImageView 's listener fires off when I try to change ViewPager 's page. Is there a way to prevent it. I guess I need to recognize touch from swipe somehow. This is the extract of my code : public class ServerDetailFragment extends Fragment implements SimpleGestureListener { GestureDetector detector; SimpleOnGestureListener gestures = new SimpleOnGestureListener() { public boolean onFling(MotionEvent e1, MotionEvent e2