ActivityGroup: Jumping inside and outside of Activity

ActivityGroup: Jumping inside and outside of Activity


Source code introduction

A source code I saw on the Internet is about jumping inside and outside the Activity in ActivityGroup. Friends who are interested can study it!
Source code screenshot

Source code snippet

  1. public   class MainActivityGroup extends AbsActivityGroup{
  2.   
  3. // The first method that needs to be implemented, directly return the layout of the ActivityGroup implementation class  
  4. // Note that this layout must have a layout with the id activity_group_container to hold the sub-Activity layout  
  5. @Override  
  6. protected   int getLayoutResourceId() {
  7. // Arrange tabs horizontally  
  8. return R.layout.activity_group_bottom5_layout;
  9. // If the tabs are arranged vertically, you can return to the following layout  
  10. //return R.layout.activity_group_left5_layout;  
  11. }
  12.   
  13. // The second method to be implemented returns the id of the radioButton corresponding to the tab in the layout  
  14. @Override  
  15. protected   int [] getRadioButtonIds() {
  16. return   new   int [] { R.id.activity_group_radioButton0,
  17. R.id.activity_group_radioButton1,
  18. R.id.activity_group_radioButton2,
  19. R.id.activity_group_radioButton3,
  20. R.id.activity_group_radioButton4 };
  21. }
  22.   
  23. // The third method to be implemented is the icon corresponding to the radioButton in the above method. Note that the icon size should be adjusted to the appropriate size  
  24. @Override  
  25. protected   int [] getRadioButtonImageIds() {
  26. return   new   int [] { R.drawable.icon2, R.drawable.icon2, R.drawable.icon2,
  27. R.drawable.icon2, R.drawable.icon2, };
  28. }
  29.   
  30. // The fourth method that needs to be implemented is the text corresponding to the radioButton, which is the text of the tab label.  
  31. // ***Don't make it too long, otherwise you need to adjust the text size in the layout file to fit the interface  
  32. @Override  
  33. protected String[] getRadioButtonTexts() {
  34. return   new String[]{ "A" , "B" , "C" , "D" , "E" };
  35. }
  36.   
  37. // The fifth method to be implemented returns the first sub-Activity corresponding to each tab (note that it must be inherited from AbsSubActivity)  
  38. @SuppressWarnings ( "unchecked" )
  39. @Override  
  40. public Class<!--? extends Activity-->[] getClasses() {
  41. Class<!--? extends Activity-->[] classes = new Class[] { A1Activity. class ,
  42. B1Activity. class , C1Activity. class , D1Activity. class ,
  43. E1Activity.class };
  44. return classes;
  45. }
  46.   
  47. }

Source code link: http://download..com/data/2012779

<<:  Apple Watch Platform Cognition and Product Design

>>:  Android app automatic updates

Recommend

Lessons from Momo’s overseas market promotion!

On August 27, Momo released its second quarter 20...

iOS vs Android: Will Apple repeat the mistakes of its PC business?

Since its birth, the iPhone has attracted countle...

How to obtain seed users during the cold start period?

For Internet products, if there are no users, no ...

Why does the phone lose power quickly when charging with computer USB?

Why does the battery drain faster after charging ...

What to expect from Google's September 29 event

[[150711]] Apple, Samsung, Sony and Motorola have...