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

U-shaped thinking-how to make the right decision at critical moments

U-shaped thinking - how to make the right decisio...

How to calculate keyword conversion rate in Baidu bidding?

1. Conversion rate = number of orders/number of c...

How to improve the conversion rate of increasing followers of public accounts?

The conversion rate of an event increased by 50% ...

Review of the TV version of the beautiful big-screen adventure "Dodo Escape"

Screen: Sound Effects: operate: Plot: Experience:...

How to build a user portrait that can be implemented?

01Written in front User portrait is a commonplace...

Learn animation rules from Hollywood animation masters

Learn animation rules with Hollywood animation ma...

Which Doraemon gadget is the most powerful? Some of them have actually come true

Review expert: Liu Xiangquan, Director of the Rob...

Use private domain traffic to achieve ROI of 1:100 for educational products

I have been wanting to write this article for a y...

7 kinds of marketing techniques, which one would you use?

After Erke became famous because of its donations...