imageview

Triangle shaped ImageView with drag, scroll & zoom onTouch Android

牧云@^-^@ 提交于 2019-12-04 01:52:41
问题 I've added three different bitmap to one ImageView as shown in picture below. But the problem is that I cannot edit it after the Bitmap is set to ImageView . I want to drag, scroll & zoom the individual Bitmap in the ImageView . My code for getting the combined bitmap is: Bitmap setBitmapInTriangleShape(Bitmap bitmap1, Bitmap bitmap2, Bitmap bitmap3) { /* * int[] values= new int[2]; mImageView.getLocationOnScreen(values); */ double screenHeightAspect = 2.5; Bitmap drawnBitmap = null; bitmap1

Android: How can I speed up the scrolling of GridView?

允我心安 提交于 2019-12-04 00:50:16
问题 I have a GridView that displays images (7 columns of images that are 166dp x 249dp) that are all the same size (there are over 150 images), and I'm using the view recycling mechanism through the view holder pattern by way of an adapter. My views are all simply ImageViews. There isn't much going on that should be slowing the scrolling on this widget (there are 21 images on screen at a time), but the thing just scrolls so choppy. What can I do to speed it up? 回答1: I spoke with some of the boys

How to get when an ImageView is completely loaded in Android

天涯浪子 提交于 2019-12-04 00:25:35
问题 I'm developing an App which draws lines over a bunch of Images. To choose these images, I have a radio group and, whenever the user clicks in a radio button, the image is load with all its own drawings. In my radio listenner I have the following code: bitmap = BitmapUtils.decodeSampledBitmapFromResource(root + DefinesAndroid.CAMINHO_SHOPPINGS_SDCARD + nomeImagemAtual, size.x, size.y); mImage.setImageBitmap(bitmap); mImage.setDrawLines(true); mImage.setImageBitmap(loadBitmapFromView(mImage));

Android hide and removing the image in imageview

偶尔善良 提交于 2019-12-04 00:23:18
How to remove a image in imageview in android and also how to hide the entire image. Here I have placed an image in imageview by the below code. answerState1.setBackgroundResource(R.drawable.correct); I don't know how to remove or hide the image. Also I am entirely new to android development. jennifer You can set the visibility of an image with the following method calls: answerState1.setVisibility(View.GONE); // hide image (make the view gone) answerState1.setVisibility(View.VISIBLE); // make image visible answerState1.setVisibility(View.INVISIBLE); // make image invisible In UI, you can also

Dynamically populate Android ImageView with outside resources

感情迁移 提交于 2019-12-03 23:09:38
问题 How can I turn the static image <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.67" android:src="@drawable/static_image" /> into an ImageView whose source can be dynamically set to data that is not already in the res folder? That is, my application has an icon on the screen but the actual image for the icon is downloaded from an outside server and can change dynamically. How do I update the ImageView

Android: handling clicks on image view inside recycler's view item using touch framework

萝らか妹 提交于 2019-12-03 22:44:32
问题 I am trying to capture the clicks on ImageView which is enclosed inside the RecyclerView item. I have implemented RecyclerView.OnItemTouchListener and has gesture detector process the motion events for normal clicks and long press on RecyclerView item. Since I want to have the same touch framework to process touch event on child views inside the RecylcerView item, I have set View.OnTouchListener with the image view as well, overriding the onTouch implementation returning true hoping that the

“Mosaic” (splitted) images - Gmail's letters style

試著忘記壹切 提交于 2019-12-03 22:28:14
On the new versions of gmail, there is a cool imageView that shows multiple contacts images in it (link here for example) . for example, if someone has sent me an email, i only see his image: ####### # # # A # # # ####### if i've replied to him, i can see my image next to it, but both my image and his are halved and share the same space of the imageView (and i think both have scaleType to be center crop) : ####### # # # # A# B# # # # ####### if another person has joined the conversation, it could look like this: ####### # # B# # A#### # # C# ####### and if another one has joined, it could look

Glide not updating image android of same url?

主宰稳场 提交于 2019-12-03 22:18:24
I have the same url for an image. When I update this image more than one time it shows the previous image. The image and picture version on the server is updated but Glide is not showing the new image.I want to get new image every time and cache it . Glide.with(context) .load(Constants.COPY_LINK_BASE_URL + info.getDisplayPicture()) .placeholder(R.drawable.ic_profile).dontAnimate() .diskCacheStrategy(DiskCacheStrategy.SOURCE) .signature(new (SettingManager.getUserPictureVersion(context))) .into(ivUserProfilePhoto); I can reproduce this bug by changing internet ,on one internet its change image

How can I make sine wave on an Imageview in android?

人走茶凉 提交于 2019-12-03 21:30:37
I want to create image similar to this. Is it possible to be done in XML? If not, how would I scale an image that is shape like this? Yes it's possible , you can use vactor drawable for it <?xml version="1.0" encoding="utf-8"?> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="640dp" android:height="640dp" android:viewportWidth="640" android:viewportHeight="640"> <path android:fillColor="#000000" android:fillAlpha="0" android:strokeColor="#000000" android:strokeWidth="1" android:pathData="" /> <path android:fillColor="#000000" android:fillAlpha="0" android

How to return a Bitmap from an Async Task in Android app

拥有回忆 提交于 2019-12-03 21:06:31
Ok, so this code is right off the Android Developer site which sets an ImageView to a Bitmap : class BitmapWorkerTask extends AsyncTask<Integer, Void, Bitmap> { private final WeakReference<ImageView> imageViewReference; private int data = 0; public BitmapWorkerTask(ImageView imageView) { // Use a WeakReference to ensure the ImageView can be garbage collected imageViewReference = new WeakReference<ImageView>(imageView); } // Decode image in background. @Override protected Bitmap doInBackground(Integer... params) { data = params[0]; return decodeSampledBitmapFromResource(getResources(), data,