Note that there are some explanatory texts on larger screens.

plurals
  1. POWindow problems in Android
    primarykey
    data
    text
    <p>I am planning to perform a Rotating Animation on a two directional scroll view (see <a href="https://stackoverflow.com/questions/3866499/two-directional-scroll-view">link</a>). I have got the effect of the 2 directional scroll view, but now when i perform a Filp3D Type of animation (see <a href="http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html" rel="nofollow noreferrer">link</a>) i am getting a rotating window !</p> <p>i actually wanted to perform a rotation around x-axis animation and then perform successive animation.</p> <p>My Code is :</p> <pre><code>public class MainActivity extends Activity { ScrollView sv; WScrollView hsv; Animation anim; RelativeLayout rl; Button b1,b2,b3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /*BIDIRECTIONAL SCROLLVIEW*/ sv = new ScrollView(this); hsv = new WScrollView(this); hsv.sv = sv; /*END OF BIDIRECTIONAL SCROLLVIEW*/ rl = new RelativeLayout(this); rl.setBackgroundResource(R.drawable.interactivemap); sv.addView(rl, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); hsv.addView(sv, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT /*or FILL_PARENT if API &lt; 8*/)); setContentView(hsv); Window window = getWindow(); window.setLayout(0, LayoutParams.WRAP_CONTENT); /* Animation Effects : Stage I */ applyRotation(0, 45); /* Animation Effects : Stage II */ /* Still to perform ! */ } private void applyRotation(final float start, final float end) { new Handler().postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub final float centerX = hsv.getWidth() / 2.0f + hsv.getLeft(); final float centerY = hsv.getHeight() / 2.0f + hsv.getTop(); Log.e("center-x center-y ",centerX+" "+centerY+"found"); final Flip3dAnimation rotation = new Flip3dAnimation(start, end, centerX, centerY); rotation.setDuration(2000); rotation.setFillAfter(true); rotation.setInterpolator(new LinearInterpolator()); hsv.startAnimation(rotation); } }, 10); } } </code></pre> <p><b>Output :</b><br> <b>1)</b> The output is sometimes an animation around a different axis and then it becoming invisible, as if i have not put any setFillAfter(true), which happens to present in the Flip3dAnimation Class as shown in the two directional scroll view link.<br> <b>2)</b> The Animation comes and persists but only the original window is rotated in the 3d space, as if a card has flip 45 degrees !</p> <p>I need the second Output with any window restrictions, as i have used a scroll view (2d), i want to be visible like a 2d plane as in a game like AOE (Age of Empires, seriously, people play games :D), or for non-games, a open 2d surface.</p> <p>Please guide me for achieving the same, also please direct me to some source code which performs complex 2d animations for API-8 or 9.</p>
    singulars
    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