Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
44c354fd3e
4 changed files with 45 additions and 13 deletions
|
@ -10,10 +10,12 @@
|
|||
android:layout_marginBottom="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/firstCellContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -39,10 +41,12 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/secondCellContainer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
android:id="@+id/context_menu_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -26,6 +25,7 @@
|
|||
android:id="@+id/context_menu_top_shadow_all"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:background="?attr/bg_map_context_menu"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
@ -189,7 +189,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicLis
|
|||
toolbar = ((Toolbar) dashboardView.findViewById(R.id.toolbar));
|
||||
ObservableScrollView scrollView = ((ObservableScrollView) dashboardView.findViewById(R.id.main_scroll));
|
||||
listView = (ListView) dashboardView.findViewById(R.id.dash_list_view);
|
||||
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
//listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
|
||||
listView.setDrawSelectorOnTop(true);
|
||||
((DynamicListView) listView).setDynamicListViewCallbacks(this);
|
||||
|
||||
// Create a ListView-specific touch listener. ListViews are given special treatment because
|
||||
|
|
|
@ -176,6 +176,23 @@ public class WaypointDialogHelper {
|
|||
return new StableArrayAdapter(ctx,
|
||||
R.layout.waypoint_reached, R.id.title, points, activePoints) {
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(int position) {
|
||||
Object obj = getItem(position);
|
||||
boolean labelView = (obj instanceof Integer);
|
||||
boolean topDividerView = (obj instanceof Boolean) && ((Boolean) obj);
|
||||
boolean bottomDividerView = (obj instanceof Boolean) && !((Boolean) obj);
|
||||
|
||||
boolean enabled = !labelView && !topDividerView && !bottomDividerView;
|
||||
|
||||
if (enabled && obj instanceof RadiusItem) {
|
||||
int type = ((RadiusItem) obj).type;
|
||||
enabled = type != WaypointHelper.POI;
|
||||
}
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
// User super class to create the View
|
||||
|
@ -284,7 +301,7 @@ public class WaypointDialogHelper {
|
|||
((TextView) v.findViewById(R.id.titleEx)).setText(ctx.getString(R.string.shared_string_type) + ":");
|
||||
final TextView radiusEx = (TextView) v.findViewById(R.id.descriptionEx);
|
||||
radiusEx.setText(descEx);
|
||||
radiusEx.setOnClickListener(new View.OnClickListener() {
|
||||
v.findViewById(R.id.secondCellContainer).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
running[0] = position;
|
||||
|
@ -301,20 +318,30 @@ public class WaypointDialogHelper {
|
|||
}
|
||||
|
||||
});
|
||||
AndroidUtils.setTextPrimaryColor(mapActivity, (TextView) v.findViewById(R.id.title), nightMode);
|
||||
final TextView radius = (TextView) v.findViewById(R.id.description);
|
||||
radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(type), app));
|
||||
v.findViewById(R.id.firstCellContainer).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
selectDifferentRadius(type, running, position, thisAdapter, mapActivity);
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
v = ctx.getLayoutInflater().inflate(R.layout.drawer_list_radius, null);
|
||||
((TextView) v.findViewById(R.id.title)).setText(ctx.getString(R.string.search_radius_proximity));
|
||||
}
|
||||
AndroidUtils.setTextPrimaryColor(mapActivity, (TextView) v.findViewById(R.id.title), nightMode);
|
||||
final TextView radius = (TextView) v.findViewById(R.id.description);
|
||||
radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(type), app));
|
||||
radius.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
selectDifferentRadius(type, running, position, thisAdapter, mapActivity);
|
||||
}
|
||||
AndroidUtils.setTextPrimaryColor(mapActivity, (TextView) v.findViewById(R.id.title), nightMode);
|
||||
final TextView radius = (TextView) v.findViewById(R.id.description);
|
||||
radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(type), app));
|
||||
radius.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
selectDifferentRadius(type, running, position, thisAdapter, mapActivity);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue