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

Baidu Information Flow 11.11 Marketing Manual!

How is the traffic trend of Baidu Information Flo...

Contagious! Rare disease breaks out in the country, over 80 people infected

According to Indian media reports on the 12th, an...

SiriOS may be released soon to help Apple's smart home ecosystem

Following iOS, MacOS, watchOS and iPadOS, Apple&#...

Creative guide to Spring Festival topic marketing!

How to do 5-minute topic marketing during the Spr...

To create a hit short video, what title should be chosen?

The title is the source of the playback volume. J...

Does iOS really need to be upgraded? Analysis of iOS system upgrades

Whenever a new iOS system is released, whether it...

35 Douyin operation tools to attract fans and monetize!

Focusing on different stages, we will introduce t...

The first step to longevity: eat a little fatter!

How fat is healthy? ——A well-proportioned body is...

27 essential tips for making short videos

Recently I heard a friend share how to make short...