My places refactoring in progress
This commit is contained in:
parent
c3236535f3
commit
9deaf35b40
4 changed files with 42 additions and 37 deletions
|
@ -5,7 +5,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/expandable_list_item_background"
|
||||
android:minHeight="@dimen/list_item_height"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
|
@ -16,14 +17,14 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/check_local_index"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/local_index_check_right_margin"
|
||||
android:layout_marginTop="@dimen/favorites_icon_top_margin"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
@ -32,7 +33,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginTop="@dimen/favorites_icon_top_margin"
|
||||
android:src="@drawable/ic_gpx_track"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
@ -40,7 +40,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/gpx_text_top_margin"
|
||||
android:layout_marginBottom="@dimen/gpx_text_top_margin"
|
||||
android:layout_marginLeft="@dimen/subHeaderMarginLeft"
|
||||
android:layout_marginRight="@dimen/showAllButtonMarginRight"
|
||||
android:layout_weight="1"
|
||||
|
@ -49,7 +50,6 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_marginTop="@dimen/gpx_text_top_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
|
@ -63,22 +63,6 @@
|
|||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/points_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/gpx_small_icon_margin"
|
||||
android:src="@drawable/ic_small_point"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/points_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/gpx_small_text_margin"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/distance_icon"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -95,6 +79,22 @@
|
|||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/points_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/gpx_small_icon_margin"
|
||||
android:src="@drawable/ic_small_point"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/points_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/gpx_small_text_margin"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/time_icon"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -143,7 +143,6 @@
|
|||
android:id="@+id/show_on_map"
|
||||
android:layout_width="@dimen/list_item_height"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/favorites_icon_right_margin"
|
||||
android:background="?attr/dashboard_button"
|
||||
android:src="@drawable/ic_action_gsave_dark"
|
||||
|
@ -154,7 +153,6 @@
|
|||
android:id="@+id/stop"
|
||||
android:layout_width="@dimen/list_item_height"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/dashboard_button"
|
||||
android:src="@drawable/ic_action_rec_stop"
|
||||
android:visibility="gone"
|
||||
|
@ -170,12 +168,19 @@
|
|||
android:src="@drawable/ic_overflow_menu_white"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<include android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
layout="@layout/check_item_rel"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/check_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/list_content_padding">
|
||||
|
||||
<include android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/check_item_rel"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -25,7 +25,7 @@ public abstract class OsmandBaseExpandableListAdapter extends BaseExpandableList
|
|||
protected void setCategoryIcon(OsmandApplication app, int resId, int groupPosition, boolean isExpanded, View row, boolean light) {
|
||||
ImageView icon = (ImageView) row.findViewById(R.id.category_icon);
|
||||
if (resId == 0) {
|
||||
icon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_folder, light));
|
||||
icon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_folder_stroke, light));
|
||||
} else {
|
||||
icon.setImageDrawable(app.getIconsCache().getIcon(resId, light));
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ public class ShowRouteInfoDialogFragment extends DialogFragment {
|
|||
String min = OsmAndFormatter.getFormattedAlt(analysis.minElevation, app);
|
||||
String max = OsmAndFormatter.getFormattedAlt(analysis.maxElevation, app);
|
||||
((TextView) headerView.findViewById(R.id.range_text))
|
||||
.setText(min + " " + max);
|
||||
.setText(min + " - " + max);
|
||||
|
||||
String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app);
|
||||
String desc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationDown, app);
|
||||
|
|
|
@ -277,7 +277,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
v.findViewById(R.id.divider).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.options).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.stop).setVisibility(View.VISIBLE);
|
||||
v.findViewById(R.id.toggle_item).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -807,10 +807,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
|
||||
final CompoundButton checkItem = (CompoundButton) v.findViewById(R.id.toggle_item);
|
||||
if (isSelectedGroup(groupPosition)) {
|
||||
checkItem.setVisibility(View.VISIBLE);
|
||||
v.findViewById(R.id.check_item).setVisibility(View.VISIBLE);
|
||||
v.findViewById(R.id.options).setVisibility(View.GONE);
|
||||
} else {
|
||||
checkItem.setVisibility(View.GONE);
|
||||
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1290,7 +1290,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
// ImageView icon = (ImageView) v.findViewById(!isDashItem? R.id.icon : R.id.show_on_map);
|
||||
ImageView icon = (ImageView) v.findViewById(R.id.icon);
|
||||
icon.setVisibility(View.VISIBLE);
|
||||
icon.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_gpx_track));
|
||||
icon.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_polygom_dark));
|
||||
if (child.isCorrupted()) {
|
||||
viewName.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
|
||||
} else {
|
||||
|
@ -1300,7 +1300,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
selectedGpxHelper.getSelectedFileByName(child.getFileName());
|
||||
GPXTrackAnalysis analysis = null;
|
||||
if (sgpx != null) {
|
||||
icon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_gpx_track, R.color.color_distance));
|
||||
icon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_polygom_dark, R.color.color_distance));
|
||||
analysis = sgpx.getTrackAnalysis();
|
||||
|
||||
}
|
||||
|
@ -1361,6 +1361,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
TextView descr = ((TextView) v.findViewById(R.id.description));
|
||||
descr.setVisibility(View.GONE);
|
||||
|
||||
v.findViewById(R.id.toggle_item).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue