forked from organicmaps/organicmaps
[android] Added fake elevation in the filter panel for pre lollipop devices.
This commit is contained in:
parent
9ece1f5593
commit
eee3a89b99
2 changed files with 15 additions and 2 deletions
android
|
@ -28,6 +28,13 @@
|
|||
android:layout_height="?attr/actionBarSize"/>
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
<include layout="@layout/search_filter_panel"/>
|
||||
<FrameLayout
|
||||
android:id="@+id/filter_elevation"
|
||||
style="@style/MwmWidget.FrameLayout.Elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?cardBackground"
|
||||
android:visibility="gone"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.mapswithme.maps.search;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
@ -150,6 +151,7 @@ public class SearchFragment extends BaseMwmFragment
|
|||
private PlaceholderView mResultsPlaceholder;
|
||||
private RecyclerView mResults;
|
||||
private AppBarLayout mAppBarLayout;
|
||||
private View mFilterElevation;
|
||||
@Nullable
|
||||
private SearchFilterController mFilterController;
|
||||
|
||||
|
@ -195,8 +197,10 @@ public class SearchFragment extends BaseMwmFragment
|
|||
if (mFilterController == null)
|
||||
return;
|
||||
|
||||
mFilterController.showDivider(
|
||||
!(Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()));
|
||||
boolean show = !(Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange());
|
||||
mFilterController.showDivider(show);
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||
UiUtils.showIf(!show, mFilterElevation);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -296,6 +300,8 @@ public class SearchFragment extends BaseMwmFragment
|
|||
mResultsPlaceholder.setContent(R.drawable.img_search_nothing_found_light,
|
||||
R.string.search_not_found, R.string.search_not_found_query);
|
||||
|
||||
mFilterElevation = view.findViewById(R.id.filter_elevation);
|
||||
|
||||
mFilterController = new SearchFilterController(root.findViewById(R.id.filter_frame),
|
||||
(HotelsFilterView) view.findViewById(R.id.filter),
|
||||
new SearchFilterController.DefaultFilterListener()
|
||||
|
|
Loading…
Add table
Reference in a new issue