forked from organicmaps/organicmaps
UI fixes.
This commit is contained in:
parent
fa491cee6e
commit
8186871f09
5 changed files with 38 additions and 16 deletions
|
@ -75,21 +75,21 @@
|
|||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:paddingRight="@dimen/margin_tiny"
|
||||
android:padding="@dimen/margin_small">
|
||||
android:layout_weight="0">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv__start_routing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="@dimen/margin_small"
|
||||
android:src="@drawable/ic_drive"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb__routing_progress"
|
||||
android:layout_width="@dimen/routing_progress_size"
|
||||
android:layout_height="@dimen/routing_progress_size"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -76,21 +76,21 @@
|
|||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:padding="@dimen/margin_small"
|
||||
android:paddingRight="@dimen/margin_tiny">
|
||||
android:layout_weight="0">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv__start_routing"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="@dimen/margin_small"
|
||||
android:src="@drawable/ic_drive"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb__routing_progress"
|
||||
android:layout_width="@dimen/routing_progress_size"
|
||||
android:layout_height="@dimen/routing_progress_size"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
android:id="@+id/tv__routing_go"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:paddingLeft="@dimen/margin_medium"
|
||||
android:text="@string/routing_go"
|
||||
android:textColor="@color/downloader_green"/>
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<dimen name="bg_downloader_radius">6dp</dimen>
|
||||
<dimen name="bg_downloader_size">16dp</dimen>
|
||||
<dimen name="routing_pp_height">80dp</dimen>
|
||||
<dimen name="routing_button_height">48dp</dimen>
|
||||
<dimen name="routing_progress_size">24dp</dimen>
|
||||
<dimen name="routing_button_height">42dp</dimen>
|
||||
<dimen name="routing_progress_size">32dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -18,7 +18,10 @@ import android.os.Bundle;
|
|||
import android.os.Environment;
|
||||
import android.support.v4.content.LocalBroadcastManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
|
@ -1013,9 +1016,19 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
if (mInfoView.getState() != State.HIDDEN)
|
||||
mInfoView.updateLocation(l);
|
||||
|
||||
final LocationState.RoutingInfo info = Framework.nativeGetRouteFollowingInfo();
|
||||
if (info != null)
|
||||
mTvRoutingDistance.setText(info.mDistToTarget + info.mUnits);
|
||||
updateRoutingDistance();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateRoutingDistance()
|
||||
{
|
||||
final LocationState.RoutingInfo info = Framework.nativeGetRouteFollowingInfo();
|
||||
if (info != null)
|
||||
{
|
||||
final SpannableStringBuilder builder = new SpannableStringBuilder(info.mDistToTarget).append(" ").append(info.mUnits);
|
||||
builder.setSpan(new AbsoluteSizeSpan(30, true), 0, info.mDistToTarget.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.setSpan(new AbsoluteSizeSpan(15, true), info.mDistToTarget.length(), builder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
mTvRoutingDistance.setText(builder);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1095,11 +1108,22 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
|
||||
mSearchController.onResume();
|
||||
mInfoView.onResume();
|
||||
tryResumeRouting();
|
||||
|
||||
MWMApplication.get().onMwmResume(this);
|
||||
|
||||
}
|
||||
|
||||
private void tryResumeRouting()
|
||||
{
|
||||
if (Framework.nativeIsRoutingActive())
|
||||
{
|
||||
updateRoutingDistance();
|
||||
mRlRoutingBox.setVisibility(View.VISIBLE);
|
||||
mInfoView.setState(State.HIDDEN);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateExternalStorageState()
|
||||
{
|
||||
boolean available = false, writable = false;
|
||||
|
@ -1445,7 +1469,7 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
return;
|
||||
}
|
||||
|
||||
mIvStartRouting.setVisibility(View.GONE);
|
||||
mIvStartRouting.setVisibility(View.INVISIBLE);
|
||||
mPbRoutingProgress.setVisibility(View.VISIBLE);
|
||||
Framework.nativeBuildRoute(mInfoView.getMapObject().getLat(), mInfoView.getMapObject().getLon());
|
||||
}
|
||||
|
@ -1553,9 +1577,7 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
|
||||
mInfoView.setState(State.HIDDEN);
|
||||
|
||||
final LocationState.RoutingInfo info = Framework.nativeGetRouteFollowingInfo();
|
||||
if (info != null)
|
||||
mTvRoutingDistance.setText(info.mDistToTarget + info.mUnits);
|
||||
updateRoutingDistance();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue