android-gallery

auto scroll a Gallery widget

ⅰ亾dé卋堺 提交于 2019-12-07 04:26:30
问题 I need to implement a gallery which scrolls one item at a time, and which can do 'autoscroll': i.e. every couple of seconds, it automatically scrolls to the next item. As per this thread: Android: Programmatically animate between images in Gallery widget, I extended Gallery, overriding onFling to ignore the fling event and instead simulate a DPAD arrow left or right in order to move a single item at a time: @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,

Intent Action_View for image opens gallery with no delete option

柔情痞子 提交于 2019-12-07 04:07:42
In my app the user can capture images and I populate a grid layout to display thumbnails. On clicking the thumbnail I would like the user to see the full image and have an option of deleting it if they want to. This is the code for the onItemClickListener for the grid layout: layout_photos.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final PhotoItem item = (PhotoItem) layout_photos.getItemAtPosition(position); String file_uri = item.getFILE_URI(); Intent intent = new Intent(); intent

Get the position of the current image displayed in Gallery

社会主义新天地 提交于 2019-12-06 21:00:04
问题 in my application , i have a gallery of pictures, but i want to detect the position of the current image displayed , For example : when i launch my acvitivity, the position is 0, but when i scroll in my gallery,i want to get The position of the Current image displayed , i have tried OnFocusChanged , OnItemClicked , but that works only if i click on an item of my gallery Any ideas ! :( 回答1: gal.setOnItemSelectedListener(new OnItemSelectedListener(){ @Override public void onItemSelected

Get last image captured using camera on Android

雨燕双飞 提交于 2019-12-06 14:43:48
问题 I am trying to get the last image captured by the user using a camera app using the following code and display it to the user in my camera app's (like other camera apps do, show a small preview of the last image capture in a corner): String[] projection = new String[]{ MediaStore.Images.ImageColumns._ID, MediaStore.Images.ImageColumns.DATA, MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME, MediaStore.Images.ImageColumns.DATE_TAKEN, MediaStore.Images.ImageColumns.MIME_TYPE }; final Cursor

Select Image from Native Gallery and attach to Email

可紊 提交于 2019-12-06 13:09:54
I am allowing user to browse native gallery > select image, and trying to attach selected image to email, but not getting exact image, see my code: private static int RESULT_LOAD_IMAGE = 1; String picturePath; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; Cursor cursor = getContentResolver().query(selectedImage,

How Can I Get Thumbnails For Picasa Images Selected From The Gallery?

折月煮酒 提交于 2019-12-06 10:49:11
问题 I'm working on an application where the user is able to select files, either a new image from the camera, an image from the gallery, or a plain old file. It then shows an icon and the name for the selected item. I have this working with one exception. The gallery application integrates picasaweb pictures. If the user selects a picture from a picasa album, I'm not able to get a thumbnail for it. I'm using the MediaStore.Images.Thumbnails.getThumbnail() method, and it works for other images in

How to show image from Gallery to ImageView?

二次信任 提交于 2019-12-06 10:35:40
I want to show the image taken from the gallery into the imageview. But this is not happening. I don't understand why. I can use the camera feature just fine and see the image in the imageview from the camera, but not the one taken from the gallery. Can you guys help me out, please? Here is my code protected Button mFromCamera; protected Button mFromGallery; protected ImageView mImageView; private static final int CAMERA_REQUEST = 1888; private static final int SELECT_PHOTO = 100; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView

Custom drawing on top of Gallery view (and it's child views)

雨燕双飞 提交于 2019-12-06 10:14:34
I'm trying to draw custom UI (a path in this case) on top of a Gallery. I've extended the base Gallery class and overwritten the draw method like this: public class MyGallery extends Gallery { ... @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawPath(mPath, mPaint); } I thought that putting my path drawing after super.onDraw would make sure that the path was drawn on top of the gallery AND it's child views, but instead the child views are layered on top of my path. Does anyone know how to draw this properly? (I know I could include a RelativeLayout and layer a

How to change 'open' in gallery intent to 'done'?

好久不见. 提交于 2019-12-06 09:48:27
I am using following intent to open gallery for picking multiple images and videos: Intent intent = new Intent(); intent.setType("image/* video/*"); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Images"), MULTIPLE_IMAGE_SELECT); When the gallery is opened it looks like In the top it says 'open' i want to change it to 'done' or 'ok', how to achieve that? Thanks. When the gallery is opened it looks like There are ~2 billion Android devices, spread across thousands of device models. Your

how to dim the current activity?

荒凉一梦 提交于 2019-12-06 09:01:15
Is there a way to dim the Current activity when calling the new activity? as in the new activity should be above the previous activity. The new activity that i have is a gallery. It comes when the finish button in the previous activity is clicked. So i want this gallery to be placed above the previous activity Try setting the background of your gallery Activity to a transparent color. You might need to create a custom theme and more details can be found here: http://developer.android.com/guide/topics/ui/themes.html This is probably going to be completely transparent, so not quite what you want