Added divider for current track on dashboard. Updated my places grop item. Added compound button for selected track. Updated track view.
This commit is contained in:
parent
3ffb458e42
commit
2fb513c558
6 changed files with 68 additions and 38 deletions
|
@ -67,7 +67,6 @@
|
|||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/expandable_list_background"
|
||||
android:groupIndicator="@android:color/transparent"/>
|
||||
|
||||
|
||||
|
|
|
@ -23,46 +23,47 @@
|
|||
android:id="@+id/check_local_index"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"
|
||||
android:layout_marginLeft="@dimen/local_index_check_right_margin"
|
||||
android:layout_marginTop="@dimen/favorites_icon_top_margin"/>
|
||||
android:layout_marginTop="@dimen/favorites_icon_top_margin"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:src="@drawable/ic_gpx_track"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginTop="@dimen/favorites_icon_top_margin"
|
||||
android:focusable="false"/>
|
||||
android:focusable="false"
|
||||
android:src="@drawable/ic_gpx_track"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/subHeaderMarginLeft"
|
||||
android:layout_marginRight="@dimen/showAllButtonMarginRight"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:textSize="@dimen/dashFavNameTextSize"
|
||||
android:layout_marginTop="@dimen/gpx_text_top_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/dashFavNameTextSize"
|
||||
tools:text="@string/validate_gpx_upload_name_pwd"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/read_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/read_section"
|
||||
android:visibility="visible"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/points_icon"
|
||||
|
@ -77,24 +78,24 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/gpx_small_text_margin"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/distance_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/gpx_small_icon_margin"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="@dimen/gpx_small_icon_margin"
|
||||
android:src="@drawable/ic_small_distance"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginRight="@dimen/gpx_small_text_margin"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
android:layout_marginRight="@dimen/gpx_small_text_margin"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/time_icon"
|
||||
|
@ -109,69 +110,71 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/gpx_small_text_margin"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/unknown_section"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/unknown_section"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date_and_size_details"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
android:textColor="?android:textColorSecondary"/>
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/download_descr_text_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/download_descr_text_size"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/stop"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/dashListItemHeight"
|
||||
android:layout_height="@dimen/dashListItemHeight"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?attr/options_button_background"
|
||||
android:src="@drawable/ic_action_rec_stop"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/show_on_map"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:layout_width="@dimen/dashListItemHeight"
|
||||
android:layout_height="@dimen/dashListItemHeight"
|
||||
android:layout_marginLeft="@dimen/favorites_icon_right_margin"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/favorites_icon_right_margin"
|
||||
android:background="?attr/options_button_background"
|
||||
android:src="@drawable/ic_action_gsave_dark"/>
|
||||
android:src="@drawable/ic_action_gsave_dark"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/options"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/list_item_height"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:background="?attr/options_button_background"
|
||||
android:focusable="false"
|
||||
android:src="?attr/list_settings_icon"/>
|
||||
android:src="?attr/list_settings_icon"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<include android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
layout="@layout/check_item_rel"/>
|
||||
|
||||
<!--
|
||||
<include layout="@layout/check_item_rel" />
|
||||
-->
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
style="@style/OsmandListView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/expandable_list_background"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<dimen name="favorite_icon_size">24dp</dimen>
|
||||
<dimen name="gpx_small_icon_margin">3dp</dimen>
|
||||
<dimen name="gpx_small_text_margin">14dp</dimen>
|
||||
<dimen name="gpx_text_top_margin">6dp</dimen>
|
||||
|
||||
<!-- TextSizes -->
|
||||
<dimen name="list_header_text_size">14sp</dimen>
|
||||
|
|
|
@ -66,6 +66,7 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.Filter;
|
||||
|
@ -267,6 +268,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
|
||||
v.findViewById(R.id.options).setVisibility(View.GONE);
|
||||
v.findViewById(R.id.stop).setVisibility(View.VISIBLE);
|
||||
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||
save.setImageDrawable(icon);
|
||||
}
|
||||
|
||||
|
@ -787,6 +789,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
v = inflater.inflate(R.layout.dash_gpx_track_item, parent, false);
|
||||
}
|
||||
udpateGpxInfoView(v, child, app, gpxNormal, gpxOnMap, false);
|
||||
|
||||
ImageView icon = (ImageView) v.findViewById(R.id.icon);
|
||||
ImageButton options = (ImageButton) v.findViewById(R.id.options);
|
||||
options.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -821,6 +824,27 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
options.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
final CompoundButton checkItem = (CompoundButton) v.findViewById(R.id.check_item);
|
||||
if (isSelectedGroup(groupPosition)) {
|
||||
checkItem.setVisibility(View.VISIBLE);
|
||||
v.findViewById(R.id.options).setVisibility(View.GONE);
|
||||
} else {
|
||||
checkItem.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
final SelectedGpxFile selectedGpxFile = selectedGpxHelper.getSelectedFileByName(child.getFileName());
|
||||
checkItem.setChecked(selectedGpxFile != null);
|
||||
checkItem.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (child.gpx != null) {
|
||||
selectedGpxHelper.selectGpxFile(child.gpx, checkItem.isChecked(), false);
|
||||
} else {
|
||||
selectedGpxHelper.getSelectedGPXFiles().remove(selectedGpxFile);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
v.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -1420,6 +1444,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
if (sgpx != null) {
|
||||
icon.setImageDrawable(gpxOnMap);
|
||||
analysis = sgpx.getTrackAnalysis();
|
||||
|
||||
}
|
||||
boolean sectionRead = analysis == null;
|
||||
if (sectionRead) {
|
||||
|
@ -1473,6 +1498,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
} else {
|
||||
descr.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
v.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -140,6 +140,7 @@ public class DashTrackFragment extends DashBaseFragment {
|
|||
AvailableGPXFragment.createCurrentTrackView(view, app);
|
||||
((TextView) view.findViewById(R.id.name)).setText(R.string.currently_recording_track);
|
||||
AvailableGPXFragment.updateCurrentTrack(view, getActivity(), app);
|
||||
view.findViewById(R.id.divider).setVisibility(View.VISIBLE);
|
||||
tracks.addView(view);
|
||||
startHandler(view);
|
||||
|
||||
|
|
Loading…
Reference in a new issue