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

View file

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

View file

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