Merge pull request #5187 from nextcloud/fab

FAB: show disabled correctly again
This commit is contained in:
Tobias Kaminsky 2020-01-14 17:14:53 +01:00 committed by GitHub
commit 4cb800ea13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ package com.owncloud.android.ui.fragment;
import android.animation.LayoutTransition;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.PorterDuff;
@ -608,10 +609,13 @@ public class ExtendedListFragment extends Fragment implements
getActivity().runOnUiThread(() -> {
if (enabled) {
mFabMain.setEnabled(true);
ThemeUtils.tintDrawable(mFabMain.getBackground(), ThemeUtils.primaryColor(getContext()));
int primaryColor = ThemeUtils.primaryColor(getContext());
mFabMain.setBackgroundTintList(ColorStateList.valueOf(primaryColor));
mFabMain.setRippleColor(primaryColor);
} else {
mFabMain.setEnabled(false);
ThemeUtils.tintDrawable(mFabMain.getBackground(), Color.GRAY);
mFabMain.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
mFabMain.setRippleColor(Color.GRAY);
}
});
}