简体   繁体   中英

Android how to achieve this type of layout with rows and col span

在此处输入图片说明

在此处输入图片说明

Requirement:

  • I should be able to scroll entire view if left view is visible or not (all components should scroll at a time if i scroll anywhere with in the view).
  • By clicking on show/hide left view button button it should be able to hide or show left view.
  • In cell (only cell not left view) there is a expand/collapse functionality (i can increase/decrease cell height)
  • And If i change font size in device settings app, it should be effect here also(So supporting dynamic font size)

Navigation drawer + Recycler view is a good solution.

Alternatively to the navigation drawer you can just use a ConstraintLayout that contains your header, left and RecyclerView.

I should be able to scroll entire view if left view is visible or not (all components should scroll at a time if i scroll anywhere with in the view).

That will be resolved by the recycler view itself.

By clicking on show/hide left view button button it should be able to hide or show left view.

Just toggle the visibility of your left view when clicking the button, use something like:

public void toggleLeftViewVisible() {
    int visibility = leftView.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE;
    leftView.setVisibility(visibility);
}

In cell (only cell not left view) there is a expand/collapse functionality (i can increase/decrease cell height)

Resolve that by adding a click listener (maybe on a button or on the view itself) inside your recycler view adapter.

And If i change font size in device settings app, it should be effect here also(So supporting dynamic font size)

If you do the right implementation this should be taken care automatically by Android.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM