[android-developers] android animation on content of fragment

2012-07-12 Thread LordMaKo


I need to have a frame by frame animation inside a fragment:

the animation works properly if i have it inside an activity, but inside my 
fragment it doesnt show,

public class HomeTab extends Fragment {
 AnimationDrawable animation;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (container == null) {

return null;
}


animation = new AnimationDrawable();
animation.addFrame(getResources().getDrawable(R.drawable.c_0), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c1), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c2), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c3), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c4), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c5), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c6), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c7), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c8), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c9), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c10), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c9), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c8), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c7), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c6), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c5), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c4), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c3), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c2), 100);
animation.addFrame(getResources().getDrawable(R.drawable.c1), 100);

animation.setOneShot(false);

}


/*class Starter implements Runnable {

public void run() {
animation.start();
}

}

*/


}


so how to make this frame by frame animation work inside the fragment?

thanks!





-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] problems implementing fragments in my navigation

2012-06-04 Thread LordMaKo
hi, I am a iOS developer, coming new to the land of android, ;)

I have started my android app, and tested some of the components, but have 
problem implementing the structure and a few things...

I need to make my android app, very similar to my iPhone app, as to use the 
same artwork, and keep same design

so my iPhone app works like this:
tabs, that go to different categories, the category index [tab] is a list 
[table] that when tapped a cell goes to a view relating that cell,  so if 
there are 5 items if user taps item 4 it goes to that view, and if a swipe 
is detected it will go to another view in this stack of views for that tab.


For my Android app, I have tried with a  tab host that loads different 
fragments, and then in one tab for example I show a listFragment that when 
tapped goes to  another fragment , all working so far, 

but when I want to scroll left or right to have another fragment for that 
tab, I have a problem, knowing how to implement this, I tried first by 
sensing when a swipe happens[but cannot detect the swipe]
SO 
questionhttp://stackoverflow.com/questions/10875485/android-swipe-not-detected-inside-a-fragment

also, I have looked at the view pager, but don't understand where to place 
it? on the listFragment?


2..
the second problem i Have with fragments is:
i need to show a frame by frame animation [works in an activity], but when 
I haven't figured out yet how to place it on my fragment?
SO question about animation on 
fragmenthttp://stackoverflow.com/questions/10876468/android-frame-by-frame-animation-on-fragment

So what approach to use to solve my navigation and animation problems?


Thanks!


 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: android listFragment crashing

2012-05-31 Thread LordMaKo
Ok, so I see a very big error, but don't know how to fix it

On my class declaration , im using wrong cast??


//public class Tab2Fragment extends Fragment { //primera pregunta, l 
public class Tab2Fragment extends FragmentActivity { 


Im using  FragmentActivity

But I should be really using Fragment

But if i do just this change all my code won't work, so how to adapt it for 
using only Fragment?

thanks a lot!






-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en