mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add FAB buttons
This commit is contained in:
parent
6d2577d14e
commit
970213f900
2 changed files with 63 additions and 1 deletions
|
|
@ -41,7 +41,13 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
private View bottomSheetDetails;
|
||||
private BottomSheetBehavior bottomSheetListBehavior;
|
||||
private BottomSheetBehavior bottomSheetDetailsBehavior;
|
||||
|
||||
private FloatingActionButton fabList;
|
||||
private FloatingActionButton fabPlus;
|
||||
private FloatingActionButton fabCamera;
|
||||
private FloatingActionButton fabGallery;
|
||||
private View transparentView;
|
||||
private int currBottomSheetState;
|
||||
private boolean isFabOpen=false;
|
||||
|
||||
public NearbyMapFragment() {
|
||||
}
|
||||
|
|
@ -91,7 +97,12 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
bottomSheetDetailsBehavior = BottomSheetBehavior.from(bottomSheetDetails);
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
//moreInfo = getActivity().findViewById(R.id.more_info_bar);
|
||||
fabList = getActivity().findViewById(R.id.fab_list);
|
||||
fabPlus = getActivity().findViewById(R.id.fab_plus);
|
||||
fabCamera = getActivity().findViewById(R.id.fab_camera);
|
||||
fabGallery = getActivity().findViewById(R.id.fab_galery);
|
||||
|
||||
transparentView = getActivity().findViewById(R.id.transparentView);
|
||||
}
|
||||
|
||||
private void setupMapView(Bundle savedInstanceState) {
|
||||
|
|
|
|||
|
|
@ -66,6 +66,57 @@
|
|||
<include layout="@layout/bottom_sheet_nearby" />
|
||||
<include layout="@layout/bottom_sheet_details" android:id="@+id/bottom_sheet_details" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_plus"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_margin="16dp"
|
||||
android:visibility="invisible"
|
||||
android:clickable="true"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:backgroundTint="@color/primaryColor"
|
||||
app:layout_anchor="@id/bottom_sheet_details"
|
||||
app:layout_anchorGravity="top|right|end"/>
|
||||
<View
|
||||
android:id = "@+id/empty_view1"
|
||||
android:layout_height = "206dip"
|
||||
android:layout_width = "56dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
<View
|
||||
android:id = "@+id/empty_view2"
|
||||
android:layout_height = "86dip"
|
||||
android:layout_width = "56dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_camera"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/cardview_light_background"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:layout_anchor="@id/empty_view1"
|
||||
app:layout_anchorGravity="center_horizontal"/>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/cardview_light_background"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:layout_anchor="@id/empty_view2"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue