fix tests

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-06-25 15:57:46 +02:00
parent bd5c9dfa1e
commit 38c28332e2
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -290,9 +290,12 @@ public class OCFileListFragment extends ExtendedListFragment implements
setChoiceModeAsMultipleModal(savedInstanceState); setChoiceModeAsMultipleModal(savedInstanceState);
} }
mFabMain = getActivity().findViewById(R.id.fab_main); mFabMain = requireActivity().findViewById(R.id.fab_main);
ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
ThemeUtils.drawableFloatingActionButton(mFabMain, R.drawable.ic_plus, requireContext()); if (mFabMain != null) { // is not available in FolderPickerActivity
ThemeUtils.tintFloatingActionButton(mFabMain, requireContext());
ThemeUtils.drawableFloatingActionButton(mFabMain, R.drawable.ic_plus, requireContext());
}
Log_OC.i(TAG, "onCreateView() end"); Log_OC.i(TAG, "onCreateView() end");
return v; return v;
@ -1758,6 +1761,11 @@ public class OCFileListFragment extends ExtendedListFragment implements
* @param visible Desired visibility for the FAB. * @param visible Desired visibility for the FAB.
*/ */
void setFabVisible(final boolean visible) { void setFabVisible(final boolean visible) {
if (mFabMain == null) {
// is not available in FolderPickerActivity
return;
}
if (getActivity() != null) { if (getActivity() != null) {
getActivity().runOnUiThread(() -> { getActivity().runOnUiThread(() -> {
if (visible) { if (visible) {
@ -1803,6 +1811,11 @@ public class OCFileListFragment extends ExtendedListFragment implements
* @param enabled Desired visibility for the FAB. * @param enabled Desired visibility for the FAB.
*/ */
public void setFabEnabled(final boolean enabled) { public void setFabEnabled(final boolean enabled) {
if (mFabMain == null) {
// is not available in FolderPickerActivity
return;
}
if (getActivity() != null) { if (getActivity() != null) {
getActivity().runOnUiThread(() -> { getActivity().runOnUiThread(() -> {
if (enabled) { if (enabled) {