Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6963071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:44:31+00:00 2026-05-27T15:44:31+00:00

I have implemented a gallery where on touch the image is displayed at the

  • 0

I have implemented a gallery where on touch the image is displayed at the centre of the screen

Now the image just pops up. How can i get the effect of image coming fro left or right of the screen, a sliding effect

    <?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" >

        <ImageView android:id="@+id/imageView1" android:layout_width="200dip"
        android:layout_height="200dip" ></ImageView>
    <Gallery xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/gallery" android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:layout_marginLeft="0dip" android:paddingLeft="0dip"/>
    </LinearLayout>

adapter code:

public View getView(int position, View convertView, ViewGroup parent) {

    ImageView imageView = new ImageView(mContext);

    imageView.setImageResource(mImageIds[position]);
    imageView.setLayoutParams(new Gallery.LayoutParams(100, 100));
    imageView.setScaleType(ImageView.ScaleType.FIT_XY);
    imageView.setBackgroundResource(mGalleryItemBackground);

    return imageView;
}

gallery activity :

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gallery);

    Gallery gallery = (Gallery) findViewById(R.id.gallery);
    gallery.setAdapter(new ImageAdaptor(this));

    gallery.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView parent, View v, int position, long id) {
            ImageView image = (ImageView) 
                    findViewById(R.id.imageView1);

            image.setImageResource(mImageIds[position]);

        }
    });
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:44:32+00:00Added an answer on May 27, 2026 at 3:44 pm

    Here is the solution i found

    listview.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView parent, View v, int position,
                    long id) {
                ImageView image = (ImageView) findViewById(R.id.imageView1);
                Animation exitAnimation;
    
                if(position<positionLastCLicked){
                 exitAnimation = AnimationUtils.loadAnimation(
                        GalleryActivity.this, R.layout.image_slidefromleft);}
                else{
                     exitAnimation = AnimationUtils.loadAnimation(
                            GalleryActivity.this, R.layout.image_slidefromright);
                }
                positionLastCLicked = position;
                image.startAnimation(exitAnimation);
                Utils.imageLoader.DisplayImage(galleryList.get(position)
                        .getImage(), image);
            }
    

    slidefromleft.xml

        <?xml version="1.0" encoding="utf-8"?>
    <translate
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:toXDelta="0%"
        android:fromXDelta="-100%"
        android:duration="400" 
        android:fillEnabled="true" 
        android:fillAfter="true">
    </translate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a Three20 Image Gallery into my App. I want to change
I have implemented a image gallery where in each image is differentiated by its
I have implemented a custom gallery with two UIViewController subclasses: AlbumController and PhotosController .
I have an application with a UITabBar. I have implemented a Photo Gallery using
I implemented a gallery, and inside it I have many listviews from left to
I have currently implemented this image slider http://www.dreamcss.com/2009/04/create-beautiful-jquery-sliders.html on a site but for some
I have a simple image gallery that I've paginated, and I want to to
I have an Activity which is used as an image gallery and works quite
I have a site w/ an image gallery (Portfolio) page. There is drop-down navigation
I have implemented GalleryView. I want to display a border image on selected image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.