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
7408d89abd
commit
a5c5da8b14
2 changed files with 82 additions and 9 deletions
|
|
@ -8,6 +8,8 @@ import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.NonNull;
|
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.Fragment;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
|
|
@ -16,6 +18,7 @@ import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
|
@ -50,6 +53,11 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
||||||
@BindView(R.id.progressBar)
|
@BindView(R.id.progressBar)
|
||||||
ProgressBar progressBar;
|
ProgressBar progressBar;
|
||||||
|
|
||||||
|
@BindView(R.id.bottom_sheet)
|
||||||
|
LinearLayout bottomSheet;
|
||||||
|
@BindView(R.id.fab_list)
|
||||||
|
FloatingActionButton fabList;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
LocationServiceManager locationManager;
|
LocationServiceManager locationManager;
|
||||||
@Inject
|
@Inject
|
||||||
|
|
@ -61,6 +69,8 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
||||||
private NearbyActivityMode viewMode;
|
private NearbyActivityMode viewMode;
|
||||||
private Disposable placesDisposable;
|
private Disposable placesDisposable;
|
||||||
private boolean lockNearbyView; //Determines if the nearby places needs to be refreshed
|
private boolean lockNearbyView; //Determines if the nearby places needs to be refreshed
|
||||||
|
private BottomSheetBehavior bottomSheetBehavior;
|
||||||
|
|
||||||
@BindView(R.id.swipe_container) SwipeRefreshLayout swipeLayout;
|
@BindView(R.id.swipe_container) SwipeRefreshLayout swipeLayout;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -69,6 +79,10 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
||||||
setContentView(R.layout.activity_nearby);
|
setContentView(R.layout.activity_nearby);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
bundle = new Bundle();
|
bundle = new Bundle();
|
||||||
|
|
||||||
|
initBottomSheetBehaviour();
|
||||||
|
initFabList();
|
||||||
|
|
||||||
initDrawer();
|
initDrawer();
|
||||||
initViewState();
|
initViewState();
|
||||||
swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
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
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuInflater inflater = getMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,12 @@
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="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
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
@ -35,9 +40,34 @@
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
</android.support.v4.widget.SwipeRefreshLayout>
|
</android.support.v4.widget.SwipeRefreshLayout>
|
||||||
</LinearLayout>
|
</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>
|
</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:id="@+id/navigation_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue