forked from organicmaps/organicmaps
[yopme] Updated texts&limited redraw.
This commit is contained in:
parent
cc42b06dec
commit
322feb1d75
2 changed files with 26 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
<string name="pick_point_button_name">Показать на E-ink экране</string>
|
||||
<string name="location_update_frequency">Частота обновления</string>
|
||||
<string name="pref_update_title">Обновление карты</string>
|
||||
<string name="error_map_is_absent">Карта для данной местности не загружена. Загрузите ее в MapsWithMe на основном экране.</string>
|
||||
|
||||
<string-array name="update_frequency">
|
||||
<item>По нажатию</item>
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.location.Location;
|
|||
import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
@ -68,6 +69,18 @@ public class BackscreenActivity extends BSActivity
|
|||
protected MapDataProvider mMapDataProvider;
|
||||
private LocationManager mLocationManager;
|
||||
|
||||
private final Runnable mInvalidateDrawable = new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
draw();
|
||||
}
|
||||
};
|
||||
|
||||
private final Handler mHandler = new Handler();
|
||||
private final static long REDRAW_MIN_INTERVAL = 333;
|
||||
|
||||
@Override
|
||||
protected void onBSCreate()
|
||||
{
|
||||
|
@ -98,6 +111,7 @@ public class BackscreenActivity extends BSActivity
|
|||
{
|
||||
super.onBSPause();
|
||||
mLocationManager.removeUpdates(getLocationPendingIntent(this));
|
||||
mHandler.removeCallbacks(mInvalidateDrawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -196,7 +210,8 @@ public class BackscreenActivity extends BSActivity
|
|||
|
||||
public void invalidate()
|
||||
{
|
||||
draw();
|
||||
mHandler.removeCallbacks(mInvalidateDrawable);
|
||||
mHandler.postDelayed(mInvalidateDrawable, REDRAW_MIN_INTERVAL);
|
||||
}
|
||||
|
||||
private boolean zoomIn()
|
||||
|
@ -358,6 +373,15 @@ public class BackscreenActivity extends BSActivity
|
|||
mBitmap = data.getBitmap();
|
||||
mMapView.setImageBitmap(mBitmap);
|
||||
|
||||
if (mBitmap == null)
|
||||
{
|
||||
// this means we dont have this map
|
||||
showWaitMessage(getString(R.string.error_map_is_absent));
|
||||
return;
|
||||
}
|
||||
else
|
||||
hideWaitMessage();
|
||||
|
||||
if (mMode == Mode.POI)
|
||||
{
|
||||
mMessage = data.getPoint().getName();
|
||||
|
|
Loading…
Add table
Reference in a new issue