[Android] Summary of the layout of Weibo plagiarism

Source: Internet
Author: User

We should learn from others' good things and make improvements.

 

I'm not good at drawing a picture. In fact, I really want to use the drawing method to describe everything, because the simple and simple method is the best.

 

The first is the mind map... this mind map, because you can only view the interface, do not get the source code, so through the drawing method to analyze the interface and functions

 

 

This is the XML of the homepage. I believe the discerning person will know it at a Glance. This is a full-screen adaptation. Weibo teaching from Shen Dahai and blog analysis by farmer uncle Sina official Weibo Layout

 

Pink is divided into the top bar of fixed pixels and the tab menu at the bottom

The top is composed of relativelayout. You can add titles and tips ..

The tab is displayed at the bottom, which switches between different activities.

 

The middle part is the yellow part, that is, the layout that dynamically changes and refreshes various data.

Then, they are subdivided into [Blue Red] and [light blue] by proportion. Their proportion is full of parent classes.

 

The blue and red colors are the same layout, the red width is fill_parent, and the height is wrap_content,

Add different headers to each activity to lay the foundation for freedom.

 

In the dark blue mode, the width of the height is fill_parent, which is filled with the parent class together with the red layout,

Blue can be used to add listview or gridview to the real Weibo list or user list. People who have used pad Weibo should know

 

The logic of the question is divided into bossactivity in charge of all layout display, and then the activity has a search, my homepage, information ,@,....

They do not require any layout. They only need to call the lifecycle reasonably to refresh the data to the dark blue part of the boss.

 

In the red part, each sub-activity <search, my homepage, information, @,...> is different. You can use layoutinflater to load...

 

The light blue part indicates the three layout loaded for the derived three activities, which are clearly the microblog body, user information, and topic details.

Which activity does the response load when the item in the dark blue part is clicked? Now you have the command.

 

The difficulty lies in... the user information activity should look at the user information again, look at a user information again, then look at the microblog body, then look at a user's microblog...

The three activities can be reused. The mind map can also clearly show that there is a loop.

 

This idea was set by me, but I think there will certainly be various details in the code writing process...

There is also such an idea. If some people have good suggestions or comments, they must come up with them.

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <tabhost <br/> xmlns: Android = "http://schemas.android.com/apk/res/android" <br/> Android: Orientation = "vertical" <br/> Android: gravity = "center" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "fill_parent" <br/> Android: id = "@ + ID/@ Android: ID/tabhost" <br/> Android: background = "@ drawable/myweibo_boss_bg"> <br/> <relativelayout <br/> Android: layout_width = "fill_parent" <br/> and Roid: layout_height = "fill_parent" <br/> Android: Orientation = "vertical"> <br/> <! -- Top horizontal bar --> <br/> <relativelayout <br/> Android: Background = "@ drawable/top3" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "41dip" <br/> Android: id = "@ + ID/layout_weibo_boss_top"> </relativelayout> <br/> <relativelayout <br/> Android: layout_centerinparent = "true" <br/> Android: layout_below = "@ + ID/layout_weibo_boss_top" <br/> Android: layout_above = "@ + ID/layout_weibo_boss_bottom" <br /> Android: layout_width = "fill_parent" <br/> Android: layout_height = "fill_parent" <br/> Android: id = "@ + ID/layout_weibo_boss_middle_msg"> </relativelayout> <br/> <linearlayout <br/> Android: layout_below = "@ + ID/layout_weibo_boss_top" <br/> Android: layout_above = "@ + ID/layout_weibo_boss_bottom" <br/> Android: id = "@ + ID/layout_weibo_boss_middle" <br/> Android: Orientation = "horizontal" <br/> Android: layout_width = "Fill_parent" <br/> Android: layout_height = "fill_parent"> <br/> <linearlayout <br/> Android: layout_weight = "1.0" <br/> Android: orientation = "vertical" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "fill_parent" <br/> Android: id = "@ + ID/weiboss_leftlayout" <br/> Android: Background = "@ drawable/weibo_list_bg"> <br/> <! -- View the heap on the listview --> <br/> <relativelayout <br/> Android: Background = "@ drawable/weibo_boss_topitems_bg" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: id = "@ + ID/topitem_of_weiboss_leftlayout"> <br/> </relativelayout> <br/> <! -- Layout --> <br/> <relativelayout <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "fill_parent" <br/> Android: id = "@ + ID/list_of_weiboss_leftlayout"> <br/> </relativelayout> <br/> </linearlayout> <br/> <! -- Layout on the right of the boss can be Weibo details or user details --> <br/> <relativelayout <br/> Android: layout_weight = "1.0" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "fill_parent" <br/> Android: id = "@ + ID/weiboss_rightlayout"> </relativelayout> <br/> </linearlayout> <br/> <framelayout <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "0.0dip" <br/> Android: layout_weight = "1.0" <br/> Ndroid: Id = "@ Android: ID/tabcontent"> <br/> </framelayout> <br/> <tabwidget <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "0.0dip" <br/> Android: layout_weight = "0.0" <br/> Android: visibility = "gone" <br/> Android: Id = "@ Android: ID/tabs"> </tabwidget> <br/> <! -- Horizontal bar at the bottom and radiobutton --> <br/> <relativelayout <br/> Android: layout_alignparentbottom = "true" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "57dip" <br/> Android: Background = "@ drawable/formlist_bottom_btn" <br/> Android: id = "@ + ID/layout_weibo_boss_bottom"> <br/> <radiogroup <br/> Android: layout_width = "wrap_content" <br/> Android: layout_height = "57dip" <br/> Android: Orientation = "horizontal" <br/> Android: gravity = "center_vertical" <br/> Android: layout_gravity = "bottom" <br/> Android: Id = "@ + ID/boss_radio"> <br/> <radiobutton <br/> Android: drawabletop = "@ drawable/radio_newstyle_boss_home" <br/> Android: checked = "true" <br/> Android: Id = "@ + ID/radio_button0" <br/> Android: layout_margintop = "2.0dip" <br/> style = "@ style/boss_tab_bottom"> <br/> </radiobutton> <br/> <radiobutton <br/> Android: drawabletop = "@ drawable/radio_newstyle_boss_search" <br/> Android: Id = "@ + ID/radio_button1" <br/> Android: layout_margintop = "2.0dip" <br/> style = "@ style/boss_tab_bottom"/> <br/> <radiobutton <br/> Android: drawabletop = "@ drawable/radio_newstyle_boss_myweibo" <br/> Android: Id = "@ + ID/radio_button2" <br/> Android: layout_margintop = "2.0dip" <br/> style = "@ style/boss_tab_bottom"/> <br/> <radiobutton <br/> Android: drawabletop = "@ drawable/radio_newstyle_boss_reply" <br/> Android: Id = "@ + ID/radio_button3" <br/> Android: layout_margintop = "2.0dip" <br/> style = "@ style/boss_tab_bottom"/> <br/> <radiobutton <br/> Android: drawabletop = "@ drawable/radio_newstyle_boss_atme" <br/> Android: Id = "@ + ID/radio_button4" <br/> Android: layout_margintop = "2.0dip" <br/> style = "@ style/boss_tab_bottom"/> <br/> <radiobutton <br/> Android: drawabletop = "@ drawable/radio_newstyle_boss_neweibo" <br/> Android: Id = "@ + ID/radio_button5" <br/> Android: layout_margintop = "2.0dip" <br/> style = "@ style/boss_tab_bottom"/> <br/> </radiogroup> <br/> </relativelayout> <br/> </relativelayout> <br/> </tabhost> <br/> 

 

 

Then record the problems and solutions in each section.

 

MATERIALS: Sina Weibo layout learning-use tabhost

Http://www.cnblogs.com/over140/archive/2011/03/02/1968042.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.