forked from organicmaps/organicmaps
[android] move navigation search button under fade view.
This commit is contained in:
parent
f173aacda0
commit
98331ac9b0
8 changed files with 30 additions and 6 deletions
|
@ -32,6 +32,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<include layout="@layout/layout_nav_search"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/search_button_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:theme="?navButtonsTheme"
|
||||
android:layout_marginBottom="@dimen/nav_menu_height"
|
||||
tools:background="@color/bg_primary"
|
||||
tools:showIn="@layout/layout_nav">
|
||||
tools:showIn="@layout/activity_map">
|
||||
|
||||
<View
|
||||
android:id="@+id/touch_interceptor"
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<include layout="@layout/layout_nav_search"
|
||||
android:visibility="gone"
|
||||
tools:visibility="invisible"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<include layout="@layout/layout_nav_search"
|
||||
android:visibility="gone"
|
||||
tools:visibility="invisible"/>
|
||||
|
||||
<com.mapswithme.maps.widget.FadeView
|
||||
android:id="@+id/fade_view"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -9,7 +9,5 @@
|
|||
|
||||
<include layout="@layout/layout_nav_top"/>
|
||||
|
||||
<include layout="@layout/layout_nav_search"/>
|
||||
|
||||
<include layout="@layout/layout_nav_bottom"/>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/search_button_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:theme="?navButtonsTheme"
|
||||
tools:background="@color/bg_primary"
|
||||
tools:showIn="@layout/layout_nav">
|
||||
tools:showIn="@layout/activity_map">
|
||||
|
||||
<Space
|
||||
android:id="@id/anchor_center"
|
||||
|
|
|
@ -37,6 +37,7 @@ public class NavigationController
|
|||
|
||||
private final View mFrame;
|
||||
private final View mBottomFrame;
|
||||
private final View mSearchButtonFrame;
|
||||
private final NavMenu mNavMenu;
|
||||
|
||||
private final ImageView mNextTurnImage;
|
||||
|
@ -110,7 +111,8 @@ public class NavigationController
|
|||
mDistanceUnits = (TextView) mBottomFrame.findViewById(R.id.distance_dimen);
|
||||
mRouteProgress = (FlatProgressView) mBottomFrame.findViewById(R.id.navigation_progress);
|
||||
|
||||
mSearchWheel = new SearchWheel(mFrame);
|
||||
mSearchButtonFrame = activity.findViewById(R.id.search_button_frame);
|
||||
mSearchWheel = new SearchWheel(mSearchButtonFrame);
|
||||
}
|
||||
|
||||
public void onResume()
|
||||
|
@ -278,6 +280,7 @@ public class NavigationController
|
|||
public void show(boolean show)
|
||||
{
|
||||
UiUtils.showIf(show, mFrame);
|
||||
UiUtils.showIf(show, mSearchButtonFrame);
|
||||
mNavMenu.show(show);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,13 @@ package com.mapswithme.maps.routing;
|
|||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorInflater;
|
||||
import android.content.Context;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.IdRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ImageView;
|
||||
|
@ -223,7 +225,14 @@ class SearchWheel implements View.OnClickListener
|
|||
|
||||
private void showSearchInParent()
|
||||
{
|
||||
final MwmActivity parent = (MwmActivity) mFrame.getContext();
|
||||
Context context = mFrame.getContext();
|
||||
final MwmActivity parent;
|
||||
if (context instanceof ContextThemeWrapper)
|
||||
parent = (MwmActivity)((ContextThemeWrapper)context).getBaseContext();
|
||||
else if (context instanceof android.support.v7.internal.view.ContextThemeWrapper)
|
||||
parent = (MwmActivity)((android.support.v7.internal.view.ContextThemeWrapper)context).getBaseContext();
|
||||
else
|
||||
parent = (MwmActivity) context;
|
||||
parent.showSearch();
|
||||
mIsExpanded = false;
|
||||
refreshSearchVisibility();
|
||||
|
|
Loading…
Add table
Reference in a new issue