Floating Action Button blocking other components

后端 未结 6 2307
粉色の甜心
粉色の甜心 2021-02-19 01:41

The new Material Design of Google recommends to use floating action buttons to draw attention to the user for the main action on that screen. There are quite a lot of examples o

6条回答
  •  伪装坚强ぢ
    2021-02-19 02:27

    While loading the list, You can create a flag and find if the item in the list is last visible item in the screen,than hide the floating button.

    use this to find last visible item

    int currentPosition = list.getLastVisiblePosition();
    

    You will get the last number of the item.i.e if 7th item is last visible in your list,than it will return value of currentPosition = 7;

    Once you get the number of items that fit in your screen,Now check for the flag

    if(listAdapterItemsArray.get(position) == currentPosition) {
        //hide button
    } else {
        //nothing 
    }
    

提交回复
热议问题