Search code examples
androidandroid-layoutwechat

Android: Layout used by wechat


In WeChat, it uses white sections for different things as you can see in below image there are three white sections in it and each item is separated by a black line:

enter image description here

I can suspect this is not a ListView as one might think in first glance.

Question: Does anyone know is this some built-in component that can be used or how to go about creating similar sections ?


Solution

  • I would say a linearlayout inside a scrollview with your custom listview and custom adapter is the most straightforward solution.

    Each time the view is inflated you check the shared preference and fill in the info accordingly in your adapter. And on item click you open corresponding fragment/activity that do something. Then you issue a callback to refresh this settings view.

    Might not be the most elegant way to do it. But I think this one is easy and clear.