Fix conflicts

This commit is contained in:
neslihanturan 2017-12-11 12:18:02 +03:00
parent 32bca87305
commit 0fe5547e55
2 changed files with 98 additions and 25 deletions

View file

@ -9,6 +9,8 @@ import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AlertDialog;
@ -16,6 +18,7 @@ import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Toast;
@ -52,6 +55,11 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
@BindView(R.id.progressBar)
ProgressBar progressBar;
@BindView(R.id.bottom_sheet)
LinearLayout bottomSheet;
@BindView(R.id.fab_list)
FloatingActionButton fabList;
@Inject
LocationServiceManager locationManager;
@Inject
@ -63,6 +71,7 @@ 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;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -71,6 +80,10 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
setContentView(R.layout.activity_nearby);
ButterKnife.bind(this);
bundle = new Bundle();
initBottomSheetBehaviour();
initFabList();
initDrawer();
initViewState();
}
@ -83,6 +96,35 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
}
}
private void initBottomSheetBehaviour() {
bottomSheet.getLayoutParams().height = getWindowManager()
.getDefaultDisplay().getHeight() / 16 * 9;
bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
// TODO initProperBottomSheetBehavior();
bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(View bottomSheet, int newState) {
// TODO prepareViewsForSheetPosition(newState);
}
@Override
public void onSlide(View bottomSheet, float slideOffset) {
}
});
}
private void initFabList() {
fabList.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//nearbyMapFragment.bottomSheetDetailsBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();

View file

@ -4,39 +4,70 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
<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">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent">
<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"
<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
android:layout_height="wrap_content" />
<FrameLayout
android:id="@+id/container"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_below="@id/toolbar">
</LinearLayout>
</RelativeLayout>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<android.support.design.widget.NavigationView
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_list"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignBottom="@id/toolbar"
android:layout_alignParentRight="true"
android:layout_marginRight="28dp"
android:layout_marginBottom="-96dp"
android:visibility="invisible"
app:elevation="6dp"
app:pressedTranslationZ="12dp"
android:backgroundTint="@color/cardview_light_background"
android:clickable="true"
/>
<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"
/>
</RelativeLayout>
<include layout="@layout/bottom_sheet_nearby" />
</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"