Fix conflicts

This commit is contained in:
neslihanturan 2017-12-13 16:59:09 +03:00 committed by maskara
parent 88cf1bdcd7
commit e15daa15e1
5 changed files with 50 additions and 36 deletions

View file

@ -14,6 +14,7 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@ -55,6 +56,8 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
@BindView(R.id.bottom_sheet)
LinearLayout bottomSheet;
@BindView(R.id.bottom_sheet_details)
LinearLayout bottomSheetDetails;
@BindView(R.id.fab_list)
FloatingActionButton fabList;
@BindView(R.id.transparentView)
@ -71,7 +74,8 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
private NearbyActivityMode viewMode;
private Disposable placesDisposable;
private boolean lockNearbyView; //Determines if the nearby places needs to be refreshed
private BottomSheetBehavior bottomSheetBehavior;
private BottomSheetBehavior bottomSheetBehavior; // Behavior for list bottom sheet
private BottomSheetBehavior bottomSheetBehaviorForDetails; // Behavior for details bottom sheet
@BindView(R.id.swipe_container) SwipeRefreshLayout swipeLayout;
@Override
@ -115,6 +119,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
@Override
public void onStateChanged(View bottomSheet, int newState) {
Log.d("Deneme","deneme"+newState);
prepareViewsForSheetPosition(newState);
}
@ -123,13 +128,16 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
}
});
bottomSheetBehaviorForDetails = BottomSheetBehavior.from(bottomSheetDetails);
bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN);
}
private void initFabList() {
fabList.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//nearbyMapFragment.bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
});

View file

@ -9,6 +9,8 @@ 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;
@ -278,38 +280,46 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
}
public void prepareViewsForSheetPosition(int bottomSheetState) {
if(bottomSheetState==BottomSheetBehavior.STATE_COLLAPSED){
if(!fabList.isShown()) fabList.show();
if (bottomSheetState == BottomSheetBehavior.STATE_COLLAPSED) {
if (!fabList.isShown()) fabList.show();
closeFabs(isFabOpen);
if(!fabPlus.isShown()){
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fabPlus.getLayoutParams();
p.setAnchorId(getActivity().findViewById(R.id.bottom_sheet_details).getId());
fabPlus.setLayoutParams(p);
fabPlus.show();
}
if (!fabPlus.isShown()) showFAB();
this.getView().requestFocus();
moreInfo.setVisibility(View.VISIBLE);
//NearbyActivity.bottomSheetStatus = NearbyActivity.BottomSheetStatus.DISPLAY_DETAILS_SHEET_COLLAPSED;
}
else if(bottomSheetState==BottomSheetBehavior.STATE_EXPANDED){
if(fabList.isShown()) fabList.hide();
else if (bottomSheetState == BottomSheetBehavior.STATE_EXPANDED) {
if (fabList.isShown()) fabList.hide();
this.getView().requestFocus();
moreInfo.setVisibility(View.GONE);
moreInfo.setVisibility(View.VISIBLE);
//NearbyActivity.bottomSheetStatus = NearbyActivity.BottomSheetStatus.DISPLAY_DETAILS_SHEET_EXPANDED;
}
else if(bottomSheetState==BottomSheetBehavior.STATE_HIDDEN){
else if (bottomSheetState == BottomSheetBehavior.STATE_HIDDEN) {
closeFabs(isFabOpen);
//get rid of anchors
//Somehow this was the only way https://stackoverflow.com/questions/32732932/floatingactionbutton-visible-for-sometime-even-if-visibility-is-set-to-gone
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fabPlus.getLayoutParams();
p.setAnchorId(View.NO_ID);
fabPlus.setLayoutParams(p);
fabPlus.hide();
hideFAB();
moreInfo.setVisibility(View.GONE);
this.getView().clearFocus();
}
//currBottomSheetState = bottomSheetState;
}
private void hideFAB() {
//get rid of anchors
//Somehow this was the only way https://stackoverflow.com/questions/32732932/floatingactionbutton-visible-for-sometime-even-if-visibility-is-set-to-gone
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fabPlus
.getLayoutParams();
p.setAnchorId(View.NO_ID);
fabPlus.setLayoutParams(p);
fabPlus.hide();
}
private void showFAB() {
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fabPlus.getLayoutParams();
p.setAnchorId(getActivity().findViewById(R.id.bottom_sheet_details).getId());
fabPlus.setLayoutParams(p);
fabPlus.show();
}
private void passInfoToSheet(Place place) {
}

View file

@ -90,7 +90,7 @@ class PlaceRenderer extends Renderer<Place> {
private void closeLayout(LinearLayout buttonLayout){
//openedItems.remove(buttonLayout);
buttonLayout.startAnimation(animationUp);
/*buttonLayout.startAnimation(animationUp);
CountDownTimer countDownTimerStatic = new CountDownTimer(COUNTDOWN_RUNNING_TIME, 16) {
@Override
public void onTick(long millisUntilFinished) {
@ -102,14 +102,16 @@ class PlaceRenderer extends Renderer<Place> {
//buttonLayout.setVisibility(View.GONE);
}
};
countDownTimerStatic.start();
countDownTimerStatic.start();*/
buttonLayout.setVisibility(View.GONE);
}
private void openLayout(LinearLayout buttonLayout){
buttonLayout.setVisibility(View.VISIBLE);
/*buttonLayout.setVisibility(View.VISIBLE);
ViewCompat.setElevation( view, 10);
buttonLayout.startAnimation(animationDown);
//openedItems.add(buttonLayout);
//openedItems.add(buttonLayout);*/
buttonLayout.setVisibility(View.VISIBLE);
}
@Override

View file

@ -2,17 +2,10 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="48dp"
android:id="@+id/more_info_bar"
android:id="@+id/more_info_button"
android:visibility="gone"
android:layout_gravity="bottom"
android:background="@color/default_circle_indicator_stroke_color"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/more_info_button"
android:text="More Info"
android:layout_marginLeft="16dp"
android:background="@color/default_circle_indicator_stroke_color"
/>
</LinearLayout>

View file

@ -148,9 +148,10 @@ Description Description Description
Description Description Description
" />
<FrameLayout
android:id="@+id/container_sheet"
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"></FrameLayout>
android:layout_height="48dp"
>
</View>
</LinearLayout>