Given this code:
public class QuizSplashActivity extends QuizActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
TextView logo1 = (TextView) findViewById (R.id.TextViewTopTitle);
Animation fade1 = AnimationUtils.loadAnimation (this, R.anim.fade_in);
logo1.startAnimation (fade1);
TextView logo2 = (TextView) findViewById (R.id.TextViewBottomTitle);
Animation fade2 = AnimationUtils.loadAnimation (this, R.anim.fade_in2);
logo2.startAnimation (fade2);
Animation spinin = AnimationUtils.loadAnimation(this, R.anim.custom_anim);
LayoutAnimationController controller = new LayoutAnimationController(spinin);
TableLayout table = (TableLayout) findViewById(R.id.TableLayout01);
for (int i = 0; i < table.getChildCount(); i++)
{
TableRow row = (TableRow) table.getChildAt(i);
row.setLayoutAnimation(controller);
}
}
}
Am I applying three different animations to three different views in Android? Or should I make a separate method per each animation code? I'm getting errors on object types TextView, ImageView, LayoutAnimationController, TableLayout, and TableRow as seen by red underscores in those words as well as the corresponding "x" images on their leftmost side.
Btw, I've made external animation resources under res/anim folder namely fade_in.xml, fade_in2.xml, and custom_anim.xml as is called in the few lines of codes in the whole coding as was posted.
public class QuizSplashActivity extends QuizActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
TextView logo1 = (TextView) findViewById (R.id.TextViewTopTitle);
Animation fade1 = AnimationUtils.loadAnimation (this, R.anim.fade_in);
logo1.startAnimation (fade1);
TextView logo2 = (TextView) findViewById (R.id.TextViewBottomTitle);
Animation fade2 = AnimationUtils.loadAnimation (this, R.anim.fade_in2);
logo2.startAnimation (fade2);
Animation spinin = AnimationUtils.loadAnimation(this, R.anim.custom_anim);
LayoutAnimationController controller = new LayoutAnimationController(spinin);
TableLayout table = (TableLayout) findViewById(R.id.TableLayout01);
for (int i = 0; i < table.getChildCount(); i++)
{
TableRow row = (TableRow) table.getChildAt(i);
row.setLayoutAnimation(controller);
}
}
}
Am I applying three different animations to three different views in Android? Or should I make a separate method per each animation code? I'm getting errors on object types TextView, ImageView, LayoutAnimationController, TableLayout, and TableRow as seen by red underscores in those words as well as the corresponding "x" images on their leftmost side.
Btw, I've made external animation resources under res/anim folder namely fade_in.xml, fade_in2.xml, and custom_anim.xml as is called in the few lines of codes in the whole coding as was posted.