Update icons

This commit is contained in:
Victor Shcherb 2015-03-20 00:51:06 +01:00
parent ccd84314a2
commit 40c878a7b8
90 changed files with 74 additions and 836 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -166,7 +166,7 @@
android:layout_height="@dimen/list_item_height"
android:background="?attr/options_button_background"
android:focusable="false"
android:src="?attr/list_settings_icon"
android:src="?attr/ic_action_overflow"
android:visibility="gone"/>
<include android:layout_width="wrap_content"

View file

@ -40,7 +40,7 @@
android:focusable="false"
android:visibility="gone"
android:background="?attr/options_button_background"
android:src="?attr/list_settings_icon"/>
android:src="?attr/ic_action_overflow"/>
</LinearLayout>

View file

@ -110,7 +110,7 @@
android:layout_gravity="center_vertical"
android:visibility="gone"
android:background="?attr/options_button_background"
android:src="?attr/list_settings_icon" />
android:src="?attr/ic_action_overflow" />
</LinearLayout>
</LinearLayout>

View file

@ -75,6 +75,6 @@
android:layout_height="@dimen/list_item_height"
android:background="?attr/options_button_background"
android:focusable="false"
android:src="?attr/list_settings_icon"/>
android:src="?attr/ic_action_overflow"/>
</LinearLayout>

View file

@ -72,7 +72,7 @@
android:layout_gravity="center_vertical"
android:background="?attr/options_button_background"
android:focusable="false"
android:src="?attr/list_settings_icon"/>
android:src="?attr/ic_action_overflow"/>
<ImageButton
android:id="@+id/play"
@ -81,7 +81,7 @@
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dashFavIconMargin"
android:background="?attr/dashboard_button"
android:src="@drawable/ic_play_light"/>
android:src="@drawable/ic_play_dark"/>
</LinearLayout>

View file

@ -15,7 +15,7 @@
android:id="@+id/remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/reset_image"
android:background="@drawable/ic_action_delete_dark"
android:contentDescription="@string/shared_string_delete"
android:paddingLeft="2dp"
android:paddingRight="2dp"

View file

@ -39,9 +39,7 @@
android:layout_marginBottom="9dp"
android:layout_marginTop="9dp"
android:background="?attr/expandable_list_item_background"
android:drawableLeft="?attr/ic_action_settings"
android:drawablePadding="10dp"
android:drawableStart="?attr/ic_action_settings"
android:paddingLeft="0dp"
android:paddingRight="16dp"
android:text="@string/shared_string_settings"
@ -115,7 +113,7 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="?attr/ic_world_globe"/>
android:id="@+id/ic_world_globe"/>
<net.osmand.plus.widgets.TextViewEx
android:layout_width="wrap_content"

View file

@ -60,6 +60,6 @@
android:layout_height="@dimen/dashListItemHeight"
android:layout_gravity="center"
android:background="?attr/options_button_background"
android:src="?attr/list_settings_icon" />
android:src="?attr/ic_action_overflow" />
</LinearLayout>

View file

@ -45,7 +45,7 @@
android:id="@+id/ResetCountry"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:background="?attr/reset_image"
android:background="@drawable/ic_action_remove_dark"
android:contentDescription="@string/shared_string_clear" />
</TableRow>
@ -67,7 +67,7 @@
android:id="@+id/ResetCity"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:background="?attr/reset_image"
android:background="@drawable/ic_action_remove_dark"
android:contentDescription="@string/shared_string_clear" />
</TableRow>
@ -89,7 +89,7 @@
android:id="@+id/ResetStreet"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:background="?attr/reset_image"
android:background="@drawable/ic_action_remove_dark"
android:contentDescription="@string/shared_string_clear" />
</TableRow>
@ -112,7 +112,7 @@
android:id="@+id/ResetBuilding"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:background="?attr/reset_image"
android:background="@drawable/ic_action_remove_dark"
android:contentDescription="@string/shared_string_clear" />
</TableRow>
</TableLayout>

View file

@ -90,7 +90,7 @@
android:layout_gravity="center_vertical"
android:background="?attr/options_button_background"
android:focusable="false"
android:src="?attr/list_settings_icon"
android:src="?attr/ic_action_overflow"
android:visibility="gone" />
<ImageButton

View file

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?><!-- This file is at /res/layout/list.xml -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RootLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@+id/SearchTransportLevelButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/SearchAreaText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
<RelativeLayout
android:id="@+id/RelativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/listView"/>
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
</RelativeLayout>
</LinearLayout>

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:orientation="horizontal">
<ImageView
android:id="@+id/search_icon"
android:layout_width="25dp"
android:layout_height="fill_parent"
android:paddingTop="2dp" />
<TextView
android:id="@+id/label"
style="@style/ListText.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:orientation="horizontal">
<!-- <TextView android:id="@+id/distance_label" android:layout_marginLeft="5dp"
android:layout_width="80dp" android:layout_height="fill_parent" android:gravity="left"
android:textSize="20sp"/> -->
<TextView
android:id="@+id/label"
style="@style/ListText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageButton
android:id="@+id/remove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?attr/reset_image"
android:contentDescription="@string/shared_string_delete"
android:paddingLeft="2dp"
android:paddingTop="2dp" />
</LinearLayout>

View file

@ -6,14 +6,10 @@
<declare-styleable name="OsmAndTheme">
<attr name="list_divider" format="color"/>
<attr name="expandable_category_color" format="reference"/>
<attr name="reset_image" format="reference"/>
<attr name="bottomToolBarColor" format="color" />
<attr name="downloadButtonBackground" format="reference" />
<attr name="card_bg" format="reference" />
<attr name="ic_action_check" format="reference" />
<attr name="ic_extension" format="reference" />
<attr name="ic_overflow_menu" format="reference" />
<attr name="ic_plugin_options" format="reference" />
<attr name="ic_action_overflow" format="reference" />
<attr name="dashboardGeneralButtonStyle" format="reference" />
<attr name="options_button_background" format="reference"/>
<attr name="dashboardSubHeaderStyle" format="reference" />
@ -24,17 +20,14 @@
<attr name="ic_action_home2" format="reference" />
<attr name="ic_action_marker2" format="reference" />
<attr name="search_background" format="reference" />
<attr name="ic_action_settings" format="reference" />
<attr name="switch_ex_background" format="reference" />
<attr name="switch_ex_text_color" format="color|reference" />
<attr name="bg_plugin_logo_disabled" format="reference" />
<attr name="plugin_details_header_bg" format="color|reference" />
<attr name="plugin_details_install_header_bg" format="color|reference" />
<attr name="ic_world_globe" format="reference" />
<attr name="plugin_description_header_text_color" format="color|reference" />
<attr name="expandable_list_item_background" format="color"/>
<attr name="expandable_list_background" format="color"/>
<attr name="list_settings_icon" format="reference"/>
<attr name="size_progress_bar" format="reference"/>
<attr name="dash_parking_bg" format="reference"/>
<attr name="osmo_header_background" format="color"/>

View file

@ -118,9 +118,9 @@
</style>
<style name="OsmandLightTheme" parent="Theme.AppCompat.Light">
<item name="ic_action_overflow">@drawable/ic_overflow_menu_light</item>
<item name="options_button_background">@drawable/dashboard_button_light</item>
<item name="list_divider">@color/list_divider_dark</item>
<item name="reset_image">@drawable/ic_action_delete_light</item> <!-- @drawable/a_1_navigation_cancel_light -->
<item name="expandable_category_color">?android:attr/colorBackground</item>
<item name="bottomToolBarColor">@color/tool_bar_color_light</item>
<item name="downloadButtonBackground">@drawable/download_light</item>
@ -134,10 +134,6 @@
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarLight</item>
<item name="card_bg">@drawable/bg_card_light</item>
<item name="ic_action_check">@drawable/ic_action_check_light</item>
<item name="ic_extension">@drawable/ic_extension_light</item>
<item name="ic_overflow_menu">@drawable/ic_overflow_menu_light</item>
<item name="ic_plugin_options">@drawable/ic_plugin_options_light</item>
<item name="dashboardGeneralButtonStyle">@style/DashboardGeneralButton.Light</item>
<item name="dashboardSubHeaderStyle">@style/DashboardSubHeader.Light</item>
<item name="dashboard_divider">@color/dashboard_divider_light</item>
@ -147,7 +143,6 @@
<item name="ic_action_home2">@drawable/ic_action_home2_light</item>
<item name="ic_action_marker2">@drawable/ic_action_marker2_light</item>
<item name="search_background">@color/search_background_dark</item>
<item name="ic_action_settings">@drawable/ic_action_settings_light</item>
<item name="android:actionModeCloseDrawable">@drawable/action_mode_back</item>
<item name="actionModeCloseDrawable">@drawable/action_mode_back</item>
<item name="android:actionModeStyle">@style/WhiteActionMode</item>
@ -159,20 +154,18 @@
<item name="bg_plugin_logo_disabled">@drawable/bg_plugin_logo_disabled_light</item>
<item name="plugin_details_header_bg">@color/plugin_details_header_bg_light</item>
<item name="plugin_details_install_header_bg">@color/plugin_details_install_header_bg_light</item>
<item name="ic_world_globe">@drawable/ic_world_globe_light</item>
<item name="plugin_description_header_text_color">#727272</item>
<item name="expandable_list_item_background">@drawable/expandable_list_item_background_light</item>
<item name="expandable_list_background">@color/color_white</item>
<item name="list_settings_icon">@drawable/ic_overflow_menu_light</item>
<item name="size_progress_bar">@drawable/size_progressbar_light</item>
<item name="dash_parking_bg">@drawable/dash_parking_light</item>
<item name="osmo_header_background">@color/osmo_header_light</item>
</style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
<item name="ic_action_overflow">@drawable/ic_overflow_menu_dark</item>
<item name="options_button_background">@drawable/dashboard_button_dark</item>
<item name="list_divider">@color/list_divider_light</item>
<item name="reset_image">@drawable/ic_action_delete_dark</item> <!-- @drawable/a_1_navigation_cancel_dark -->
<item name="expandable_category_color">?android:attr/colorBackground</item>
<item name="bottomToolBarColor">@color/tool_bar_color_dark</item>
<item name="downloadButtonBackground">@drawable/download_dark</item>
@ -185,10 +178,6 @@
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
<item name="actionBarStyle">@style/Widget.Styled.ActionBarDark</item>
<item name="card_bg">@drawable/bg_card_dark</item>
<item name="ic_action_check">@drawable/ic_action_check_dark</item>
<item name="ic_extension">@drawable/ic_extension_dark</item>
<item name="ic_overflow_menu">@drawable/ic_overflow_menu_dark</item>
<item name="ic_plugin_options">@drawable/ic_plugin_options_dark</item>
<item name="dashboardGeneralButtonStyle">@style/DashboardGeneralButton.Dark</item>
<item name="dashboardSubHeaderStyle">@style/DashboardSubHeader.Dark</item>
<item name="dashboard_divider">@color/dashboard_divider_dark</item>
@ -198,17 +187,14 @@
<item name="ic_action_home2">@drawable/ic_action_home2_dark</item>
<item name="ic_action_marker2">@drawable/ic_action_marker2_dark</item>
<item name="search_background">@color/color_white</item>
<item name="ic_action_settings">@drawable/ic_action_settings_dark</item>
<item name="switch_ex_background">@drawable/switch_ex_background_dark</item>
<item name="switch_ex_text_color">@color/switch_ex_button_text_dark</item>
<item name="bg_plugin_logo_disabled">@drawable/bg_plugin_logo_disabled_dark</item>
<item name="plugin_details_header_bg">@color/list_item_background_dark</item>
<item name="plugin_details_install_header_bg">@color/plugin_details_install_header_bg_dark</item>
<item name="ic_world_globe">@drawable/ic_world_globe_dark</item>
<item name="plugin_description_header_text_color">#70818c</item>
<item name="expandable_list_item_background">@drawable/expandable_list_item_background_dark</item>
<item name="expandable_list_background">@color/list_background_dark</item>
<item name="list_settings_icon">@drawable/ic_overflow_menu_dark</item>
<item name="size_progress_bar">@drawable/size_progressbar_dark</item>
<item name="dash_parking_bg">@drawable/dash_parking_dark</item>
<item name="osmo_header_background">@color/osmo_header_dark</item>

View file

@ -4,12 +4,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SettingsActivity;
import android.app.Activity;
import android.content.Intent;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceScreen;
public class AccessibilityPlugin extends OsmandPlugin {
private static final String ID = "osmand.accessibility";
@ -54,7 +49,6 @@ public class AccessibilityPlugin extends OsmandPlugin {
@Override
public int getLogoResourceId() {
// TODO
return super.getLogoResourceId();
return R.drawable.ic_plugin_accessibility;
}
}

View file

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.util.OpeningHoursParser.BasicOpeningHourRule;
import net.osmand.util.OpeningHoursParser.OpeningHoursRule;
@ -35,9 +36,11 @@ public class OpeningHoursView {
private boolean notifyingTime = true;
private ListView list;
private OsmandApplication app;
public OpeningHoursView(Context ctx){
this.ctx = ctx;
app = (OsmandApplication) ctx.getApplicationContext();
}
public View createOpeningHoursEditView(List<BasicOpeningHourRule> t){
@ -119,6 +122,7 @@ public class OpeningHoursView {
}
TextView label = (TextView)row.findViewById(R.id.label);
ImageView icon = (ImageView)row.findViewById(R.id.remove);
icon.setBackgroundDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark));
if(selectedRule == position){
label.setTypeface(null, Typeface.BOLD);
label.setTextSize(22);

View file

@ -1,5 +1,6 @@
package net.osmand.plus.activities;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
@ -127,6 +128,8 @@ public class PluginActivity extends OsmandActionBarActivity {
R.id.plugin_enable_disable);
Button getButton = (Button)findViewById(R.id.plugin_get);
Button settingsButton = (Button)findViewById(R.id.plugin_settings);
IconsCache ic = ((OsmandApplication) getApplication()).getIconsCache();
settingsButton.setCompoundDrawablesWithIntrinsicBounds(ic.getContentIcon(R.drawable.ic_action_settings_dark), null, null, null);
View installHeader = findViewById(R.id.plugin_install_header);
if (plugin.needsInstallation()) {
@ -134,6 +137,9 @@ public class PluginActivity extends OsmandActionBarActivity {
enableDisableButton.setVisibility(View.GONE);
settingsButton.setVisibility(View.GONE);
installHeader.setVisibility(View.VISIBLE);
((ImageView) installHeader.findViewById(R.id.ic_world_globe)).
setBackgroundDrawable(ic.getContentIcon(R.drawable.ic_world_globe_dark));
} else {
getButton.setVisibility(View.GONE);
enableDisableButton.setVisibility(View.VISIBLE);

View file

@ -1,14 +1,5 @@
package net.osmand.plus.activities.search;
import java.text.MessageFormat;
import android.content.pm.ActivityInfo;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import net.osmand.access.AccessibleToast;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
@ -25,9 +16,17 @@ import net.osmand.util.Algorithms;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
@ -221,6 +220,9 @@ public class SearchAddressFragment extends Fragment {
}
}
});
OsmandApplication app = getApplication();
Drawable icon = getApplication().getIconsCache().getContentIcon(R.drawable.ic_action_remove_dark);
((ImageView)findViewById(R.id.ResetBuilding)).setBackgroundDrawable(icon);
findViewById(R.id.ResetBuilding).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
@ -231,6 +233,7 @@ public class SearchAddressFragment extends Fragment {
updateUI();
}
});
((ImageView)findViewById(R.id.ResetStreet)).setBackgroundDrawable(icon);
findViewById(R.id.ResetStreet).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
@ -243,6 +246,7 @@ public class SearchAddressFragment extends Fragment {
updateUI();
}
});
((ImageView)findViewById(R.id.ResetCity)).setBackgroundDrawable(icon);
findViewById(R.id.ResetCity).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
@ -257,6 +261,7 @@ public class SearchAddressFragment extends Fragment {
updateUI();
}
});
((ImageView)findViewById(R.id.ResetCountry)).setBackgroundDrawable(icon);
findViewById(R.id.ResetCountry).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {

View file

@ -504,12 +504,11 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (sequentialSearch) {
boolean light = ((OsmandApplication) getApplication()).getSettings().isLightActionBar();
OsmandApplication app = ((OsmandApplication) getApplication());
MenuItem menuItem = menu.add(0, NAVIGATE_TO, 0, R.string.context_menu_item_directions_to);
MenuItemCompat.setShowAsAction(menuItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_gdirections_light
: R.drawable.ic_action_gdirections_dark);
menuItem = menuItem.setIcon(app.getIconsCache().getActionBarIcon(R.drawable.ic_action_gdirections_dark));
menuItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -522,12 +521,12 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
menuItem = menu.add(0, ADD_WAYPOINT, 0, R.string.context_menu_item_intermediate_point);
MenuItemCompat.setShowAsAction(menuItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_flage_light : R.drawable.ic_action_flage_dark);
menuItem = menuItem.setIcon(app.getIconsCache().getActionBarIcon(R.drawable.ic_action_flage_dark));
} else {
menuItem = menu.add(0, ADD_WAYPOINT, 0, R.string.context_menu_item_destination_point);
MenuItemCompat.setShowAsAction(menuItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_flag_light : R.drawable.ic_action_flag_dark);
menuItem = menuItem.setIcon(app.getIconsCache().getActionBarIcon( R.drawable.ic_action_flag_dark));
}
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
@ -539,7 +538,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
menuItem = menu.add(0, SHOW_ON_MAP, 0, R.string.shared_string_show_on_map);
MenuItemCompat.setShowAsAction(menuItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_marker_light : R.drawable.ic_action_marker_dark);
menuItem = menuItem.setIcon(app.getIconsCache().getActionBarIcon(R.drawable.ic_action_marker_dark));
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
@ -552,7 +551,7 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
menuItem = menu.add(0, ADD_TO_FAVORITE, 0, R.string.shared_string_add_to_favorites);
MenuItemCompat.setShowAsAction(menuItem,
MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(light ? R.drawable.ic_action_fav_light : R.drawable.ic_action_fav_dark);
menuItem = menuItem.setIcon(app.getIconsCache().getActionBarIcon(R.drawable.ic_action_fav_dark));
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override

View file

@ -1,635 +0,0 @@
/**
*
*/
package net.osmand.plus.activities.search;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.*;
import net.osmand.data.LatLon;
import net.osmand.data.TransportRoute;
import net.osmand.data.TransportStop;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.TransportRouteHelper;
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
import net.osmand.plus.resources.TransportIndexRepository;
import net.osmand.plus.resources.TransportIndexRepository.RouteInfoLocation;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Spannable;
import android.text.style.ForegroundColorSpan;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
public class SearchTransportFragment extends Fragment implements SearchActivityChild, OnItemClickListener {
public static final String SEARCH_LAT = SearchActivity.SEARCH_LAT;
public static final String SEARCH_LON = SearchActivity.SEARCH_LON;
private Button searchTransportLevel;
private TextView searchArea;
private final static int finalZoom = 13;
private final static int initialZoom = 17;
private int zoom = initialZoom;
private ProgressBar progress;
private LatLon lastKnownMapLocation;
private LatLon destinationLocation;
private LatLon selectedDestinationLocation;
private TransportStopAdapter stopsAdapter;
private TransportRouteAdapter intermediateListAdapater;
private OsmandSettings settings;
private View view;
private AsyncTask<?, ?, ?> asyncTask;
private OsmandApplication getApplication() {
return (OsmandApplication) getActivity().getApplication();
}
public View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.search_transport, container, false);
settings = getApplication().getSettings();
searchTransportLevel = (Button) view.findViewById(R.id.SearchTransportLevelButton);
searchTransportLevel.setText(R.string.search_POI_level_btn);
searchTransportLevel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!isRouteCalculated()) {
if (isSearchFurtherAvailable()) {
zoom--;
searchTransport();
}
} else {
intermediateListAdapater.clear();
intermediateListAdapater.add(null);
searchTransport();
}
}
});
searchArea = (TextView) view.findViewById(R.id.SearchAreaText);
progress = (ProgressBar) view.findViewById(R.id.ProgressBar);
progress.setVisibility(View.INVISIBLE);
stopsAdapter = new TransportStopAdapter(new ArrayList<RouteInfoLocation>());
((ListView) view.findViewById(android.R.id.list)).setAdapter(stopsAdapter);
((ListView) view.findViewById(android.R.id.list)).setOnItemClickListener(this);
ListView intermediateList = (ListView) view.findViewById(R.id.listView);
intermediateListAdapater = new TransportRouteAdapter(TransportRouteHelper.getInstance().getRoute());
intermediateList.setAdapter(intermediateListAdapater);
if(intermediateList.getCount() == 0){
intermediateListAdapater.add(null);
}
setHasOptionsMenu(true);
return view;
}
@Override
public void onDestroy() {
if (intermediateListAdapater != null) {
ArrayList<RouteInfoLocation> lastEditedRoute = new ArrayList<RouteInfoLocation>();
for (int i = 0; i < intermediateListAdapater.getCount(); i++) {
RouteInfoLocation item = intermediateListAdapater.getItem(i);
if (item != null) {
lastEditedRoute.add(item);
}
}
TransportRouteHelper.getInstance().setRoute(lastEditedRoute);
}
super.onDestroy();
}
@Override
public void onResume() {
super.onResume();
Intent intent = getActivity().getIntent();
LatLon startPoint = null;
if(intent != null){
double lat = intent.getDoubleExtra(SEARCH_LAT, 0);
double lon = intent.getDoubleExtra(SEARCH_LON, 0);
if(lat != 0 || lon != 0){
// Not commenting out the next line will cause the follwing issue:
// (1) When the transport search was called from the dashboard, everything still works: You can change the search origin on the tab, this resets any previous (if any) search results, and any new searches will be centered around the new origin.
// (2) But when the tab was called from map screen, changing the search origin on the tab keeps any search results, does not reset anything.
// (3) If the search origin had been changed on anoother search tab before switching to this one, new transport searches would still center around the OLD search origin (the last map view)
//startPoint = new LatLon(lat, lon);
}
}
if(startPoint == null && getActivity() instanceof SearchActivity){
startPoint = ((SearchActivity) getActivity()).getSearchPoint();
}
if (startPoint == null) {
startPoint = settings.getLastKnownMapLocation();
}
OsmandApplication app = (OsmandApplication) getApplication();
TargetPoint ps = app.getTargetPointsHelper().getPointToNavigate();
LatLon pointToNavigate = ps == null ? null : ps.point;
if(!Algorithms.objectEquals(pointToNavigate, this.destinationLocation) ||
!Algorithms.objectEquals(startPoint, this.lastKnownMapLocation)){
destinationLocation = pointToNavigate;
selectedDestinationLocation = destinationLocation;
lastKnownMapLocation = startPoint;
searchTransport();
}
}
@Override
public void locationUpdate(LatLon l) {
if(!Algorithms.objectEquals(l, this.lastKnownMapLocation)){
lastKnownMapLocation = l;
if(view != null) {
searchTransport();
}
}
}
public String getSearchArea(){
return " < " + 125 * (1 << (17 - zoom)) + " " + getString(R.string.m); //$NON-NLS-1$//$NON-NLS-2$
}
public boolean isSearchFurtherAvailable() {
return zoom >= finalZoom;
}
public void searchTransport(){
// use progress
stopsAdapter.clear();
searchArea.setText(getSearchArea());
boolean routeCalculated = isRouteCalculated();
searchTransportLevel.setEnabled(false);
if (!routeCalculated && getLocationToStart() != null) {
final LatLon locationToStart = getLocationToStart();
final LatLon locationToGo = getLocationToGo();
List<TransportIndexRepository> rs = ((OsmandApplication)getApplication()).getResourceManager().searchTransportRepositories(locationToStart.getLatitude(),
locationToStart.getLongitude());
if(!rs.isEmpty()){
final AsyncTask<?, ?, ?> previous = asyncTask;
AsyncTask<TransportIndexRepository, Void, List<RouteInfoLocation>> current =
new AsyncTask<TransportIndexRepository, Void, List<RouteInfoLocation>>() {
@Override
protected void onPreExecute() {
super.onPreExecute();
progress.setVisibility(View.VISIBLE);
}
@Override
protected List<RouteInfoLocation> doInBackground(TransportIndexRepository... params) {
if(previous != null) {
try {
previous.get();
} catch (Exception e) {
}
}
List<RouteInfoLocation> res = new ArrayList<TransportIndexRepository.RouteInfoLocation>();
for(TransportIndexRepository repo : params){
List<RouteInfoLocation> r = repo.searchTransportRouteStops(locationToStart.getLatitude(), locationToStart
.getLongitude(), locationToGo, zoom);
if(r != null) {
res.addAll(r);
}
}
return res;
}
@Override
protected void onPostExecute(List<RouteInfoLocation> result) {
// isAdded() here fixes the "not attached to Activity" FC when rapidly changing screen orientation
if (isAdded()) {
stopsAdapter.setNewModel(result);
updateSearchMoreButton();
searchArea.setText(getSearchArea());
progress.setVisibility(View.INVISIBLE);
asyncTask = null;
}
}
};
asyncTask = current;
current.execute(rs.toArray(new TransportIndexRepository[rs.size()]));
}
} else {
updateSearchMoreButton();
}
}
private void updateSearchMoreButton() {
if (!isRouteCalculated()) {
searchTransportLevel.setEnabled(isSearchFurtherAvailable());
searchTransportLevel.setText(R.string.search_POI_level_btn);
} else {
searchTransportLevel.setEnabled(true);
searchTransportLevel.setText(R.string.transport_search_again);
}
}
public String getInformation(RouteInfoLocation route, List<TransportStop> stops, int position, boolean part){
StringBuilder text = new StringBuilder(200);
double dist = 0;
int ind = 0;
int stInd = stops.size();
int eInd = stops.size();
for (TransportStop s : stops) {
if (s == route.getStart()) {
stInd = ind;
}
if (s == route.getStop()) {
eInd = ind;
}
if (ind > stInd && ind <= eInd) {
dist += MapUtils.getDistance(stops.get(ind - 1).getLocation(), s.getLocation());
}
ind++;
}
text.append(getString(R.string.transport_route_distance)).append(" ").append(OsmAndFormatter.getFormattedDistance((int) dist, getApplication())); //$NON-NLS-1$/
if(!part){
text.append(", ").append(getString(R.string.transport_stops_to_pass)).append(" ").append(eInd - stInd); //$NON-NLS-1$ //$NON-NLS-2$
LatLon endStop = getEndStop(position - 1);
if (endStop != null) {
String before = OsmAndFormatter.getFormattedDistance((int) MapUtils.getDistance(endStop, route.getStart().getLocation()),
getApplication());
text.append(", ").append(getString(R.string.transport_to_go_before)).append(" ").append(before); //$NON-NLS-2$//$NON-NLS-1$
}
LatLon stStop = getStartStop(position + 1);
if (stStop != null) {
String after = OsmAndFormatter.getFormattedDistance((int) MapUtils.getDistance(stStop, route.getStop().getLocation()), getApplication());
text.append(", ").append(getString(R.string.transport_to_go_after)).append(" ").append(after); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return text.toString();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
final RouteInfoLocation item = stopsAdapter.getItem(position);
Builder builder = new AlertDialog.Builder(getActivity());
List<String> items = new ArrayList<String>();
final List<TransportStop> stops = item.getDirection() ? item.getRoute().getForwardStops() : item.getRoute().getBackwardStops();
LatLon locationToGo = getLocationToGo();
LatLon locationToStart = getLocationToStart();
builder.setTitle(getString(R.string.transport_stop_to_go_out)+"\n"+getInformation(item, stops, getCurrentRouteLocation(), true)); //$NON-NLS-1$
int ind = 0;
for(TransportStop st : stops){
StringBuilder n = new StringBuilder(50);
n.append(ind++);
if(st == item.getStop()){
n.append("!! "); //$NON-NLS-1$
} else {
n.append(". "); //$NON-NLS-1$
}
String name = st.getName(settings.usingEnglishNames());
if(locationToGo != null){
n.append(name).append(" - ["); //$NON-NLS-1$
n.append(OsmAndFormatter.getFormattedDistance((int) MapUtils.getDistance(locationToGo, st.getLocation()), getApplication())).append("]"); //$NON-NLS-1$
} else if(locationToStart != null){
n.append("[").append(OsmAndFormatter.getFormattedDistance((int) MapUtils.getDistance(locationToStart, st.getLocation()), getApplication())).append("] - "); //$NON-NLS-1$ //$NON-NLS-2$
n.append(name);
} else {
n.append(name);
}
items.add(n.toString());
}
builder.setItems(items.toArray(new String[items.size()]), new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
if(which >= 0){
TransportStop stop = stops.get(which);
showContextMenuOnStop(stop, item, which);
}
}
});
builder.show();
}
public void showContextMenuOnStop(final TransportStop stop, final RouteInfoLocation route, final int stopInd) {
Builder b = new AlertDialog.Builder(getActivity());
b.setItems(new String[] { getString(R.string.transport_finish_search), getString(R.string.transport_search_before), getString(R.string.transport_search_after) },
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int currentRouteCalculation = getCurrentRouteLocation();
route.setStop(stop);
route.setStopNumbers(stopInd);
if (which == 0) {
intermediateListAdapater.insert(route, currentRouteCalculation);
intermediateListAdapater.remove(null);
currentRouteCalculation = -1;
} else if (which == 1) {
intermediateListAdapater.insert(route, currentRouteCalculation + 1);
} else if (which == 2) {
intermediateListAdapater.insert(route, currentRouteCalculation);
}
// layout
zoom = initialZoom;
searchTransport();
}
});
b.show();
}
public void showContextMenuOnRoute(final RouteInfoLocation route, final int routeInd) {
Builder b = new AlertDialog.Builder(getActivity());
List<TransportStop> stops = route.getDirection() ? route.getRoute().getForwardStops() : route.getRoute().getBackwardStops();
boolean en = settings.usingEnglishNames();
String info = getInformation(route, stops, routeInd, false);
StringBuilder txt = new StringBuilder(300);
txt.append(info);
boolean start = false;
for(TransportStop s : stops){
if(s == route.getStart()){
start = true;
}
if(start){
txt.append("\n").append(getString(R.string.transport_Stop)).append(" : ").append(s.getName(en)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(s == route.getStop()){
break;
}
}
b.setMessage(txt.toString());
b.setPositiveButton(getString(R.string.shared_string_ok), null);
b.setNeutralButton(getString(R.string.transport_search_before), new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
int toInsert = routeInd;
int c = getCurrentRouteLocation();
if(c >= 0 && c < routeInd){
toInsert --;
}
intermediateListAdapater.remove(null);
intermediateListAdapater.insert(null, toInsert);
zoom = initialZoom;
searchTransport();
}
});
b.setNegativeButton(getString(R.string.transport_search_after), new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
int toInsert = routeInd;
int c = getCurrentRouteLocation();
if(c > routeInd || c == -1){
toInsert ++;
}
intermediateListAdapater.remove(null);
intermediateListAdapater.insert(null, toInsert);
zoom = initialZoom;
searchTransport();
}
});
b.show();
}
public int getCurrentRouteLocation(){
return intermediateListAdapater.getPosition(null);
}
public boolean isRouteCalculated(){
return getCurrentRouteLocation() == -1;
}
public LatLon getLocationToStart() {
return getEndStop(getCurrentRouteLocation() - 1);
}
public LatLon getLocationToGo() {
return getStartStop(getCurrentRouteLocation() + 1);
}
public LatLon getStartStop(int position){
if(position == intermediateListAdapater.getCount()){
return selectedDestinationLocation;
}
RouteInfoLocation item = intermediateListAdapater.getItem(position);
if(item == null){
return getStartStop(position + 1);
}
return item.getStart().getLocation();
}
public LatLon getEndStop(int position){
if(position < 0){
return lastKnownMapLocation;
}
RouteInfoLocation item = intermediateListAdapater.getItem(position);
if(item == null){
return getEndStop(position -1);
}
return item.getStop().getLocation();
}
class TransportStopAdapter extends ArrayAdapter<RouteInfoLocation> {
private List<RouteInfoLocation> model;
TransportStopAdapter(List<RouteInfoLocation> list) {
super(getActivity(), R.layout.search_transport_list_item, list);
model = list;
}
public void setNewModel(List<RouteInfoLocation> stopsList) {
this.model = stopsList;
setNotifyOnChange(false);
stopsAdapter.clear();
for (RouteInfoLocation obj : stopsList) {
this.add(obj);
}
setNotifyOnChange(true);
this.notifyDataSetChanged();
}
public List<RouteInfoLocation> getModel() {
return model;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
LayoutInflater inflater = getActivity().getLayoutInflater();
row = inflater.inflate(R.layout.search_transport_list_item, parent, false);
}
LatLon locationToGo = getLocationToGo();
LatLon locationToStart = getLocationToStart();
TextView label = (TextView) row.findViewById(R.id.label);
ImageView icon = (ImageView) row.findViewById(R.id.search_icon);
RouteInfoLocation stop = getItem(position);
TransportRoute route = stop.getRoute();
StringBuilder labelW = new StringBuilder(150);
labelW.append(route.getType()).append(" ").append(route.getRef()); //$NON-NLS-1$
labelW.append(" - ["); //$NON-NLS-1$
if (locationToGo != null) {
labelW.append(OsmAndFormatter.getFormattedDistance(stop.getDistToLocation(), getApplication()));
} else {
labelW.append(getString(R.string.shared_string_none));
}
labelW.append("]\n").append(route.getName(settings.usingEnglishNames())); //$NON-NLS-1$
if (locationToGo != null && stop.getDistToLocation() < 400) {
// icon.setImageResource(R.drawable.opened_poi);
} else {
// icon.setImageResource(R.drawable.poi);
}
int dist = locationToStart == null ? 0 : (int) (MapUtils.getDistance(stop.getStart().getLocation(), locationToStart));
String distance = OsmAndFormatter.getFormattedDistance(dist, getApplication()) + " "; //$NON-NLS-1$
label.setText(distance + labelW, TextView.BufferType.SPANNABLE);
((Spannable) label.getText()).setSpan(new ForegroundColorSpan(getResources().getColor(R.color.color_distance)), 0, distance.length() - 1, 0);
return (row);
}
}
class TransportRouteAdapter extends ArrayAdapter<RouteInfoLocation> {
TransportRouteAdapter(List<RouteInfoLocation> list) {
super(getActivity(), R.layout.search_transport_route_item, list);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View row = convertView;
final RouteInfoLocation info = getItem(position);
if(info == null){
TextView text = new TextView(getContext());
LatLon st = getStartStop(position + 1);
LatLon end = getEndStop(position - 1);
if(st != null && end != null){
int dist = (int) MapUtils.getDistance(st, end);
text.setText(MessageFormat.format(getString(R.string.transport_searching_route), OsmAndFormatter.getFormattedDistance(dist, getApplication())));
} else {
text.setText(getString(R.string.transport_searching_transport));
}
text.setTextSize(21);
text.setTypeface(null, Typeface.ITALIC);
text.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
if(intermediateListAdapater.getCount() > 1){
intermediateListAdapater.remove(null);
searchTransport();
} else {
if(selectedDestinationLocation == null){
selectedDestinationLocation = destinationLocation;
} else {
selectedDestinationLocation = null;
}
searchTransport();
}
}
});
return text;
}
int currentRouteLocation = getCurrentRouteLocation();
if (row == null || row instanceof TextView) {
LayoutInflater inflater = getActivity().getLayoutInflater();
row = inflater.inflate(R.layout.search_transport_route_item, parent, false);
}
TextView label = (TextView) row.findViewById(R.id.label);
ImageButton icon = (ImageButton) row.findViewById(R.id.remove);
TransportRoute route = info.getRoute();
icon.setVisibility(View.VISIBLE);
StringBuilder labelW = new StringBuilder(150);
labelW.append(route.getType()).append(" ").append(route.getRef()); //$NON-NLS-1$
boolean en = settings.usingEnglishNames();
labelW.append(" : ").append(info.getStart().getName(en)).append(" - ").append(info.getStop().getName(en)); //$NON-NLS-1$ //$NON-NLS-2$
// additional information if route is calculated
if (currentRouteLocation == -1) {
labelW.append(" ("); //$NON-NLS-1$
labelW.append(info.getStopNumbers()).append(" ").append(getString(R.string.transport_stops)).append(", "); //$NON-NLS-1$ //$NON-NLS-2$
int startDist = (int) MapUtils.getDistance(getEndStop(position - 1), info.getStart().getLocation());
labelW.append(getString(R.string.transport_to_go_before)).append(" ").append(OsmAndFormatter.getFormattedDistance(startDist, getApplication())); //$NON-NLS-1$
if (position == getCount() - 1) {
LatLon stop = getStartStop(position + 1);
if(stop != null) {
int endDist = (int) MapUtils.getDistance(stop, info.getStop().getLocation());
labelW.append(", ").append(getString(R.string.transport_to_go_after)).append(" ").append(OsmAndFormatter.getFormattedDistance(endDist, getApplication())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
labelW.append(")"); //$NON-NLS-1$
}
label.setText(labelW.toString());
icon.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
int p = position;
intermediateListAdapater.remove(null);
if(!isRouteCalculated() && getCurrentRouteLocation() < p){
p--;
}
intermediateListAdapater.insert(null, p);
intermediateListAdapater.remove(info);
intermediateListAdapater.notifyDataSetChanged();
zoom = initialZoom;
searchTransport();
}
});
View.OnClickListener clickListener = new View.OnClickListener(){
@Override
public void onClick(View v) {
showContextMenuOnRoute(info, position);
}
};
label.setOnClickListener(clickListener);
return row;
}
}
@Override
public void onCreateOptionsMenu(Menu onCreate, MenuInflater inflater) {
if(getActivity() instanceof SearchActivity) {
((SearchActivity) getActivity()).getClearToolbar(false);
}
}
}

View file

@ -1254,8 +1254,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
@Override
public int getLogoResourceId() {
// TODO
return super.getLogoResourceId();
return R.drawable.ic_action_audio_dark;
}
@Override

View file

@ -32,12 +32,12 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
/**
* Created by Denis
* on 18.02.2015.
* Created by Denis on 18.02.2015.
*/
public class NotesFragment extends ListFragment {
AudioVideoNotesPlugin plugin;
@ -73,7 +73,6 @@ public class NotesFragment extends ListFragment {
super.onPause();
}
public OsmandApplication getMyApplication() {
return (OsmandApplication) getActivity().getApplication();
}
@ -95,6 +94,8 @@ public class NotesFragment extends ListFragment {
final AudioVideoNotesPlugin.Recording recording = getItem(position);
Drawable icon = DashAudioVideoNotesFragment.getNoteView(recording, row, getMyApplication());
icon.setColorFilter(getResources().getColor(R.color.color_distance), Mode.MULTIPLY);
((ImageView) row.findViewById(R.id.play)).setImageDrawable(getMyApplication().getIconsCache()
.getContentIcon(R.drawable.ic_play_dark));
row.findViewById(R.id.play).setVisibility(View.GONE);
ImageButton options = (ImageButton) row.findViewById(R.id.options);
options.setOnClickListener(new View.OnClickListener() {
@ -128,13 +129,9 @@ public class NotesFragment extends ListFragment {
boolean isPhoto = recording.isPhoto();
Drawable playIcon;
if (isPhoto) {
playIcon = getResources().getDrawable(R.drawable.ic_action_view);
if(light) {
playIcon = playIcon.mutate();
playIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), Mode.MULTIPLY);
}
playIcon = getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_view);
} else {
playIcon = getResources().getDrawable(light ? R.drawable.ic_play_light : R.drawable.ic_play_dark);
playIcon = getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_play_dark);
}
item = optionsMenu.getMenu().add(isPhoto ? R.string.watch : R.string.recording_context_menu_play)
.setIcon(playIcon);
@ -151,8 +148,7 @@ public class NotesFragment extends ListFragment {
showOnMap = showOnMap.mutate();
showOnMap.setColorFilter(getResources().getColor(R.color.icon_color_light), Mode.MULTIPLY);
}
item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map)
.setIcon(showOnMap);
item = optionsMenu.getMenu().add(R.string.shared_string_show_on_map).setIcon(showOnMap);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -220,8 +216,7 @@ public class NotesFragment extends ListFragment {
private void editNote(final Recording recording) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.shared_string_rename);
final View v = getActivity().getLayoutInflater().inflate(R.layout.note_edit_dialog,
getListView(), false);
final View v = getActivity().getLayoutInflater().inflate(R.layout.note_edit_dialog, getListView(), false);
final EditText editText = (EditText) v.findViewById(R.id.name);
builder.setView(v);
editText.setText(recording.getName(getActivity()));
@ -241,5 +236,4 @@ public class NotesFragment extends ListFragment {
editText.requestFocus();
}
}

View file

@ -63,8 +63,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
@Override
public int getLogoResourceId() {
// TODO
return super.getLogoResourceId();
return R.drawable.ic_action_gps_info;
}
@Override

View file

@ -62,7 +62,6 @@ public class SelectedGPXFragment extends ListFragment {
public static final String ARG_TO_HIDE_CONFIG_BTN = "ARG_TO_HIDE_CONFIG_BTN";
protected OsmandApplication app;
protected SelectedGPXAdapter adapter;
protected boolean lightContent;
protected Activity activity;
private boolean updateEnable;
@ -147,7 +146,6 @@ public class SelectedGPXFragment extends ListFragment {
}
public void setContent() {
lightContent = app.getSettings().isLightContent();
adapter = new SelectedGPXAdapter(new ArrayList<GpxSelectionHelper.GpxDisplayItem>());
updateContent();
setListAdapter(adapter);
@ -403,11 +401,9 @@ public class SelectedGPXFragment extends ListFragment {
icon.setVisibility(View.VISIBLE);
additional.setVisibility(View.INVISIBLE);
if (child.group.getType() == GpxDisplayItemType.TRACK_SEGMENT) {
icon.setImageResource(!lightContent ? R.drawable.ic_action_polygom_dark
: R.drawable.ic_action_polygom_light);
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_polygom_dark));
} else if (child.group.getType() == GpxDisplayItemType.TRACK_ROUTE_POINTS) {
icon.setImageResource(!lightContent ? R.drawable.ic_action_markers_dark
: R.drawable.ic_action_markers_light);
icon.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_action_markers_dark));
} else {
int groupColor = child.group.getColor();
if(child.locationStart != null) {

View file

@ -100,11 +100,13 @@ public class DashOsmEditsFragment extends DashBaseFragment implements OsmEditsUp
@Override
public void onClick(View v) {
boolean poi = point.getGroup() == OsmPoint.Group.POI;
String name = poi ?
((OpenstreetmapPoint) point).getName() : ((OsmNotesPoint) point).getText();
getMyApplication().getSettings().setMapLocationToShow(point.getLatitude(), point.getLongitude(),
15, new PointDescription(poi ? PointDescription.POINT_TYPE_POI : PointDescription.POINT_TYPE_OSM_BUG, name), true,
point); //$NON-NLS-1$
String name = poi ? ((OpenstreetmapPoint) point).getName() : ((OsmNotesPoint) point).getText();
getMyApplication().getSettings().setMapLocationToShow(
point.getLatitude(),
point.getLongitude(),
15,
new PointDescription(poi ? PointDescription.POINT_TYPE_POI
: PointDescription.POINT_TYPE_OSM_BUG, name), true, point); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(getActivity());
}
});

View file

@ -33,8 +33,7 @@ public class SRTMPlugin extends OsmandPlugin {
@Override
public int getLogoResourceId() {
// TODO
return super.getLogoResourceId();
return R.drawable.ic_plugin_srtm;
}
@Override