mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fixes issues #1228 added recenter button to nearby map
This commit is contained in:
parent
fc91fb8d39
commit
b7b87e0615
5 changed files with 323 additions and 86 deletions
|
|
@ -3,7 +3,6 @@ package fr.free.nrw.commons.nearby;
|
|||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TypeEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
|
|
@ -15,8 +14,6 @@ import android.support.annotation.Nullable;
|
|||
import android.support.design.widget.BottomSheetBehavior;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -82,6 +79,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
private FloatingActionButton fabPlus;
|
||||
private FloatingActionButton fabCamera;
|
||||
private FloatingActionButton fabGallery;
|
||||
private FloatingActionButton fabRecenter;
|
||||
private View transparentView;
|
||||
private TextView description;
|
||||
private TextView title;
|
||||
|
|
@ -93,7 +91,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
private TextView commonsButtonText;
|
||||
private TextView directionsButtonText;
|
||||
|
||||
private boolean isFabOpen=false;
|
||||
private boolean isFabOpen = false;
|
||||
private Animation rotate_backward;
|
||||
private Animation fab_close;
|
||||
private Animation fab_open;
|
||||
|
|
@ -109,8 +107,12 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
private boolean isBottomListSheetExpanded;
|
||||
private final double CAMERA_TARGET_SHIFT_FACTOR = 0.06;
|
||||
|
||||
@Inject @Named("prefs") SharedPreferences prefs;
|
||||
@Inject @Named("direct_nearby_upload_prefs") SharedPreferences directPrefs;
|
||||
@Inject
|
||||
@Named("prefs")
|
||||
SharedPreferences prefs;
|
||||
@Inject
|
||||
@Named("direct_nearby_upload_prefs")
|
||||
SharedPreferences directPrefs;
|
||||
|
||||
public NearbyMapFragment() {
|
||||
}
|
||||
|
|
@ -125,10 +127,12 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
if (bundle != null) {
|
||||
String gsonPlaceList = bundle.getString("PlaceList");
|
||||
String gsonLatLng = bundle.getString("CurLatLng");
|
||||
Type listType = new TypeToken<List<Place>>() {
|
||||
}.getType();
|
||||
String gsonBoundaryCoordinates = bundle.getString("BoundaryCoord");
|
||||
Type listType = new TypeToken<List<Place>>() {}.getType();
|
||||
List<Place> placeList = gson.fromJson(gsonPlaceList, listType);
|
||||
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {}.getType();
|
||||
Type curLatLngType = new TypeToken<fr.free.nrw.commons.location.LatLng>() {
|
||||
}.getType();
|
||||
Type gsonBoundaryCoordinatesType = new TypeToken<fr.free.nrw.commons.location.LatLng[]>() {}.getType();
|
||||
curLatLng = gson.fromJson(gsonLatLng, curLatLngType);
|
||||
baseMarkerOptions = NearbyController
|
||||
|
|
@ -163,16 +167,15 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
this.getView().requestFocus();
|
||||
this.getView().setOnKeyListener((v, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
if(bottomSheetDetailsBehavior.getState() == BottomSheetBehavior
|
||||
if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior
|
||||
.STATE_EXPANDED) {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
return true;
|
||||
}
|
||||
else if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior
|
||||
} else if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior
|
||||
.STATE_COLLAPSED) {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
mapView.getMapAsync(MapboxMap::deselectMarkers);
|
||||
selected=null;
|
||||
selected = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -301,11 +304,12 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
fabPlus = getActivity().findViewById(R.id.fab_plus);
|
||||
fabCamera = getActivity().findViewById(R.id.fab_camera);
|
||||
fabGallery = getActivity().findViewById(R.id.fab_galery);
|
||||
fabRecenter = getActivity().findViewById(R.id.fab_recenter);
|
||||
|
||||
fab_open = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_open);
|
||||
fab_close = AnimationUtils.loadAnimation(getActivity(),R.anim.fab_close);
|
||||
rotate_forward = AnimationUtils.loadAnimation(getActivity(),R.anim.rotate_forward);
|
||||
rotate_backward = AnimationUtils.loadAnimation(getActivity(),R.anim.rotate_backward);
|
||||
fab_close = AnimationUtils.loadAnimation(getActivity(), R.anim.fab_close);
|
||||
rotate_forward = AnimationUtils.loadAnimation(getActivity(), R.anim.rotate_forward);
|
||||
rotate_backward = AnimationUtils.loadAnimation(getActivity(), R.anim.rotate_backward);
|
||||
|
||||
transparentView = getActivity().findViewById(R.id.transparentView);
|
||||
|
||||
|
|
@ -330,14 +334,28 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
fabPlus.setOnClickListener(view -> animateFAB(isFabOpen));
|
||||
|
||||
bottomSheetDetails.setOnClickListener(view -> {
|
||||
if(bottomSheetDetailsBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
if (bottomSheetDetailsBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
});
|
||||
|
||||
fabRecenter.setOnClickListener(view -> {
|
||||
if (curLatLng != null) {
|
||||
mapView.getMapAsync(mapboxMap -> {
|
||||
CameraPosition position = new CameraPosition.Builder()
|
||||
.target(new LatLng(curLatLng.getLatitude(), curLatLng.getLongitude())) // Sets the new camera position
|
||||
.zoom(11) // Sets the zoom
|
||||
.build(); // Creates a CameraPosition from the builder
|
||||
|
||||
mapboxMap.animateCamera(CameraUpdateFactory
|
||||
.newCameraPosition(position), 1000);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
bottomSheetDetailsBehavior.setBottomSheetCallback(new BottomSheetBehavior
|
||||
.BottomSheetCallback() {
|
||||
@Override
|
||||
|
|
@ -351,7 +369,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
transparentView.setAlpha(slideOffset);
|
||||
if (slideOffset == 1) {
|
||||
transparentView.setClickable(true);
|
||||
} else if (slideOffset == 0){
|
||||
} else if (slideOffset == 0) {
|
||||
transparentView.setClickable(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -362,7 +380,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
.BottomSheetCallback() {
|
||||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||
if (newState == BottomSheetBehavior.STATE_EXPANDED){
|
||||
if (newState == BottomSheetBehavior.STATE_EXPANDED) {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
updateMapCameraAccordingToBottomSheet(true);
|
||||
} else {
|
||||
|
|
@ -448,7 +466,15 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
|
||||
mapboxMap.addMarkers(baseMarkerOptions);
|
||||
mapboxMap.setOnInfoWindowCloseListener(marker -> {
|
||||
if (marker == selected){
|
||||
if (marker == selected) {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
});
|
||||
mapView.getMapAsync(mapboxMap -> {
|
||||
mapboxMap.addMarkers(baseMarkerOptions);
|
||||
fabRecenter.setVisibility(View.VISIBLE);
|
||||
mapboxMap.setOnInfoWindowCloseListener(marker -> {
|
||||
if (marker == selected) {
|
||||
bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
|
||||
}
|
||||
});
|
||||
|
|
@ -465,10 +491,10 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Creates a series of points that create a circle on the map.
|
||||
* Takes the center latitude, center longitude of the circle,
|
||||
|
|
@ -684,6 +710,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
}
|
||||
|
||||
private void animateFAB(boolean isFabOpen) {
|
||||
this.isFabOpen = !isFabOpen;
|
||||
if (fabPlus.isShown()){
|
||||
if (isFabOpen) {
|
||||
fabPlus.startAnimation(rotate_backward);
|
||||
|
|
@ -702,14 +729,14 @@ public class NearbyMapFragment extends DaggerFragment {
|
|||
}
|
||||
}
|
||||
|
||||
private void closeFabs(boolean isFabOpen){
|
||||
private void closeFabs ( boolean isFabOpen){
|
||||
if (isFabOpen) {
|
||||
fabPlus.startAnimation(rotate_backward);
|
||||
fabCamera.startAnimation(fab_close);
|
||||
fabGallery.startAnimation(fab_close);
|
||||
fabCamera.hide();
|
||||
fabGallery.hide();
|
||||
this.isFabOpen=!isFabOpen;
|
||||
this.isFabOpen = !isFabOpen;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
9
app/src/main/res/drawable/ic_my_location_black_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_my_location_black_24dp.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11c-0.46,-4.17 -3.77,-7.48 -7.94,-7.94L13,1h-2v2.06C6.83,3.52 3.52,6.83 3.06,11L1,11v2h2.06c0.46,4.17 3.77,7.48 7.94,7.94L11,23h2v-2.06c4.17,-0.46 7.48,-3.77 7.94,-7.94L23,13v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
|
||||
</vector>
|
||||
165
app/src/main/res/layout-land/activity_nearby.xml
Normal file
165
app/src/main/res/layout-land/activity_nearby.xml
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_below="@id/toolbar">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"></FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/transparentView"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:background="#aa969696"
|
||||
android:elevation="6dp"
|
||||
/>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_recenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:clickable="true"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:srcCompat="@drawable/ic_my_location_black_24dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="normal"
|
||||
android:layout_margin="16dp"
|
||||
android:visibility="invisible"
|
||||
android:clickable="true"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:backgroundTint="@color/button_blue"
|
||||
app:layout_anchor="@id/bottom_sheet_details"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp"/>
|
||||
<View
|
||||
android:id = "@+id/empty_view2"
|
||||
android:layout_height = "306dip"
|
||||
android:layout_width = "56dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
<View
|
||||
android:id = "@+id/empty_view1"
|
||||
android:layout_height = "186dip"
|
||||
android:layout_width = "56dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
<View
|
||||
android:id = "@+id/empty_view"
|
||||
android:layout_height = "66dip"
|
||||
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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:layout_anchor="@id/empty_view1"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp"
|
||||
android:tint="@color/button_blue"
|
||||
android:scaleType="center"/>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:layout_anchor="@id/empty_view"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp"
|
||||
android:tint="@color/button_blue"
|
||||
android:scaleType="center"
|
||||
/>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_commons_page"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:layout_anchor="@id/empty_view2"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_commons_icon_vector"
|
||||
android:scaleType="center"
|
||||
/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -4,12 +4,13 @@
|
|||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -23,10 +24,10 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -54,110 +55,142 @@
|
|||
app:srcCompat="@drawable/ic_list_white_24dp"
|
||||
android:scaleType="center"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/transparentView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/transparentView"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="18dp"
|
||||
android:background="#aa969696"
|
||||
android:elevation="6dp"
|
||||
/>
|
||||
android:elevation="6dp">
|
||||
|
||||
</View>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_recenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:clickable="true"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:srcCompat="@drawable/ic_my_location_black_24dp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/bottom_sheet_nearby" />
|
||||
<include layout="@layout/bottom_sheet_details" android:id="@+id/bottom_sheet_details" />
|
||||
|
||||
<include
|
||||
android:id="@+id/bottom_sheet_details"
|
||||
layout="@layout/bottom_sheet_details" />
|
||||
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_plus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="normal"
|
||||
android:layout_margin="16dp"
|
||||
android:visibility="invisible"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:clickable="true"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/button_blue"
|
||||
app:elevation="6dp"
|
||||
app:fabSize="normal"
|
||||
app:layout_anchor="@id/bottom_sheet_details"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp"/>
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:srcCompat="@drawable/ic_add_white_24dp" />
|
||||
|
||||
<View
|
||||
android:id = "@+id/empty_view2"
|
||||
android:layout_height = "306dip"
|
||||
android:layout_width = "56dp"
|
||||
android:id="@+id/empty_view2"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="306dip"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
|
||||
<View
|
||||
android:id = "@+id/empty_view1"
|
||||
android:layout_height = "186dip"
|
||||
android:layout_width = "56dp"
|
||||
android:id="@+id/empty_view1"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="186dip"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
|
||||
<View
|
||||
android:id = "@+id/empty_view"
|
||||
android:layout_height = "66dip"
|
||||
android:layout_width = "56dp"
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="66dip"
|
||||
android:visibility="invisible"
|
||||
app:layout_anchor="@id/fab_plus"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
/>
|
||||
app:layout_anchorGravity="center_horizontal" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_camera"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view1"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp"
|
||||
android:tint="@color/button_blue"
|
||||
android:scaleType="center"/>
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_galery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:scaleType="center"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp"
|
||||
android:tint="@color/button_blue"
|
||||
android:scaleType="center"
|
||||
/>
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_commons_page"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fabSize="mini"
|
||||
android:scaleType="center"
|
||||
android:visibility="invisible"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:fabSize="mini"
|
||||
app:layout_anchor="@id/empty_view2"
|
||||
app:layout_anchorGravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_commons_icon_vector"
|
||||
android:scaleType="center"
|
||||
/>
|
||||
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:srcCompat="@drawable/ic_commons_icon_vector" />
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
<android.support.design.widget.NavigationView
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer"/>
|
||||
app:menu="@menu/drawer" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -20,6 +20,9 @@ BUTTERKNIFE_VERSION=8.6.0
|
|||
org.gradle.jvmargs=-Xmx1536M
|
||||
buildToolsVersion=26.0.2
|
||||
targetSdkVersion=25
|
||||
|
||||
#TODO: Temporary disabled. https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2
|
||||
#Refer to PR: https://github.com/commons-app/apps-android-commons/pull/932
|
||||
android.enableAapt2=false
|
||||
SUPPORT_LIB_VERSION=26.0.2
|
||||
minSdkVersion=15
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue