Code styling

This commit is contained in:
PavelRatushnyi 2017-09-05 03:41:43 +03:00
parent 91cfaa600c
commit 754427bacb
3 changed files with 681 additions and 679 deletions

View file

@ -1,120 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/split_interval_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/actionBarStyle"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp">
<android.support.v7.widget.Toolbar
android:id="@+id/split_interval_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:minHeight="@dimen/dashboard_map_toolbar"
android:theme="?attr/actionBarStyle"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
tools:text="2017-02-16"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
tools:text="2017-02-16" />
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"
android:indeterminate="true"/>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:indeterminate="true"
android:visibility="gone"
tools:visibility="visible" />
</android.support.v7.widget.Toolbar>
</android.support.v7.widget.Toolbar>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"/>
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp" />
<LinearLayout
android:id="@+id/header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/header_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?attr/bg_color"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?attr/bg_color"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:id="@+id/header_split_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="12dp"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
tools:src="@drawable/ic_action_split_interval"/>
<ImageView
android:id="@+id/header_split_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="12dp"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
tools:src="@drawable/ic_action_split_interval" />
<LinearLayout
android:id="@+id/split_interval_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground">
<LinearLayout
android:id="@+id/split_interval_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/split_interval_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:text="Split interval:"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/split_interval_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
android:text="Split interval:"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/split_interval_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="10 km"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/split_interval_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="@null"
android:gravity="right"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="10 km" />
<ImageView
android:id="@+id/split_interval_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_action_arrow_drop_down"/>
<ImageView
android:id="@+id/split_interval_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_action_arrow_drop_down" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include layout="@layout/card_bottom_divider"/>
<include layout="@layout/card_bottom_divider" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</LinearLayout>

View file

@ -124,7 +124,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
private OsmandApplication app;
private SegmentGPXAdapter adapter;
private GpxDisplayItemType[] filterTypes = { GpxSelectionHelper.GpxDisplayItemType.TRACK_SEGMENT };
private GpxDisplayItemType[] filterTypes = {GpxSelectionHelper.GpxDisplayItemType.TRACK_SEGMENT};
private List<String> options = new ArrayList<>();
private List<Double> distanceSplit = new ArrayList<>();
private TIntArrayList timeSplit = new TIntArrayList();
@ -638,10 +638,10 @@ public class TrackSegmentFragment extends OsmAndListFragment {
public void updateSplitView() {
if (getGpx() != null) {
SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), ((SwitchCompat)headerView.findViewById(R.id.showOnMapToggle)).isChecked(), false);
SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), ((SwitchCompat) headerView.findViewById(R.id.showOnMapToggle)).isChecked(), false);
final List<GpxDisplayGroup> groups = getDisplayGroups();
if (groups.size() > 0) {
updateSplit(groups, ((SwitchCompat)headerView.findViewById(R.id.showOnMapToggle)).isChecked() ? sf : null);
updateSplit(groups, ((SwitchCompat) headerView.findViewById(R.id.showOnMapToggle)).isChecked() ? sf : null);
if (getGpxDataItem() != null) {
updateSplitInDatabase();
}
@ -848,7 +848,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
protected List<GpxDisplayItem> flatten(List<GpxDisplayGroup> groups) {
ArrayList<GpxDisplayItem> list = new ArrayList<>();
for(GpxDisplayGroup g : groups) {
for (GpxDisplayGroup g : groups) {
list.addAll(g.getModifiableList());
}
return list;
@ -1644,7 +1644,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
@Override
public void select(View tab) {
GPXTabItemType tabType = GPXTabItemType.valueOf((String)tab.getTag());
GPXTabItemType tabType = GPXTabItemType.valueOf((String) tab.getTag());
ImageView img = (ImageView) tab.findViewById(R.id.tab_image);
int imageId = getImageId(tabType);
switch (tabs.getTabSelectionType()) {
@ -1659,7 +1659,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
@Override
public void deselect(View tab) {
GPXTabItemType tabType = GPXTabItemType.valueOf((String)tab.getTag());
GPXTabItemType tabType = GPXTabItemType.valueOf((String) tab.getTag());
ImageView img = (ImageView) tab.findViewById(R.id.tab_image);
int imageId = getImageId(tabType);
switch (tabs.getTabSelectionType()) {
@ -1814,8 +1814,10 @@ public class TrackSegmentFragment extends OsmAndListFragment {
private class SplitTrackAsyncTask extends AsyncTask<Void, Void, Void> {
@Nullable
private final SelectedGpxFile mSelectedGpxFile;
@NonNull private final TrackSegmentFragment mFragment;
@NonNull private final TrackActivity mActivity;
@NonNull
private final TrackSegmentFragment mFragment;
@NonNull
private final TrackActivity mActivity;
private final List<GpxDisplayGroup> groups;