Small fixes

This commit is contained in:
Victor Shcherb 2015-03-19 01:52:33 +01:00
parent 4f4ce9eb48
commit 4485c92b58
3 changed files with 29 additions and 28 deletions

View file

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/card_bg"
android:orientation="vertical">
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/dashHeaderHeight">
android:layout_height="@dimen/dashHeaderHeight" >
<TextView
android:id="@+id/search_for"
@ -17,21 +16,23 @@
android:layout_width="wrap_content"
android:text="@string/search_for" />
<Button
<net.osmand.plus.widgets.ButtonEx
android:id="@+id/recents"
style="?attr/dashboardGeneralButtonStyle"
android:text="@string/shared_string_history" />
android:text="@string/shared_string_history"
osmand:textAllCapsCompat="true"
osmand:typeface="@string/font_roboto_medium" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider" />
android:background="?attr/dashboard_divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dashSearchBtnHeight"
android:orientation="horizontal">
android:orientation="horizontal" >
<Button
android:id="@+id/poi"
@ -42,22 +43,22 @@
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?attr/dashboard_divider" />
android:background="?attr/dashboard_divider" />
<Button
android:id="@+id/address"
style="?attr/dashboardSearchButtonStyle"
style="?attr/dashboardSearchButtonStyle"
android:drawableTop="?attr/ic_action_home2"
android:text="@string/address" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?attr/dashboard_divider" />
android:background="?attr/dashboard_divider" />
<Button
android:id="@+id/coord"
style="?attr/dashboardSearchButtonStyle"
style="?attr/dashboardSearchButtonStyle"
android:drawableTop="?attr/ic_action_marker2"
android:text="@string/coordinates" />
</LinearLayout>

View file

@ -139,8 +139,8 @@ public class DashWaypointsFragment extends DashLocationFragment {
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
MenuItem
item = optionsMenu.getMenu().add(
R.string.shared_string_add_to_favorites).setIcon(light ?
R.drawable.ic_action_fav_light : R.drawable.ic_action_fav_dark);
R.string.shared_string_add_to_favorites).setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_fav_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -158,7 +158,8 @@ public class DashWaypointsFragment extends DashLocationFragment {
if (model.index > 0 || target) {
final int ind = target ? allTargets.size() - 1 : model.index;
item = optionsMenu.getMenu().add(R.string.waypoint_visit_before)
.setIcon(light ? R.drawable.ic_action_up_light : R.drawable.ic_action_up_dark);
.setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_up_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -172,7 +173,8 @@ public class DashWaypointsFragment extends DashLocationFragment {
}
if (!target) {
item = optionsMenu.getMenu().add(R.string.waypoint_visit_after)
.setIcon(light ? R.drawable.ic_action_down_light : R.drawable.ic_action_down_dark);
.setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_down_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@ -186,8 +188,8 @@ public class DashWaypointsFragment extends DashLocationFragment {
}
}
item = optionsMenu.getMenu().add(
R.string.shared_string_delete).setIcon(light ?
R.drawable.ic_action_gdiscard_light: R.drawable.ic_action_gdiscard_dark);
R.string.shared_string_delete).setIcon(getMyApplication().getIconsCache().
getContentIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -19,18 +19,19 @@ import android.widget.TextView;
/**
*/
public class DashSimulateFragment extends DashBaseFragment {
public class DashSimulateFragment extends DashBaseFragment {
public static final String TAG = "DASH_SIMULATE_FRAGMENT";
@Override
public void onOpenDash() {
OsmAndLocationProvider loc = getMyApplication().getLocationProvider();
boolean routeAnimating = loc.getLocationSimulation().isRouteAnimating();
((TextView) getView().findViewById(R.id.name)).setText(routeAnimating ? R.string.animate_route_off
: R.string.animate_route);
((ImageButton) getView().findViewById(R.id.stop)).setImageDrawable(getActivity().getResources().getDrawable(
!routeAnimating ? R.drawable.ic_action_play_dark : R.drawable.ic_action_rec_stop));
((ImageButton) getView().findViewById(R.id.stop)).setImageDrawable(
!routeAnimating ? getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_play_dark)
: getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_rec_stop));
}
@ -45,10 +46,10 @@ public class DashSimulateFragment extends DashBaseFragment {
tracks.addView(item);
final OsmAndLocationProvider loc = getMyApplication().getLocationProvider();
OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
if(getActivity() instanceof MapActivity) {
if (getActivity() instanceof MapActivity) {
loc.getLocationSimulation().startStopRouteAnimation((MapActivity) getActivity());
dashboard.setDashboardVisibility(false);
}
@ -62,7 +63,4 @@ public class DashSimulateFragment extends DashBaseFragment {
return view;
}
}