Fix conflicts

This commit is contained in:
neslihanturan 2017-12-11 12:18:02 +03:00 committed by maskara
parent 7408d89abd
commit a5c5da8b14
2 changed files with 82 additions and 9 deletions

View file

@ -8,6 +8,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.v4.widget.SwipeRefreshLayout;
@ -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;
@ -50,6 +53,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
@ -61,6 +69,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;
@BindView(R.id.swipe_container) SwipeRefreshLayout swipeLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -69,6 +79,10 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
setContentView(R.layout.activity_nearby);
ButterKnife.bind(this);
bundle = new Bundle();
initBottomSheetBehaviour();
initFabList();
initDrawer();
initViewState();
swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@ -88,6 +102,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,7 +4,12 @@
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">
@ -35,9 +40,34 @@
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</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.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"