fix small issues
git-svn-id: https://osmand.googlecode.com/svn/trunk@128 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
5bbdccdc98
commit
25900dca4a
9 changed files with 72 additions and 29 deletions
|
@ -20,6 +20,7 @@ public class ToDoConstants {
|
|||
// introduce one place where refreshMap will be called using postMessage mechanism (delay more than > 50 ? ms).
|
||||
// Introducing cache of file names that are on disk (creating new File() consumes a lot of memory)
|
||||
// 31. Translation.
|
||||
// 32. Introduce POI predefined filters (car filter(other-fuel, transportation-car_wash, show-car) and others)
|
||||
|
||||
|
||||
// FIXME Bugs Android :
|
||||
|
|
BIN
OsmAnd/res/drawable/background_rot.png
Normal file
BIN
OsmAnd/res/drawable/background_rot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 199 KiB |
|
@ -15,7 +15,7 @@
|
|||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="140dip"
|
||||
android:layout_height="70dip"
|
||||
android:layout_height="90dip"
|
||||
android:drawableLeft="@drawable/map"/>
|
||||
|
||||
<Button
|
||||
|
@ -25,7 +25,7 @@
|
|||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="140dip"
|
||||
android:layout_height="70dip"
|
||||
android:layout_height="90dip"
|
||||
android:drawableLeft="@drawable/find"/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
|
@ -36,7 +36,7 @@
|
|||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="140dip"
|
||||
android:layout_height="70dip"
|
||||
android:layout_height="90dip"
|
||||
android:drawableLeft="@drawable/favorites"/>
|
||||
<Button
|
||||
android:id="@+id/SettingsButton"
|
||||
|
@ -45,7 +45,7 @@
|
|||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="140dip"
|
||||
android:layout_height="70dip"
|
||||
android:layout_height="90dip"
|
||||
android:drawableLeft="@drawable/settings"/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
|
|
@ -2,22 +2,42 @@
|
|||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent" android:orientation="vertical"
|
||||
android:layout_height="fill_parent" android:background="@color/menu_background">
|
||||
android:layout_height="fill_parent" android:background="@drawable/background_rot">
|
||||
|
||||
<Button android:layout_height="45dp" android:textStyle="bold"
|
||||
android:layout_gravity="center" android:id="@+id/MapButton"
|
||||
android:text="@string/map_Button" android:layout_width="300dp" android:layout_marginTop="10dp"></Button>
|
||||
<Button android:layout_height="45dp" android:layout_gravity="center"
|
||||
android:id="@+id/MapButton"
|
||||
android:text="@string/map_Button"
|
||||
android:background="@drawable/btn_orange"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:drawableLeft="@drawable/map"
|
||||
android:layout_width="300dp" android:layout_marginTop="10dp"></Button>
|
||||
|
||||
|
||||
<Button android:layout_height="45dp" android:id="@+id/SearchButton" android:text="@string/search_button" android:textStyle="bold"
|
||||
android:layout_width="300dp" android:layout_gravity="center" android:layout_marginTop="10dp"></Button>
|
||||
|
||||
<Button android:id="@+id/FavoritesButton" android:text="@string/favorites_Button" android:layout_marginTop="10dp"
|
||||
android:textStyle="bold" android:layout_width="300dp" android:layout_gravity="center"
|
||||
android:layout_height="45dp"/>
|
||||
|
||||
<Button android:layout_height="45dp" android:textStyle="bold"
|
||||
android:layout_gravity="center" android:id="@+id/SettingsButton"
|
||||
android:text="@string/settings_Button" android:layout_width="300dp" android:layout_marginTop="10dp"></Button>
|
||||
<Button android:layout_height="45dp" android:layout_gravity="center"
|
||||
android:id="@+id/SearchButton"
|
||||
android:text="@string/search_button"
|
||||
android:background="@drawable/btn_orange"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:drawableLeft="@drawable/find"
|
||||
android:layout_width="300dp" android:layout_marginTop="10dp"></Button>
|
||||
<Button android:layout_height="45dp" android:layout_gravity="center"
|
||||
android:id="@+id/FavoritesButton"
|
||||
android:text="@string/favorites_Button"
|
||||
android:background="@drawable/btn_orange"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:drawableLeft="@drawable/favorites"
|
||||
android:layout_width="300dp" android:layout_marginTop="10dp"></Button>
|
||||
<Button android:layout_height="45dp" android:layout_gravity="center"
|
||||
android:id="@+id/SettingsButton"
|
||||
android:text="@string/settings_Button"
|
||||
android:background="@drawable/btn_orange"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textStyle="bold"
|
||||
android:drawableLeft="@drawable/settings"
|
||||
android:layout_width="300dp" android:layout_marginTop="10dp"></Button>
|
||||
<FrameLayout android:id="@+id/FrameLayout01"
|
||||
android:layout_height="fill_parent" android:layout_width="fill_parent">
|
||||
<Button android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="@string/app_settings"><CheckBoxPreference android:summary="@string/use_english_names_descr" android:title="@string/use_english_names" android:key="use_english_names"></CheckBoxPreference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/map_preferences">
|
||||
|
||||
<CheckBoxPreference android:key="use_internet_to_download_tiles" android:title="@string/use_internet" android:summary="@string/use_internet_to_download_tile"></CheckBoxPreference>
|
||||
|
@ -12,6 +14,5 @@
|
|||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/map_source"><ListPreference android:title="@string/map_tile_source" android:summary="@string/map_tile_source_descr" android:key="map_tile_sources"></ListPreference>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/app_settings"><CheckBoxPreference android:summary="@string/use_english_names_descr" android:title="@string/use_english_names" android:key="use_english_names"></CheckBoxPreference>
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -141,9 +141,14 @@ public class OsmandSettings {
|
|||
return prefs.getString(LAST_SEARCHED_REGION, "");
|
||||
}
|
||||
|
||||
public static boolean setLastSearchedRegion(Context ctx, String region){
|
||||
public static boolean setLastSearchedRegion(Context ctx, String region) {
|
||||
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
|
||||
return prefs.edit().putString(LAST_SEARCHED_REGION, region).commit();
|
||||
Editor edit = prefs.edit().putString(LAST_SEARCHED_REGION, region).putLong(LAST_SEARCHED_CITY, -1).
|
||||
putString(LAST_SEARCHED_STREET,"").putString(LAST_SEARCHED_BUILDING, "");
|
||||
if (prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)) {
|
||||
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, "");
|
||||
}
|
||||
return edit.commit();
|
||||
}
|
||||
|
||||
public static Long getLastSearchedCity(Context ctx){
|
||||
|
@ -153,9 +158,12 @@ public class OsmandSettings {
|
|||
|
||||
public static boolean setLastSearchedCity(Context ctx, Long cityId){
|
||||
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
|
||||
return prefs.edit().
|
||||
putLong(LAST_SEARCHED_CITY, cityId).putString(LAST_SEARCHED_STREET, "").putString(LAST_SEARCHED_BUILDING, "").
|
||||
commit();
|
||||
Editor edit = prefs.edit().putLong(LAST_SEARCHED_CITY, cityId).putString(LAST_SEARCHED_STREET, "").
|
||||
putString(LAST_SEARCHED_BUILDING, "");
|
||||
if(prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)){
|
||||
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, "");
|
||||
}
|
||||
return edit.commit();
|
||||
}
|
||||
|
||||
public static String getLastSearchedStreet(Context ctx){
|
||||
|
@ -165,7 +173,11 @@ public class OsmandSettings {
|
|||
|
||||
public static boolean setLastSearchedStreet(Context ctx, String street){
|
||||
SharedPreferences prefs = ctx.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_WORLD_READABLE);
|
||||
return prefs.edit().putString(LAST_SEARCHED_STREET, street).putString(LAST_SEARCHED_BUILDING, "").commit();
|
||||
Editor edit = prefs.edit().putString(LAST_SEARCHED_STREET, street).putString(LAST_SEARCHED_BUILDING, "");
|
||||
if(prefs.contains(LAST_SEARCHED_INTERSECTED_STREET)){
|
||||
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, "");
|
||||
}
|
||||
return edit.commit();
|
||||
}
|
||||
|
||||
public static String getLastSearchedBuilding(Context ctx){
|
||||
|
|
|
@ -97,12 +97,13 @@ public class MainMenuActivity extends Activity {
|
|||
|
||||
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
|
||||
Intent mapIndent = new Intent(MainMenuActivity.this, MapActivity.class);
|
||||
Intent notificationIndent = new Intent(MainMenuActivity.this, MapActivity.class);
|
||||
notificationIndent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
Notification notification = new Notification(R.drawable.icon, "",
|
||||
System.currentTimeMillis());
|
||||
notification.setLatestEventInfo(MainMenuActivity.this, "OsmAnd",
|
||||
"OsmAnd is running in background", PendingIntent.getActivity(
|
||||
this.getBaseContext(), 0, mapIndent,
|
||||
this.getBaseContext(), 0, notificationIndent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT));
|
||||
mNotificationManager.notify(APP_NOTIFICATION_ID, notification);
|
||||
|
||||
|
|
|
@ -139,6 +139,7 @@ public class SearchAddressActivity extends Activity {
|
|||
public void onClick(View v) {
|
||||
street = null;
|
||||
building = null;
|
||||
street2 = null;
|
||||
updateUI();
|
||||
}
|
||||
});
|
||||
|
@ -147,6 +148,7 @@ public class SearchAddressActivity extends Activity {
|
|||
public void onClick(View v) {
|
||||
city = null;
|
||||
street = null;
|
||||
street2 = null;
|
||||
building = null;
|
||||
updateUI();
|
||||
}
|
||||
|
@ -157,6 +159,7 @@ public class SearchAddressActivity extends Activity {
|
|||
region = null;
|
||||
city = null;
|
||||
street = null;
|
||||
street2 = null;
|
||||
building = null;
|
||||
updateUI();
|
||||
}
|
||||
|
|
|
@ -86,11 +86,16 @@ public class SearchPOIActivity extends ListActivity {
|
|||
.getLongitude(), zoom, maxCount);
|
||||
} else {
|
||||
amenityList = resourceManager.searchAmenities(amenityType, lastKnownMapLocation.getLatitude(), lastKnownMapLocation
|
||||
.getLongitude(), zoom, 30);
|
||||
.getLongitude(), zoom, maxCount);
|
||||
}
|
||||
|
||||
if (amenityList != null) {
|
||||
MapUtils.sortListOfMapObject(amenityList, lastKnownMapLocation.getLatitude(), lastKnownMapLocation.getLongitude());
|
||||
if(amenityType == null){
|
||||
while (amenityList.size() > 30) {
|
||||
amenityList.remove(amenityList.size() - 1);
|
||||
}
|
||||
}
|
||||
amenityAdapter = new AmenityAdapter(amenityList);
|
||||
setListAdapter(amenityAdapter);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue