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 6759337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:55:37+00:00 2026-05-26T13:55:37+00:00

How could i scale the selected image in the Gallery, i tried this, but

  • 0

How could i scale the selected image in the Gallery, i tried this, but it doesn’t work very well. `

public void  onItemSelected  (AdapterView<?>  parent, View  v, int position, long id) 
{
    Animation grow = AnimationUtils.loadAnimation(DetailTvShow.this, R.anim.grow);

            Button btn = (Button)findViewById(R.id.button1);
            btn.setText("saison "+(position+1));
            View sideView = v.findViewById(position + 1);
            View sideView1 = v.findViewById(position - 1);

           if ((sideView != null)||(sideView1 != null)){
               ((ImageView)sideView).setLayoutParams(new Gallery.LayoutParams(80, 115));

               ((ImageView)sideView1).setLayoutParams(new `enter code here`Gallery.LayoutParams(80, 115));

           }

      /*      sideView = parent.findViewById(position + 1);
          if (sideView != null)
               ((ImageView)sideView).setLayoutParams(new Gallery.LayoutParams(80, 115));  */

            v.startAnimation(grow);
            v.setLayoutParams(new Gallery.LayoutParams(105, 140));
        }`
  • 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-26T13:55:37+00:00Added an answer on May 26, 2026 at 1:55 pm

    I had the same issue, there was a similar solution to the one I will present here on stack overflow but it did not work correctly, though the views would scale, they would eventually stop returning to their original size.

    Here the modified fix I found for myself that so far seems to work fine and does not cause any issues.

    In res/anim create a grow.xml file change to scale sizes to whatever works for you

    <?xml version="1.0" encoding="utf-8"?>
    <scale xmlns:android="http://schemas.android.com/apk/res/android"
           android:fromXScale="1.0"
           android:toXScale="1.075"
           android:fromYScale="1.0"
           android:toYScale="1.075"
           android:duration="150"
           android:pivotX="50%"
           android:pivotY="50%"
           android:interpolator="@android:anim/accelerate_decelerate_interpolator"
           android:fillAfter="true"> 
    </scale>
    

    Copy this class and put it in your inherited gallery or right in your activity

        private class SelectListener implements AdapterView.OnItemSelectedListener {
    
            private Animation grow     = null;
            private View      lastView = null; 
    
            public SelectListener(Context c) {
                 grow = AnimationUtils.loadAnimation(c, R.anim.grow);
            }
    
            public void  onItemSelected(AdapterView<?>  parent, View  v, int position, long id)         {
    
                // Shrink the view that was zoomed 
                try { if (null != lastView) lastView.clearAnimation();
                } catch (Exception clear) { }
    
                // Zoom the new selected view
                try { v.startAnimation(grow); } catch (Exception animate) {}
    
                // Set the last view so we can clear the animation 
                lastView = v;
            }
    
            public void onNothingSelected(AdapterView<?>  parent) {
            }
    
       }
    

    Then after you have created your gallery class and attached the adapter call

    yourGalleryName.setOnItemSelectedListener(new SelectListener(this));  
    

    This worked for me, let me know if it does for you as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I guess you could classify this as a Scrabble style problem, but it started
Could someone please tell me why this <%= destroy_password_url @user.password_reset_token %> generates http://localhost:3000/api/destroy_password.4G5EoRVYMUAtiIKqOerKsw routes.rb
Could this be done with javascript/jQuery : <div class=number>99,123,123</div> <div class=number>123,123,123</div> <div class=number>1,123,123,123</div> <div
Could someone please suggest why this is happening... I’ve got some code to pretty
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
I was wondering if someone could help with this: I have a series of
I'm not sure how this is done. I could hard code the route I'm
The title of this question might be confusing but the problem is simple. I'm
I work in a large scale IT support environment. Twice now we have seen
This could be a composite question, as I may not fully understand the issue.

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.