Gallery Shows Shadow in Android - android

i am develop project with gallery control in android.but,i have some problem in gallery control i am scroll one image to next image shows shadows like starting image not shadow in gallery control and i am scroll to next image to shows shadow for all images in gallery control.i want remove shadow in gallery control.
i am getting output below screen shot:
i
i am scroll to next image output below screen shot:
here's my xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/black"
android:id="#+id/lay_linear"
android:orientation="vertical" >
<Gallery
android:id="#+id/gallery"
android:layout_width="fill_parent"
android:layout_height="430dp"
android:layout_weight="2.50" />
</LinearLayout>
i want remove shadows on gallery control.can help me any one greatly appreciated!

Try below code for remove unselected shawdows:
galleryview.setUnselectedAlpha(1);
Welcome!

Use android:cacheColorHint="#00000000"

Related

Placing a button on an imageView at an absolute position

I'm having trouble positioning a button on an image view.
I want to put a button on top of the image view, so that the button is "on" the image.
So far, I've put done it in a way, such as
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
and the button is added programatically when the app starts(at "onCreate"), so the button is shown on top of the image.
It works fine, but the problem is when I zoom/drag the image.
I want the button to move/zoom with the image, but with what I've got above, the button stays at a fixed position on a screen and only the image is being zoomed/dragged.
Is there a way I can do this?
Thanks in advance.

Gallery view with circular effect to both edges

I am working on application in which gallery require as bellow image :
I searched over internet but it gives result similar to Image Gallery. But I want to create the gallery which will move in circular fashion, means it just bend the first and last member of gallery. Is it possible? or Is the horizontal ScrollView better approach to do this?
Any better approach will be appreciated.. Thanks in advance.
I have found a solution and it achieved using Custom Gallery. I used following layout file for that
main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linear_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/gal_bg"
android:orientation="vertical" >
<Gallery
android:id="#+id/horizontallistview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp" />
<!-- android:background="#drawable/gal_overlay" -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="120dp"
android:background="#drawable/gal_overlay" />
</FrameLayout>
And it uses the some images as background to FrameLayout and ImageView. You will find the complete source code of project on GitHub.
Happy Coding..

Android. Set ListView's background Image

The following code is almost the same thing I want to achieve.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bg">
<ListView android:layout_height="wrap_content" android:id="#+id/levelList" android:layout_width="match_parent" android:layout_alignParentLeft="true"></ListView>
</RelativeLayout>
I want to setup a background image for the whole ListView. The problem of this code is that background image blinks or disappears on scrolling.
I use sdk 2.2 and an emulator to run the program.
You'll want to set android:cacheColorHint="#00000000" on your ListView. This will set the cacheColorHint to transparent (notice the extra 2 0's after #000000) and fix your problem. Alternatively you can set the cacheColorHint to #android:color/transparent.
You should read this page on ListView backgrounds.

Background image with fading edges

I tried to put background image to linearlayout in my android project. All is working nicely except those fading edges in the left and right on the screen. My background image dimensions are 52x602 and don't have such fading edge originally. I want the background image to cover all the area. Also it has done by designer and using 9-patch I think (black border around image). How can I set the background correctly without those edges?
In emulator it looks like this:
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/login_background"
android:orientation="vertical"
>
</LinearLayout>
Ok, got answer myself. The .png files must have .9.png ending if they are 9-patch files...So if someone will have same problem, then you'll know.
Try setting fadingEdge to none
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/login_background"
android:orientation="vertical"
android:fadingEdge="none"
>
</LinearLayout>

android picture frame

I'm new to android i'm developing small application i want to arrange pictures in screen just like tumbnail view and want scroll on all picture then i have to able to select the one picture after touching the picture on the screen how can i do it? plz help me
Thanks in Advance.
Well you can do that using a Gallery control to scroll the thumbnails, then when you select the picture (using the method gallery.setOnItemClickListener()) that image will be showed in the ImageView.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Gallery
android:id="#+id/gallery1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="#+id/image1"
android:layout_width="320px"
android:layout_height="250px"
android:scaleType="fitXY" />
</LinearLayout>

Categories

Resources