2 messages in com.googlegroups.android-developers[android-developers] Re: creating a t...| Subject: | [android-developers] Re: creating a transition between two views![]() |
|---|---|
| From: | rukiman (ruks...@optushome.com.au) |
| Date: | 05/22/2008 05:58:10 PM |
| List: | com.googlegroups.android-developers |
OK I am close, this is what I got so far. BUT the the content of the first textview and second textview are displayed on top of each other basically making the screen look messy. What I really want is only the first textview is to be visible and the second textview to become visible ONLY as the rotate transition effect occurs. Is there a way I can set up opacity of the first textview so that the second view is not shown through ?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listlayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <FrameLayout android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/description1" android:text="This is the first page of stuff over here. YO YO YOY OY OYOYOYOYO" android:scaleType="fitCenter" android:textColor="#FFFFFF" android:background="#FF0000" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible" /> <TextView android:id="@+id/description2" android:text="This is the second page with a bunch of widgets and stuff!!!!!" android:scaleType="fitCenter" android:textColor="#FFFFFF" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible" /> </FrameLayout> <TextView android:id="@+id/listmenu" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom" /> </LinearLayout>
package com.ruki.transitiondemo;
import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.RotateAnimation; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView;
public class TransitionDemo extends Activity {
private LinearLayout layout; private TextView list;
/** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main);
layout = (LinearLayout) findViewById(R.id.listlayout); list = (TextView) findViewById(R.id.description1);
layout.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) {
RotateAnimation b = new RotateAnimation(0f, 45f); b.setDuration(1000);
list.startAnimation(b); } }); } }
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to andr...@googlegroups.com To unsubscribe from this group, send email to andr...@googlegroups.com Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---




