forked from organicmaps/organicmaps
[android] Added filter controls container in existing search toolbar
This commit is contained in:
parent
d07008b98a
commit
2166315e87
7 changed files with 49 additions and 24 deletions
|
@ -34,9 +34,9 @@
|
|||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar_with_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/search_box_height"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
tools:visibility="visible" />
|
||||
|
||||
<include layout="@layout/layout_nav_search"
|
||||
android:visibility="gone"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar_with_search_no_elevation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
<include layout="@layout/search_filter_panel"/>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
|
8
android/res/layout/toolbar_filter_controls.xml
Normal file
8
android/res/layout/toolbar_filter_controls.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<!-- Coming soon!-->
|
||||
</LinearLayout>
|
|
@ -4,11 +4,20 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="?attr/actionBarSize"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="?homeAsUpIndicator"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_down" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/query"
|
||||
style="@style/MwmTextAppearance.Toolbar.Search"
|
||||
|
@ -30,7 +39,6 @@
|
|||
android:layout_width="@dimen/search_progress_size"
|
||||
android:layout_height="@dimen/search_progress_size"
|
||||
android:layout_marginEnd="@dimen/margin_half"
|
||||
android:layout_marginRight="@dimen/margin_half"
|
||||
android:layout_weight="0"
|
||||
android:background="@null"
|
||||
android:minHeight="@dimen/search_progress_size"
|
||||
|
|
|
@ -1,10 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme"
|
||||
app:contentInsetLeft="@dimen/dp_0"
|
||||
app:contentInsetStart="@dimen/dp_0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize">
|
||||
<include layout="@layout/toolbar_search_controls"/>
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/toolbar_search_controls" />
|
||||
<include layout="@layout/toolbar_filter_controls" />
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
|
|
@ -1,10 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MwmWidget.ToolbarStyle.NoElevation"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme"
|
||||
app:contentInsetLeft="@dimen/dp_0"
|
||||
app:contentInsetStart="@dimen/dp_0"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize">
|
||||
<include layout="@layout/toolbar_search_controls"/>
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/toolbar_search_controls" />
|
||||
<include layout="@layout/toolbar_filter_controls" />
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
|
|
@ -413,11 +413,14 @@ public final class UiUtils
|
|||
|
||||
public static void extendViewWithStatusBar(@NonNull View view)
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
|
||||
return;
|
||||
|
||||
int statusBarHeight = getStatusBarHeight(view.getContext());
|
||||
ViewGroup.LayoutParams lp = view.getLayoutParams();
|
||||
if (lp.height == ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
{
|
||||
extendViewPaddingTop(view, statusBarHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
lp.height += statusBarHeight;
|
||||
view.setLayoutParams(lp);
|
||||
extendViewPaddingTop(view, statusBarHeight);
|
||||
|
@ -425,9 +428,6 @@ public final class UiUtils
|
|||
|
||||
public static void extendViewPaddingWithStatusBar(@NonNull View view)
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
|
||||
return;
|
||||
|
||||
int statusBarHeight = getStatusBarHeight(view.getContext());
|
||||
extendViewPaddingTop(view, statusBarHeight);
|
||||
}
|
||||
|
@ -440,9 +440,6 @@ public final class UiUtils
|
|||
|
||||
public static void extendViewMarginWithStatusBar(@NonNull View view)
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
|
||||
return;
|
||||
|
||||
int statusBarHeight = getStatusBarHeight(view.getContext());
|
||||
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
|
||||
int margin = lp.getMarginStart();
|
||||
|
@ -452,9 +449,6 @@ public final class UiUtils
|
|||
|
||||
public static void setupStatusBar(@NonNull Activity activity)
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
|
||||
return;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
{
|
||||
activity.getWindow().getDecorView().setSystemUiVisibility(
|
||||
|
@ -477,9 +471,6 @@ public final class UiUtils
|
|||
|
||||
public static void setupColorStatusBar(@NonNull Activity activity, @ColorRes int statusBarColor)
|
||||
{
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||
return;
|
||||
|
||||
Window window = activity.getWindow();
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
|
||||
window.setStatusBarColor(ContextCompat.getColor(activity, statusBarColor));
|
||||
|
|
Loading…
Add table
Reference in a new issue