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

Google Play Store keyword search optimization!

(Based on the US Google Play Store app search ran...

This 279 yuan gaming mouse may be as good as a thousand yuan product

1Good feel specially designed for gamers Thunder,...

How to build an activity operation framework in 4 steps?

In this article, the author will explain how to e...

TikTok Dou+ Nuggets Training Camp (Third Session)

: : : : : : : : : : : : : : : : : : : : : : : : : ...

How did WeChat product managers and architects handle 1 billion red envelopes?

WeChat has such a huge amount of traffic, especia...

Tencent advertising account building skills sop

Next, let’s discuss the creative logic and review...

GAC Trumpchi unveils its new S7 series with aviation-grade standards

On March 7, Zhuhai Airshow Center. "Thousand...

Detailed explanation of the order design model in the e-commerce platform!

As a business subsystem, the order system is very...

August's hot topics! I just ask you whether you want to chase her or not!

Chasing hot topics has become one of the essentia...