Some tweaks to the camera FAB.

This commit is contained in:
Greyson Parrelli 2019-07-26 15:29:44 -04:00
parent 1ec45fe364
commit cdfb88ea18
2 changed files with 14 additions and 4 deletions

View File

@ -59,14 +59,16 @@
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="150dp"
android:scrollbars="vertical"
android:nextFocusDown="@+id/fab"
android:nextFocusForward="@+id/fab"
android:clipToPadding="false"
tools:listitem="@layout/conversation_list_item_view" />
</LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
<org.thoughtcrime.securesms.components.registration.PulsingFloatingActionButton
android:id="@+id/camera_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@ -117,7 +117,7 @@ public class ConversationListFragment extends Fragment
private ImageView emptyImage;
private TextView emptySearch;
private PulsingFloatingActionButton fab;
private FloatingActionButton cameraFab;
private PulsingFloatingActionButton cameraFab;
private Locale locale;
private String queryFilter = "";
private boolean archive;
@ -141,8 +141,13 @@ public class ConversationListFragment extends Fragment
emptyImage = ViewUtil.findById(view, R.id.empty);
emptySearch = ViewUtil.findById(view, R.id.empty_search);
if (archive) fab.hide();
else fab.show();
if (archive) {
fab.hide();
cameraFab.hide();
} else {
fab.show();
cameraFab.show();
}
reminderView.setOnDismissListener(() -> updateReminders(true));
@ -189,6 +194,7 @@ public class ConversationListFragment extends Fragment
super.onPause();
fab.stopPulse();
cameraFab.stopPulse();
EventBus.getDefault().unregister(this);
}
@ -382,6 +388,7 @@ public class ConversationListFragment extends Fragment
emptySearch.setVisibility(View.INVISIBLE);
emptyImage.setImageResource(EMPTY_IMAGES[(int) (Math.random() * EMPTY_IMAGES.length)]);
fab.startPulse(3 * 1000);
cameraFab.startPulse(3 * 1000);
} else if ((cursor == null || cursor.getCount() <= 0) && !TextUtils.isEmpty(queryFilter)) {
list.setVisibility(View.INVISIBLE);
emptyState.setVisibility(View.GONE);
@ -392,6 +399,7 @@ public class ConversationListFragment extends Fragment
emptyState.setVisibility(View.GONE);
emptySearch.setVisibility(View.INVISIBLE);
fab.stopPulse();
cameraFab.stopPulse();
}
getListAdapter().changeCursor(cursor);