mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Pass information to bottom sheet
This commit is contained in:
parent
e15daa15e1
commit
14dc1b95ab
2 changed files with 18 additions and 11 deletions
|
|
@ -9,14 +9,13 @@ 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.support.v4.view.GravityCompat;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
|
@ -53,6 +52,11 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
private FloatingActionButton fabCamera;
|
||||
private FloatingActionButton fabGallery;
|
||||
private View transparentView;
|
||||
private TextView description;
|
||||
private TextView title;
|
||||
private TextView distance;
|
||||
|
||||
|
||||
private boolean isFabOpen=false;
|
||||
private Animation rotate_backward;
|
||||
private Animation fab_close;
|
||||
|
|
@ -146,6 +150,10 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
|
||||
transparentView = getActivity().findViewById(R.id.transparentView);
|
||||
moreInfo = getActivity().findViewById(R.id.more_info_button);
|
||||
|
||||
description = getActivity().findViewById(R.id.description);
|
||||
title = getActivity().findViewById(R.id.title);
|
||||
distance = getActivity().findViewById(R.id.category);
|
||||
}
|
||||
|
||||
private void setListeners() {
|
||||
|
|
@ -177,8 +185,9 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
|
||||
@Override
|
||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||
if(slideOffset>=0){
|
||||
if (slideOffset >= 0) {
|
||||
transparentView.setAlpha(slideOffset);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -321,7 +330,9 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
}
|
||||
|
||||
private void passInfoToSheet(Place place) {
|
||||
|
||||
description.setText(place.getDescription().toString());
|
||||
title.setText(place.name.toString());
|
||||
distance.setText(place.distance.toString());
|
||||
}
|
||||
|
||||
private void animateFAB(boolean isFabOpen) {
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@
|
|||
android:layout_marginRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:text="Denemeler" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label2"
|
||||
android:id="@+id/category"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
|
|
@ -142,11 +142,7 @@
|
|||
android:layout_marginLeft="72dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:textSize="16sp"
|
||||
android:text="Description Description Description
|
||||
Description Description Description
|
||||
Description Description Description
|
||||
" />
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue