Merge pull request #936 from nextcloud/fix-fab-changing-from-background

Fix fab stuff
This commit is contained in:
Andy Scherzinger 2017-05-03 09:23:44 +02:00 committed by GitHub
commit 9f6338adec

View file

@ -601,11 +601,18 @@ public class ExtendedListFragment extends Fragment
*
* @param enabled Desired visibility for the FAB.
*/
public void setFabEnabled(boolean enabled) {
if (enabled) {
mFabMain.setVisibility(View.VISIBLE);
} else {
mFabMain.setVisibility(View.GONE);
public void setFabEnabled(final boolean enabled) {
if (getActivity() != null) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (enabled) {
mFabMain.setVisibility(View.VISIBLE);
} else {
mFabMain.setVisibility(View.GONE);
}
}
});
}
}