Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to scale click/touch area of a view after applying ScaleAnimation in android?
    primarykey
    data
    text
    <p>I haven't found any solution regarding how to scale the touch area of a view after applying ScaleAnimation, this animation really change the scale of that view but not the touch area of that view .The touch area remains the same. Here is my sample code:</p> <pre><code>package com.xyz; public class XyzActivity extends Activity { int zoomLevel = 1; int zoomNext = 2; Button btn = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn = (Button)findViewById(R.id.button1); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub AnimationSet set = new AnimationSet(false); ScaleAnimation anim = new ScaleAnimation(zoomLevel, zoomNext, zoomLevel, zoomNext); set.addAnimation(anim); set.setDuration(0); set.setFillEnabled(true); set.setFillAfter(true); v.startAnimation(set); zoomLevel += zoomNext; zoomNext = zoomLevel - zoomNext; zoomLevel-=zoomNext; } }); } } </code></pre> <p>And tha xml is:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p>What I do please suggest me....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload