Change the button in the context menu of the marker
This commit is contained in:
parent
bb244c03d3
commit
1ab34b31d9
5 changed files with 38 additions and 3 deletions
14
OsmAnd/res/drawable/passed_icon_dark.xml
Normal file
14
OsmAnd/res/drawable/passed_icon_dark.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<inset
|
||||
android:insetRight="@dimen/context_menu_first_line_top_margin">
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/osmand_orange"/>
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
<item android:drawable="@drawable/ic_action_marker_passed"/>
|
||||
</layer-list>
|
14
OsmAnd/res/drawable/passed_icon_light.xml
Normal file
14
OsmAnd/res/drawable/passed_icon_light.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<inset
|
||||
android:insetRight="@dimen/context_menu_first_line_top_margin">
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/map_widget_blue"/>
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
<item android:drawable="@drawable/ic_action_marker_passed"/>
|
||||
</layer-list>
|
|
@ -9,6 +9,7 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="mark_passed">Mark passed</string>
|
||||
<string name="import_gpx_file_description">can be imported as Favorites points, or as track file.</string>
|
||||
<string name="import_as_gpx">Import as GPX file</string>
|
||||
<string name="import_as_favorites">Import as Favorites</string>
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.LinearLayout;
|
||||
|
@ -495,10 +496,14 @@ public abstract class MenuController extends BaseMenuController {
|
|||
public boolean needRightText = false;
|
||||
public String rightTextCaption = "";
|
||||
public boolean visible = true;
|
||||
public boolean needColorizeIcon = true;
|
||||
|
||||
public Drawable getLeftIcon() {
|
||||
if (leftIconId != 0) {
|
||||
return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange);
|
||||
if (needColorizeIcon) {
|
||||
return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange);
|
||||
}
|
||||
return ContextCompat.getDrawable(getMapActivity(), leftIconId);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -28,8 +28,9 @@ public class MapMarkerMenuController extends MenuController {
|
|||
getMapActivity().getContextMenu().close();
|
||||
}
|
||||
};
|
||||
leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_remove);
|
||||
leftTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark;
|
||||
leftTitleButtonController.needColorizeIcon = false;
|
||||
leftTitleButtonController.caption = getMapActivity().getString(R.string.mark_passed);
|
||||
leftTitleButtonController.leftIconId = isLight() ? R.drawable.passed_icon_light : R.drawable.passed_icon_dark;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue