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

How to recall lost users? Analysis from 3 aspects!

Some people say that whether or not one can succe...

What do astronauts do when they go out for a walk?

The recent "Feel Good" team Going out f...

Bigger is better? How RAM size affects mobile phone performance

In today's mobile phone market, many manufactu...

Is Bilibili’s brand account “rising”?

When it comes to brand names, you automatically a...

IDC: Enterprise AI spending will exceed $30 billion in 2027

IDC’s recent forecast suggests that by 2027, ente...

How much does it cost to develop a Conghua e-commerce mini program?

Although mini programs have been around for quite...

IDC room rental high bandwidth cost

Most of the bandwidth at home and the data traffi...

How long does it take to make a small program?

Q: How long does it take to make a mini program? ...