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));
}`
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
Copy this class and put it in your inherited gallery or right in your activity
Then after you have created your gallery class and attached the adapter call
This worked for me, let me know if it does for you as well.