Added navigate to button for favorite at dashboard
Before Width: | Height: | Size: 642 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 1.4 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_action_gdirections_dark.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_action_gdirections_light.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
|
@ -19,8 +19,9 @@
|
|||
android:layout_height="28dp"/>
|
||||
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView android:id="@+id/name"
|
||||
android:textSize="16sp"
|
||||
|
@ -33,6 +34,13 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton android:id="@+id/navigate_to"
|
||||
android:src="@drawable/ic_action_gdirections_light"
|
||||
android:background="@drawable/dashboard_button"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.osmand.plus.OsmAndFormatter;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
|
@ -101,6 +102,12 @@ public class DashFavoritesFragment extends DashBaseFragment {
|
|||
int dist = (int) (MapUtils.getDistance(point.getLatitude(), point.getLongitude(),
|
||||
lastKnownMapLocation.getLatitude(), lastKnownMapLocation.getLongitude()));
|
||||
String distance = OsmAndFormatter.getFormattedDistance(dist, getMyApplication()) + " ";
|
||||
view.findViewById(R.id.navigate_to).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
DirectionsDialogs.directionsToDialogAndLaunchMap(getActivity(), point.getLatitude(), point.getLongitude(), point.getName());
|
||||
}
|
||||
});
|
||||
label.setText(distance, TextView.BufferType.SPANNABLE);
|
||||
label.setTypeface(Typeface.DEFAULT, point.isVisible() ? Typeface.NORMAL : Typeface.ITALIC);
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
|
|