mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Fix conflicts
This commit is contained in:
parent
3a6cb08c05
commit
90cd6d2511
5 changed files with 50 additions and 36 deletions
|
|
@ -13,6 +13,7 @@ import android.support.design.widget.FloatingActionButton;
|
|||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
|
@ -54,6 +55,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)
|
||||
|
|
@ -70,7 +73,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
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -106,6 +110,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
|||
|
||||
@Override
|
||||
public void onStateChanged(View bottomSheet, int newState) {
|
||||
Log.d("Deneme","deneme"+newState);
|
||||
prepareViewsForSheetPosition(newState);
|
||||
}
|
||||
|
||||
|
|
@ -114,13 +119,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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -279,12 +281,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
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;
|
||||
|
|
@ -292,20 +289,33 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
|
|||
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) {
|
||||
closeFabs(isFabOpen);
|
||||
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();
|
||||
CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fabPlus
|
||||
.getLayoutParams();
|
||||
p.setAnchorId(View.NO_ID);
|
||||
fabPlus.setLayoutParams(p);
|
||||
fabPlus.hide();
|
||||
moreInfo.setVisibility(View.GONE);
|
||||
}
|
||||
//currBottomSheetState = bottomSheetState;
|
||||
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue