Merge pull request #44 from trashkalmar/android-release-511
[android] Release 5.1.1 fixes
|
@ -3,7 +3,7 @@ propMinSdkVersion=15
|
|||
# https://code.google.com/p/android/issues/detail?id=184567
|
||||
propTargetSdkVersion=22
|
||||
propBuildToolsVersion=22.0.1
|
||||
propVersionCode=510
|
||||
propVersionName=5.1
|
||||
propVersionCode=511
|
||||
propVersionName=5.1.1
|
||||
propDebugNdkFlags=V=1 NDK_DEBUG=1 DEBUG=1
|
||||
propReleaseNdkFlags=V=1 NDK_DEBUG=0 PRODUCTION=1
|
||||
|
|
|
@ -87,25 +87,12 @@ namespace jni
|
|||
return mid;
|
||||
}
|
||||
|
||||
// @TODO uncomment, test & use?
|
||||
/*
|
||||
jobject CreateJavaObject(JNIEnv * env, char const * klassName, char const * sig, ...)
|
||||
jclass GetGlobalClassRef(JNIEnv * env, char const * sig)
|
||||
{
|
||||
jclass klass = env->FindClass(klassName);
|
||||
ASSERT(klass, ("Can't find java class", klassName));
|
||||
|
||||
jmethodID methodId = env->GetMethodID(klass, "<init>", sig);
|
||||
ASSERT(methodId, ("Can't find java constructor", sig));
|
||||
|
||||
va_list args;
|
||||
va_start(args, sig);
|
||||
jobject res = env->NewObject(klass, methodId, args);
|
||||
ASSERT(res, ());
|
||||
va_end(args);
|
||||
|
||||
return res;
|
||||
jclass klass = env->FindClass(sig);
|
||||
ASSERT(klass, ("Can't get class : ", DescribeException()));
|
||||
return static_cast<jclass>(env->NewGlobalRef(klass));
|
||||
}
|
||||
*/
|
||||
|
||||
string ToNativeString(JNIEnv * env, jstring str)
|
||||
{
|
||||
|
|
|
@ -12,17 +12,13 @@ extern jclass g_indexClazz;
|
|||
|
||||
namespace jni
|
||||
{
|
||||
// jclass FindClass(char const * name);
|
||||
// TODO yunitsky uncomment and use to load classes from native threads.
|
||||
// jclass FindClass(char const * name);
|
||||
|
||||
/// @name Some examples of signature:
|
||||
/// "()V" - void function returning void;
|
||||
/// "(Ljava/lang/String;)V" - String function returning void;
|
||||
/// "com/mapswithme/maps/MapStorage$Index" - class MapStorage.Index
|
||||
//@{
|
||||
jmethodID GetJavaMethodID(JNIEnv * env, jobject obj, char const * fn, char const * sig);
|
||||
|
||||
//jobject CreateJavaObject(JNIEnv * env, char const * klass, char const * sig, ...);
|
||||
//@}
|
||||
// Result value should be DeleteGlobalRef`ed by caller
|
||||
jclass GetGlobalClassRef(JNIEnv * env, char const * s);
|
||||
|
||||
JNIEnv * GetEnv();
|
||||
JavaVM * GetJVM();
|
||||
|
|
|
@ -1028,10 +1028,9 @@ extern "C"
|
|||
double azimut = -1.0;
|
||||
frm()->GetDistanceAndAzimut(m2::PointD(merX, merY), cLat, cLon, north, distance, azimut);
|
||||
|
||||
jclass daClazz = env->FindClass("com/mapswithme/maps/bookmarks/data/DistanceAndAzimut");
|
||||
ASSERT ( daClazz, () );
|
||||
|
||||
jmethodID methodID = env->GetMethodID(daClazz, "<init>", "(Ljava/lang/String;D)V");
|
||||
static jclass const daClazz = jni::GetGlobalClassRef(env, "com/mapswithme/maps/bookmarks/data/DistanceAndAzimut");
|
||||
// Java signature : DistanceAndAzimut(String distance, double azimuth)
|
||||
static jmethodID const methodID = env->GetMethodID(daClazz, "<init>", "(Ljava/lang/String;D)V");
|
||||
ASSERT ( methodID, () );
|
||||
|
||||
return env->NewObject(daClazz, methodID,
|
||||
|
@ -1066,7 +1065,7 @@ extern "C"
|
|||
else
|
||||
MeasurementUtils::FormatLatLon(lat, lon, slat, slon, 6);
|
||||
|
||||
jclass klass = env->FindClass("java/lang/String");
|
||||
static jclass const klass = jni::GetGlobalClassRef(env, "java/lang/String");
|
||||
jobjectArray arr = env->NewObjectArray(2, klass, 0);
|
||||
|
||||
env->SetObjectArrayElement(arr, 0, jni::ToJavaString(env, slat));
|
||||
|
@ -1302,32 +1301,27 @@ extern "C"
|
|||
if (!info.IsValid())
|
||||
return nullptr;
|
||||
|
||||
static shared_ptr<jobject> klassPtr = jni::make_global_ref(env->FindClass("com/mapswithme/maps/routing/RoutingInfo"));
|
||||
ASSERT(klassPtr, (jni::DescribeException()));
|
||||
jclass const klass = static_cast<jclass>(*klassPtr.get());
|
||||
|
||||
static jclass const klass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/routing/RoutingInfo");
|
||||
// Java signature : RoutingInfo(String distToTarget, String units, String distTurn, String turnSuffix, String currentStreet, String nextStreet,
|
||||
// double completionPercent, int vehicleTurnOrdinal, int vehicleNextTurnOrdinal, int pedestrianTurnOrdinal,
|
||||
// double pedestrianDirectionLat, double pedestrianDirectionLon, int exitNum, int totalTime, SingleLaneInfo[] lanes)
|
||||
static jmethodID const ctorRouteInfoID =
|
||||
env->GetMethodID(klass, "<init>",
|
||||
"(Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;Ljava/lang/String;DIIDDII"
|
||||
"[Lcom/mapswithme/maps/routing/SingleLaneInfo;)V");
|
||||
"(Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;Ljava/lang/String;"
|
||||
"Ljava/lang/String;Ljava/lang/String;DIIIDDII"
|
||||
"[Lcom/mapswithme/maps/routing/SingleLaneInfo;)V");
|
||||
ASSERT(ctorRouteInfoID, (jni::DescribeException()));
|
||||
|
||||
vector<location::FollowingInfo::SingleLaneInfoClient> const & lanes = info.m_lanes;
|
||||
jobjectArray jLanes = nullptr;
|
||||
if (!lanes.empty())
|
||||
{
|
||||
// A new java array of SingleLaneInfo classes for lane information is allocated here.
|
||||
// Then it will be saved in com.mapswithme.maps.LocationState, and then removed by java GC.
|
||||
jclass const singleLaneInfoClass =
|
||||
env->FindClass("com/mapswithme/maps/routing/SingleLaneInfo");
|
||||
ASSERT(singleLaneInfoClass, (jni::DescribeException()));
|
||||
static jclass const laneClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/routing/SingleLaneInfo");
|
||||
size_t const lanesSize = lanes.size();
|
||||
jLanes = env->NewObjectArray(lanesSize, singleLaneInfoClass, nullptr);
|
||||
jLanes = env->NewObjectArray(lanesSize, laneClass, nullptr);
|
||||
ASSERT(jLanes, (jni::DescribeException()));
|
||||
static jmethodID const ctorSingleLaneInfoID =
|
||||
env->GetMethodID(singleLaneInfoClass, "<init>", "([BZ)V");
|
||||
static jmethodID const ctorSingleLaneInfoID = env->GetMethodID(laneClass, "<init>", "([BZ)V");
|
||||
ASSERT(ctorSingleLaneInfoID, (jni::DescribeException()));
|
||||
|
||||
jbyteArray singleLane = nullptr;
|
||||
|
@ -1339,8 +1333,7 @@ extern "C"
|
|||
singleLane = env->NewByteArray(laneSize);
|
||||
ASSERT(singleLane, (jni::DescribeException()));
|
||||
env->SetByteArrayRegion(singleLane, 0, laneSize, lanes[j].m_lane.data());
|
||||
singleLaneInfo = env->NewObject(singleLaneInfoClass, ctorSingleLaneInfoID, singleLane,
|
||||
lanes[j].m_isRecommended);
|
||||
singleLaneInfo = env->NewObject(laneClass, ctorSingleLaneInfoID, singleLane, lanes[j].m_isRecommended);
|
||||
ASSERT(singleLaneInfo, (jni::DescribeException()));
|
||||
env->SetObjectArrayElement(jLanes, j, singleLaneInfo);
|
||||
env->DeleteLocalRef(singleLaneInfo);
|
||||
|
@ -1352,7 +1345,7 @@ extern "C"
|
|||
klass, ctorRouteInfoID, jni::ToJavaString(env, info.m_distToTarget),
|
||||
jni::ToJavaString(env, info.m_targetUnitsSuffix), jni::ToJavaString(env, info.m_distToTurn),
|
||||
jni::ToJavaString(env, info.m_turnUnitsSuffix), jni::ToJavaString(env, info.m_sourceName),
|
||||
jni::ToJavaString(env, info.m_targetName), info.m_completionPercent ,info.m_turn, info.m_pedestrianTurn,
|
||||
jni::ToJavaString(env, info.m_targetName), info.m_completionPercent, info.m_turn, info.m_nextTurn, info.m_pedestrianTurn,
|
||||
info.m_pedestrianDirectionPos.lat, info.m_pedestrianDirectionPos.lon, info.m_exitNum, info.m_time, jLanes);
|
||||
ASSERT(result, (jni::DescribeException()));
|
||||
return result;
|
||||
|
@ -1363,13 +1356,12 @@ extern "C"
|
|||
{
|
||||
PoiMarkPoint const * poiMark = frm()->GetAddressMark(MercatorBounds::FromLatLon(lat, lon));
|
||||
|
||||
jclass klass = env->FindClass("com/mapswithme/maps/bookmarks/data/MapObject$Poi");
|
||||
static jclass const klass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/bookmarks/data/MapObject$Poi");
|
||||
// Java signature : Poi(String name, double lat, double lon, String typeName)
|
||||
static jmethodID const methodID = env->GetMethodID(klass, "<init>", "(Ljava/lang/String;DDLjava/lang/String;)V");
|
||||
|
||||
jobject const mapObject = env->NewObject(klass, methodID,
|
||||
jni::ToJavaString(env, poiMark->GetInfo().GetPinName()),
|
||||
lat, lon,
|
||||
jni::ToJavaString(env, poiMark->GetInfo().GetPinType()));
|
||||
jobject const mapObject = env->NewObject(klass, methodID, jni::ToJavaString(env, poiMark->GetInfo().GetPinName()),
|
||||
lat, lon, jni::ToJavaString(env, poiMark->GetInfo().GetPinType()));
|
||||
ASSERT(mapObject, ());
|
||||
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ jobject ToJavaResult(Result result, bool hasPosition, double lat, double lon)
|
|||
jstring name = jni::ToJavaString(env, result.GetString());
|
||||
jobject ret = env->NewObject(g_resultClass, g_resultConstructor, name, desc, ranges);
|
||||
ASSERT(ret, ());
|
||||
env->DeleteLocalRef(name);
|
||||
env->DeleteLocalRef(desc);
|
||||
env->DeleteLocalRef(ranges);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/base_light_blue"
|
||||
<item android:color="@color/base_blue_light"
|
||||
android:state_selected="true"/>
|
||||
|
||||
<item android:color="@color/text_dark_subtitle"/>
|
||||
</selector>
|
||||
</selector>
|
||||
|
|
BIN
android/res/drawable-hdpi/ic_search_recent.png
Normal file
After Width: | Height: | Size: 460 B |
BIN
android/res/drawable-hdpi/ic_search_suggest.png
Normal file
After Width: | Height: | Size: 458 B |
BIN
android/res/drawable-mdpi/ic_search_recent.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
android/res/drawable-mdpi/ic_search_suggest.png
Normal file
After Width: | Height: | Size: 334 B |
|
@ -3,5 +3,5 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?colorControlHighlight">
|
||||
|
||||
<item android:drawable="@color/base_light_blue"/>
|
||||
<item android:drawable="@color/base_blue_light"/>
|
||||
</ripple>
|
BIN
android/res/drawable-xhdpi/ic_search_recent.png
Normal file
After Width: | Height: | Size: 519 B |
BIN
android/res/drawable-xhdpi/ic_search_suggest.png
Normal file
After Width: | Height: | Size: 566 B |
BIN
android/res/drawable-xxhdpi/ic_search_recent.png
Normal file
After Width: | Height: | Size: 826 B |
BIN
android/res/drawable-xxhdpi/ic_search_suggest.png
Normal file
After Width: | Height: | Size: 854 B |
BIN
android/res/drawable-xxxhdpi/ic_search_recent.png
Normal file
After Width: | Height: | Size: 968 B |
BIN
android/res/drawable-xxxhdpi/ic_search_suggest.png
Normal file
After Width: | Height: | Size: 1 KiB |
9
android/res/drawable/bg_next_turn.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/margin_base_plus"/>
|
||||
<solid android:color="@color/base_black_hint"/>
|
||||
|
||||
</shape>
|
|
@ -2,6 +2,6 @@
|
|||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/base_blue" android:state_pressed="true"/>
|
||||
<item android:drawable="@color/base_blue" android:state_focused="true"/>
|
||||
<item android:drawable="@color/base_light_blue"/>
|
||||
<item android:drawable="@color/base_blue_light"/>
|
||||
|
||||
</selector>
|
|
@ -5,6 +5,8 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/bg_top_panels"
|
||||
android:elevation="@dimen/appbar_elevation"
|
||||
android:paddingTop="@dimen/margin_eighth">
|
||||
|
||||
<com.mapswithme.maps.widget.FlatProgressView
|
||||
|
@ -67,8 +69,8 @@
|
|||
android:id="@+id/tv__total_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/tv__turn_distance"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignTop="@id/tv__turn_distance"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/MwmTextAppearance.RoutingNumber"
|
||||
|
@ -78,8 +80,8 @@
|
|||
android:id="@+id/tv__arrival_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/tv__total_time"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/tv__total_time"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginTop="@dimen/margin_eighth"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -90,10 +92,10 @@
|
|||
android:id="@+id/tv__total_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_alignTop="@id/tv__arrival_time"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_toLeftOf="@id/tv__arrival_time"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/MwmTextAppearance.RoutingNumber"
|
||||
tools:text="1.4 km"/>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -4,16 +4,14 @@
|
|||
android:id="@+id/pp__preview"
|
||||
layout="@layout/place_page_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_place_page_back"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/pp__details_frame"
|
||||
layout="@layout/place_page_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/pp__preview"
|
||||
android:background="@color/bg_top_panels"/>
|
||||
android:layout_below="@id/pp__preview"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/pp__buttons"
|
||||
|
@ -22,4 +20,4 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/pp__details_frame"/>
|
||||
|
||||
</merge>
|
||||
</merge>
|
||||
|
|
|
@ -14,26 +14,28 @@
|
|||
android:id="@+id/navigation_buttons"
|
||||
layout="@layout/map_navigation_buttons"/>
|
||||
|
||||
<LinearLayout android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/margin_base"
|
||||
android:clipToPadding="false"
|
||||
android:layout_toRightOf="@+id/fragment_container"
|
||||
android:layout_alignWithParentIfMissing="true">
|
||||
<include android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar_with_search"
|
||||
android:layout_width="@dimen/panel_width"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_marginBottom="@dimen/margin_base"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_toRightOf="@+id/fragment_container"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/margin_base">
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
layout="@layout/toolbar_with_search"
|
||||
android:layout_width="@dimen/panel_width"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_marginBottom="@dimen/margin_base"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<com.mapswithme.maps.widget.RoutingLayout
|
||||
android:id="@+id/layout__routing"
|
||||
android:layout_width="@dimen/panel_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/margin_base"/>
|
||||
android:paddingBottom="@dimen/margin_base"/>
|
||||
|
||||
<com.mapswithme.maps.widget.placepage.PlacePageView
|
||||
android:id="@+id/info_box"
|
||||
|
@ -67,4 +69,4 @@
|
|||
android:elevation="@dimen/navigation_elevation"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/bg_top_panels"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="@dimen/appbar_elevation">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/time_distance"
|
||||
|
@ -74,4 +76,4 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/fp__route_progress"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -21,7 +21,8 @@
|
|||
android:id="@+id/layout__routing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"/>
|
||||
android:layout_below="@id/toolbar"
|
||||
android:paddingBottom="@dimen/margin_base"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/navigation_buttons"
|
||||
|
@ -34,11 +35,12 @@
|
|||
android:background="@android:color/black"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<include android:id="@+id/menu_frame"
|
||||
layout="@layout/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
<include
|
||||
android:id="@+id/menu_frame"
|
||||
layout="@layout/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"/>
|
||||
|
||||
<com.mapswithme.maps.widget.placepage.PlacePageView
|
||||
android:id="@+id/info_box"
|
||||
|
@ -46,4 +48,4 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
placePage:animationType="bottom"/>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -17,20 +17,24 @@
|
|||
android:id="@+id/divider_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_below="@id/tv__message"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
|
||||
<ExpandableListView
|
||||
android:id="@+id/elv__items"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/divider_top"
|
||||
android:background="@color/base_bg_secondary"
|
||||
android:listSelector="?attr/clickableBackground"/>
|
||||
android:listSelector="?attr/clickableBackground"
|
||||
android:drawSelectorOnTop="true"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:layout_below="@id/elv__items"
|
||||
android:background="?android:attr/listDivider"/>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -15,20 +15,17 @@
|
|||
android:textAppearance="@style/MwmTextAppearance.Body2"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerHorizontal"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/item"
|
||||
layout="@layout/item_country_dialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/base_bg_secondary"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerHorizontal"/>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:layout_height="@dimen/tabs_height"
|
||||
android:background="@android:color/white"
|
||||
android:elevation="@dimen/appbar_elevation"
|
||||
app:tabIndicatorColor="@color/base_light_blue"
|
||||
app:tabIndicatorColor="@color/base_blue_light"
|
||||
app:tabMode="fixed"
|
||||
app:tabGravity="fill"/>
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -9,22 +10,20 @@
|
|||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
tools:text="Country name"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/margin_base_plus"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:visibility="gone"/>
|
||||
|
||||
tools:text="256 MB"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
android:id="@+id/item"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
|
@ -9,24 +10,24 @@
|
|||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textColor="@color/text_green"/>
|
||||
android:textColor="@color/text_green"
|
||||
tools:text="Country name"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:layout_marginRight="@dimen/margin_base_plus"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textColor="@color/text_green"/>
|
||||
|
||||
android:textColor="@color/text_green"
|
||||
tools:text="256 MB"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,5 @@
|
|||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/MwmWidget.TextView.Search"
|
||||
android:text="@string/search_show_on_map"
|
||||
android:textColor="@color/text_green"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textAllCaps="true"/>
|
||||
android:textColor="@color/base_blue_light"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"/>
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
style="@style/MwmWidget.TextView.Search"
|
||||
android:drawableLeft="@drawable/ic_show"
|
||||
android:drawableLeft="@drawable/ic_search_recent"
|
||||
tools:text="Some recent query"/>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:layout_below="@id/closed"
|
||||
android:gravity="bottom"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:textColor="@color/base_light_blue"
|
||||
android:textColor="@color/base_blue_light"
|
||||
tools:text="500 km \u2022 \u2605\u2606\u2606\u2606\u2606"/>
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
style="@style/MwmWidget.TextView.Search"
|
||||
android:textColor="@color/base_light_blue"
|
||||
android:drawableLeft="@drawable/ic_menu_search"
|
||||
android:textColor="@color/base_blue_light"
|
||||
android:drawableLeft="@drawable/ic_search_suggest"
|
||||
tools:text="Some suggest title"/>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<merge
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<include
|
||||
android:id="@+id/layout__routing_setup"
|
||||
|
@ -8,6 +10,43 @@
|
|||
<include
|
||||
android:id="@+id/layout__turn_instructions"
|
||||
layout="@layout/layout_turn_instructions"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
</merge>
|
||||
<LinearLayout
|
||||
android:id="@+id/next_turn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/layout__turn_instructions"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:background="@drawable/bg_next_turn"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="@dimen/margin_quarter"
|
||||
android:paddingLeft="@dimen/margin_base"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingTop="@dimen/margin_quarter"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__next_turn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/margin_quarter"
|
||||
android:text="@string/next_turn_then"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/text_size_toolbar"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv__next_turn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/next_turn_then"
|
||||
tools:src="@drawable/ic_round_then"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</merge>
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:wheel="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/MwmWidget.Floating.Panel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
android:elevation="@dimen/appbar_elevation">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/content"
|
||||
|
@ -22,9 +23,9 @@
|
|||
android:layout_height="@dimen/base_block_size"
|
||||
android:layout_margin="@dimen/margin_quarter"
|
||||
android:layout_weight="0"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/margin_quarter"
|
||||
android:visibility="gone"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
wheel:centerDrawable="@drawable/ic_close"
|
||||
wheel:wheelProgressColor="@color/routing_blue"
|
||||
wheel:wheelSecondaryColor="@color/base_black_divider"
|
||||
|
@ -48,8 +49,8 @@
|
|||
android:lines="1"
|
||||
android:text="@string/routing_planning"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
tools:visibility="gone"
|
||||
tools:text="Planning route..."/>
|
||||
tools:text="Planning route..."
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__routing_distance"
|
||||
|
@ -60,8 +61,8 @@
|
|||
android:layout_weight="0"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:text="38 km"/>
|
||||
tools:text="38 km"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__routing_time"
|
||||
|
@ -72,8 +73,8 @@
|
|||
android:layout_weight="1"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:text="16 min"/>
|
||||
tools:text="16 min"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg__router"
|
||||
|
@ -108,4 +109,4 @@
|
|||
android:textAllCaps="true"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3.Light"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/bg_top_panels"
|
||||
android:layout_width="match_parent"
|
||||
android:elevation="@dimen/appbar_elevation"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -71,4 +73,4 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/fp__route_progress"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/pp__buttons"
|
||||
android:layout_marginTop="56dp"/>
|
||||
android:layout_marginTop="56dp"
|
||||
android:background="@color/bg_top_panels"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/pp__buttons"
|
||||
|
@ -28,4 +29,4 @@
|
|||
layout="@layout/toolbar_elevated"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</merge>
|
||||
</merge>
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
android:id="@+id/pp__details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_top_panels"
|
||||
android:overScrollMode="never">
|
||||
<LinearLayout
|
||||
android:id="@+id/rl__place_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/bg_top_panels"
|
||||
android:paddingLeft="@dimen/margin_base_plus"
|
||||
android:paddingRight="@dimen/margin_base_plus"
|
||||
android:paddingTop="@dimen/margin_base">
|
||||
|
@ -57,4 +57,4 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"/>
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<color name="base_black_hint">#8A000000</color>
|
||||
<color name="base_black_divider">#1E000000</color>
|
||||
<!-- other colors -->
|
||||
<color name="base_light_blue">#1E96F0</color>
|
||||
<color name="base_blue_light">#1E96F0</color>
|
||||
<color name="base_blue">#0569AF</color>
|
||||
<color name="base_red">#F54137</color>
|
||||
<color name="base_yellow">#FFCD00</color>
|
||||
|
|
|
@ -112,8 +112,7 @@
|
|||
|
||||
<style name="MwmWidget.Floating"/>
|
||||
|
||||
<style name="MwmWidget.Floating.Panel"
|
||||
parent="MwmWidget.Floating">
|
||||
<style name="MwmWidget.Floating.Panel">
|
||||
<item name="android:background">@color/bg_top_panels</item>
|
||||
</style>
|
||||
|
||||
|
@ -338,4 +337,4 @@
|
|||
|
||||
<!-- Text appearance -->
|
||||
|
||||
</resources>
|
||||
</resources>
|
||||
|
|
|
@ -295,11 +295,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
Framework.nativeSetRouteProgressListener(this);
|
||||
Framework.nativeSetBalloonListener(this);
|
||||
|
||||
processIntent(getIntent());
|
||||
|
||||
mLocationPredictor = new LocationPredictor(new Handler(), this);
|
||||
mSearchController = new FloatingSearchToolbarController(this);
|
||||
|
||||
mLocationPredictor = new LocationPredictor(new Handler(), this);
|
||||
processIntent(getIntent());
|
||||
SharingHelper.prepare();
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,11 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmDialogFragment implem
|
|||
final int category = BookmarkManager.INSTANCE.createCategory(name);
|
||||
mBookmark.setCategoryId(category);
|
||||
mAdapter.chooseItem(category);
|
||||
|
||||
if (mListener != null)
|
||||
mListener.onCategoryChanged(mBookmark.getBookmarkId(), category);
|
||||
dismiss();
|
||||
|
||||
Statistics.INSTANCE.trackGroupCreated();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ import android.support.annotation.NonNull;
|
|||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.ExpandableListAdapter;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.country.StorageOptions;
|
||||
import com.mapswithme.maps.MapStorage;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -148,9 +148,14 @@ public class RoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
@SuppressLint("InflateParams") final View countryView = getActivity().getLayoutInflater().
|
||||
inflate(R.layout.dialog_download_single_item, null);
|
||||
((TextView) countryView.findViewById(R.id.tv__title)).setText(MapStorage.INSTANCE.countryName(index));
|
||||
final String size = StringUtils.getFileSizeString(MapStorage.INSTANCE.countryRemoteSizeInBytes(index, option));
|
||||
UiUtils.setTextAndShow(((TextView) countryView.findViewById(R.id.tv__size)), size);
|
||||
UiUtils.setTextAndShow(((TextView) countryView.findViewById(R.id.tv__message)), message);
|
||||
((TextView) countryView.findViewById(R.id.tv__message)).setText(message);
|
||||
|
||||
final TextView szView = (TextView) countryView.findViewById(R.id.tv__size);
|
||||
szView.setText(StringUtils.getFileSizeString(MapStorage.INSTANCE.countryRemoteSizeInBytes(index, option)));
|
||||
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) szView.getLayoutParams();
|
||||
lp.rightMargin = 0;
|
||||
szView.setLayoutParams(lp);
|
||||
|
||||
return countryView;
|
||||
}
|
||||
|
||||
|
@ -221,7 +226,7 @@ public class RoutingErrorDialogFragment extends BaseMwmDialogFragment
|
|||
return new DisabledChildSimpleExpandableListAdapter(getActivity(),
|
||||
groupData,
|
||||
R.layout.item_country_group_dialog_expanded,
|
||||
R.layout.item_country_group_dialog,
|
||||
R.layout.item_country_dialog,
|
||||
new String[]{GROUP_NAME, GROUP_SIZE},
|
||||
new int[]{R.id.tv__title, R.id.tv__size},
|
||||
childData,
|
||||
|
|
|
@ -24,6 +24,7 @@ public class RoutingInfo
|
|||
public final double completionPercent;
|
||||
// For vehicle routing.
|
||||
public final VehicleTurnDirection vehicleTurnDirection;
|
||||
public final VehicleTurnDirection vehicleNextTurnDirection;
|
||||
public final int exitNum;
|
||||
public final SingleLaneInfo[] lanes;
|
||||
// For pedestrian routing.
|
||||
|
@ -35,32 +36,34 @@ public class RoutingInfo
|
|||
*/
|
||||
public enum VehicleTurnDirection
|
||||
{
|
||||
NO_TURN(R.drawable.ic_straight_light),
|
||||
GO_STRAIGHT(R.drawable.ic_straight_light),
|
||||
NO_TURN(R.drawable.ic_straight_light, 0),
|
||||
GO_STRAIGHT(R.drawable.ic_straight_light, 0),
|
||||
|
||||
TURN_RIGHT(R.drawable.ic_simple_right_light),
|
||||
TURN_SHARP_RIGHT(R.drawable.ic_sharp_right_light),
|
||||
TURN_SLIGHT_RIGHT(R.drawable.ic_slight_right_light),
|
||||
TURN_RIGHT(R.drawable.ic_simple_right_light, R.drawable.ic_simple_right_then),
|
||||
TURN_SHARP_RIGHT(R.drawable.ic_sharp_right_light, R.drawable.ic_sharp_right_then),
|
||||
TURN_SLIGHT_RIGHT(R.drawable.ic_slight_right_light, R.drawable.ic_slight_right_then),
|
||||
|
||||
TURN_LEFT(R.drawable.ic_simple_right_light),
|
||||
TURN_SHARP_LEFT(R.drawable.ic_sharp_right_light),
|
||||
TURN_SLIGHT_LEFT(R.drawable.ic_slight_right_light),
|
||||
TURN_LEFT(R.drawable.ic_simple_right_light, R.drawable.ic_simple_right_then),
|
||||
TURN_SHARP_LEFT(R.drawable.ic_sharp_right_light, R.drawable.ic_sharp_right_then),
|
||||
TURN_SLIGHT_LEFT(R.drawable.ic_slight_right_light, R.drawable.ic_slight_right_then),
|
||||
|
||||
U_TURN(R.drawable.ic_uturn_light),
|
||||
TAKE_THE_EXIT(R.drawable.ic_finish_point_light),
|
||||
U_TURN(R.drawable.ic_uturn_light, R.drawable.ic_uturn_then),
|
||||
TAKE_THE_EXIT(R.drawable.ic_finish_point_light, 0),
|
||||
|
||||
ENTER_ROUND_ABOUT(R.drawable.ic_round_light),
|
||||
LEAVE_ROUND_ABOUT(R.drawable.ic_round_light),
|
||||
STAY_ON_ROUND_ABOUT(R.drawable.ic_round_light),
|
||||
ENTER_ROUND_ABOUT(R.drawable.ic_round_light, R.drawable.ic_round_then),
|
||||
LEAVE_ROUND_ABOUT(R.drawable.ic_round_light, R.drawable.ic_round_then),
|
||||
STAY_ON_ROUND_ABOUT(R.drawable.ic_round_light, R.drawable.ic_round_then),
|
||||
|
||||
START_AT_THE_END_OF_STREET(0),
|
||||
REACHED_YOUR_DESTINATION(R.drawable.ic_finish_point_light);
|
||||
START_AT_THE_END_OF_STREET(0, 0),
|
||||
REACHED_YOUR_DESTINATION(R.drawable.ic_finish_point_light, 0);
|
||||
|
||||
private int mTurnRes;
|
||||
private final int mTurnRes;
|
||||
private final int mNextTurnRes;
|
||||
|
||||
VehicleTurnDirection(@DrawableRes int resId)
|
||||
VehicleTurnDirection(@DrawableRes int mainResId, @DrawableRes int nextResId)
|
||||
{
|
||||
mTurnRes = resId;
|
||||
mTurnRes = mainResId;
|
||||
mNextTurnRes = nextResId;
|
||||
}
|
||||
|
||||
public void setTurnDrawable(ImageView imageView)
|
||||
|
@ -70,6 +73,22 @@ public class RoutingInfo
|
|||
imageView.setScaleX(isLeftTurn(this) ? -1 : 1); // right turns are displayed as mirrored left turns.
|
||||
}
|
||||
|
||||
public void setNextTurnDrawable(ImageView imageView)
|
||||
{
|
||||
imageView.setImageResource(mNextTurnRes);
|
||||
imageView.setScaleX(isLeftTurn(this) ? -1 : 1); // right turns are displayed as mirrored left turns.
|
||||
}
|
||||
|
||||
public boolean containsTurn()
|
||||
{
|
||||
return mTurnRes != 0;
|
||||
}
|
||||
|
||||
public boolean containsNextTurn()
|
||||
{
|
||||
return mNextTurnRes != 0;
|
||||
}
|
||||
|
||||
public static boolean isLeftTurn(VehicleTurnDirection turn)
|
||||
{
|
||||
return turn == TURN_LEFT || turn == TURN_SHARP_LEFT || turn == TURN_SLIGHT_LEFT;
|
||||
|
@ -119,7 +138,7 @@ public class RoutingInfo
|
|||
}
|
||||
|
||||
public RoutingInfo(String distToTarget, String units, String distTurn, String turnSuffix, String currentStreet, String nextStreet, double completionPercent,
|
||||
int vehicleTurnOrdinal, int pedestrianTurnOrdinal, double pedestrianDirectionLat, double pedestrianDirectionLon, int exitNum,
|
||||
int vehicleTurnOrdinal, int vehicleNextTurnOrdinal, int pedestrianTurnOrdinal, double pedestrianDirectionLat, double pedestrianDirectionLon, int exitNum,
|
||||
int totalTime, SingleLaneInfo[] lanes)
|
||||
{
|
||||
this.distToTarget = distToTarget;
|
||||
|
@ -131,6 +150,7 @@ public class RoutingInfo
|
|||
this.totalTimeInSeconds = totalTime;
|
||||
this.completionPercent = completionPercent;
|
||||
this.vehicleTurnDirection = VehicleTurnDirection.values()[vehicleTurnOrdinal];
|
||||
this.vehicleNextTurnDirection = VehicleTurnDirection.values()[vehicleNextTurnOrdinal];
|
||||
this.lanes = lanes;
|
||||
this.exitNum = exitNum;
|
||||
this.pedestrianTurnDirection = PedestrianTurnDirection.values()[pedestrianTurnOrdinal];
|
||||
|
|
|
@ -260,9 +260,11 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.BaseViewHolder>
|
|||
}
|
||||
}
|
||||
|
||||
boolean showPopulateButton()
|
||||
private boolean showPopulateButton()
|
||||
{
|
||||
return (mResults != null && mResults.length > 0);
|
||||
return (mResults != null &&
|
||||
mResults.length > 0 &&
|
||||
mResults[0].type != SearchResult.TYPE_SUGGEST);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -293,4 +295,4 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.BaseViewHolder>
|
|||
mResults = results;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,9 +91,6 @@ public class SearchFragment extends BaseMwmFragment
|
|||
@Override
|
||||
protected boolean onStartSearchClick()
|
||||
{
|
||||
if (!mSearchAdapter.showPopulateButton())
|
||||
return false;
|
||||
|
||||
showAllResultsOnMap();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ public final class SearchRecents
|
|||
|
||||
public static boolean add(@NonNull String query)
|
||||
{
|
||||
query = query.trim();
|
||||
if (TextUtils.isEmpty(query) || sRecents.contains(query))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -13,11 +13,10 @@ import android.text.Spanned;
|
|||
import android.text.TextUtils;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
|
@ -38,7 +37,7 @@ import java.util.concurrent.TimeUnit;
|
|||
/**
|
||||
* Layout for routing setup & turn instruction box.
|
||||
*/
|
||||
public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
||||
public class RoutingLayout extends RelativeLayout implements View.OnClickListener
|
||||
{
|
||||
private static final String IS_ROUTING_DISCLAIMER_APPROVED = "IsDisclaimerApproved";
|
||||
|
||||
|
@ -49,6 +48,8 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
private TextView mTvTotalDistance;
|
||||
private TextView mTvTotalTime;
|
||||
private ImageView mIvTurn;
|
||||
private View mNextTurn;
|
||||
private ImageView mIvNextTurn;
|
||||
private TextView mTvTurnDistance;
|
||||
private TextView mTvPrepareDistance;
|
||||
private MapObject mEndPoint;
|
||||
|
@ -98,14 +99,12 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
public RoutingLayout(Context context, AttributeSet attrs, int defStyleAttr)
|
||||
{
|
||||
super(context, attrs, defStyleAttr);
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_routing_full, this);
|
||||
inflate(getContext(), R.layout.layout_routing_full, this);
|
||||
setClipToPadding(false);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
setElevation(UiUtils.dimen(R.dimen.appbar_elevation));
|
||||
|
||||
setBackgroundColor(getResources().getColor(R.color.bg_top_panels));
|
||||
setClipToPadding(false);
|
||||
|
||||
if (isInEditMode())
|
||||
return;
|
||||
|
||||
|
@ -146,6 +145,8 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
mTvTotalTime = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__total_time);
|
||||
mTvArrivalTime = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__arrival_time);
|
||||
mIvTurn = (ImageView) mLayoutTurnInstructions.findViewById(R.id.iv__turn);
|
||||
mNextTurn = findViewById(R.id.next_turn);
|
||||
mIvNextTurn = (ImageView) mNextTurn.findViewById(R.id.iv__next_turn);
|
||||
mTvTurnDistance = (TextView) mLayoutTurnInstructions.findViewById(R.id.tv__turn_distance);
|
||||
mLayoutTurnInstructions.findViewById(R.id.btn__close).setOnClickListener(this);
|
||||
mFpRouteProgress = (FlatProgressView) mLayoutTurnInstructions.findViewById(R.id.fp__route_progress);
|
||||
|
@ -214,6 +215,8 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
|
||||
Framework.nativeCloseRouting();
|
||||
UiUtils.show(mLayoutSetupRouting, mWvProgress, mTvPlanning);
|
||||
// TODO (marchuk): Uncomment after the second turn notification is fixed.
|
||||
// UiUtils.hide(mLayoutTurnInstructions, mTvPrepareDistance, mTvPrepareTime, mIvCancelRouteBuild, mNextTurn);
|
||||
UiUtils.hide(mLayoutTurnInstructions, mTvPrepareDistance, mTvPrepareTime, mIvCancelRouteBuild);
|
||||
mTvPlanning.setText(R.string.routing_planning);
|
||||
mWvProgress.setProgress(0);
|
||||
|
@ -231,6 +234,8 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
break;
|
||||
case ROUTE_BUILT:
|
||||
UiUtils.show(this, mLayoutSetupRouting, mTvPrepareDistance, mTvPrepareTime, mIvCancelRouteBuild);
|
||||
// TODO (marchuk): Uncomment after the second turn notification is fixed.
|
||||
// UiUtils.hide(mLayoutTurnInstructions, mWvProgress, mTvPlanning, mNextTurn);
|
||||
UiUtils.hide(mLayoutTurnInstructions, mWvProgress, mTvPlanning);
|
||||
if (animated)
|
||||
UiUtils.appearSlidingDown(mBtnStart, null);
|
||||
|
@ -241,7 +246,10 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
break;
|
||||
case ROUTE_BUILD_ERROR:
|
||||
UiUtils.show(mLayoutSetupRouting, mIvCancelRouteBuild, mTvPlanning);
|
||||
// TODO (marchuk): Uncomment after the second turn notification is fixed.
|
||||
// UiUtils.hide(mLayoutTurnInstructions, mTvPrepareDistance, mTvPrepareTime, mWvProgress, mNextTurn);
|
||||
UiUtils.hide(mLayoutTurnInstructions, mTvPrepareDistance, mTvPrepareTime, mWvProgress);
|
||||
|
||||
mTvPlanning.setText(R.string.routing_planning_error);
|
||||
break;
|
||||
case TURN_INSTRUCTIONS:
|
||||
|
@ -286,11 +294,7 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
return;
|
||||
|
||||
if (Framework.getRouter() == Framework.ROUTER_TYPE_VEHICLE)
|
||||
{
|
||||
mTvTurnDistance.setText(buildSpannedText(UiUtils.dimen(R.dimen.text_size_display_1), UiUtils.dimen(R.dimen.text_size_toolbar),
|
||||
mCachedRoutingInfo.distToTurn, mCachedRoutingInfo.turnUnits));
|
||||
mCachedRoutingInfo.vehicleTurnDirection.setTurnDrawable(mIvTurn);
|
||||
}
|
||||
refreshVehicleInfo(mCachedRoutingInfo);
|
||||
else
|
||||
refreshPedestrianAzimutAndDistance(mCachedRoutingInfo);
|
||||
|
||||
|
@ -302,6 +306,21 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
|
|||
mFpRouteProgress.setProgress((int) mCachedRoutingInfo.completionPercent);
|
||||
}
|
||||
|
||||
private void refreshVehicleInfo(RoutingInfo routingInfo)
|
||||
{
|
||||
mTvTurnDistance.setText(buildSpannedText(UiUtils.dimen(R.dimen.text_size_display_1), UiUtils.dimen(R.dimen.text_size_toolbar),
|
||||
routingInfo.distToTurn, routingInfo.turnUnits));
|
||||
routingInfo.vehicleTurnDirection.setTurnDrawable(mIvTurn);
|
||||
// TODO (marchuk): Uncomment after the second turn notification is fixed.
|
||||
// if (routingInfo.vehicleNextTurnDirection.containsNextTurn())
|
||||
// {
|
||||
// UiUtils.appearSlidingDown(mNextTurn, null);
|
||||
// routingInfo.vehicleNextTurnDirection.setNextTurnDrawable(mIvNextTurn);
|
||||
// }
|
||||
// else
|
||||
// UiUtils.disappearSlidingUp(mNextTurn, null);
|
||||
}
|
||||
|
||||
private void refreshPedestrianAzimutAndDistance(RoutingInfo info)
|
||||
{
|
||||
Location location = LocationHelper.INSTANCE.getLastLocation();
|
||||
|
|
|
@ -97,15 +97,14 @@ public class SearchToolbarController extends ToolbarController
|
|||
|
||||
public String getQuery()
|
||||
{
|
||||
return mQuery.getText().toString().trim();
|
||||
return mQuery.getText().toString();
|
||||
}
|
||||
|
||||
public void setQuery(CharSequence query)
|
||||
{
|
||||
final String text = query.toString().trim();
|
||||
mQuery.setText(text);
|
||||
if (!TextUtils.isEmpty(text))
|
||||
mQuery.selectAll();
|
||||
mQuery.setText(query);
|
||||
if (!TextUtils.isEmpty(query))
|
||||
mQuery.setSelection(query.length());
|
||||
}
|
||||
|
||||
public void clear()
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.app.Activity;
|
|||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
|
@ -223,6 +224,9 @@ public class PlacePageView extends RelativeLayout implements View.OnClickListene
|
|||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||
setElevation(UiUtils.dimen(R.dimen.appbar_elevation));
|
||||
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
|
||||
mPpDetails.setBackgroundResource(0);
|
||||
}
|
||||
|
||||
private void init(AttributeSet attrs, int defStyleAttr)
|
||||
|
|