MarkerDetailActivity: removed leftover statistic functionality.

This commit is contained in:
Dennis Guse
2019-12-23 21:43:00 +01:00
parent 8ece2c8612
commit caddbd8501
2 changed files with 7 additions and 43 deletions
@@ -46,9 +46,6 @@ public class MarkerEditActivity extends AbstractActivity {
private Waypoint waypoint; private Waypoint waypoint;
// UI elements // UI elements
private View statisticsSection;
private EditText statisticsName;
private View waypointSection;
private EditText waypointName; private EditText waypointName;
private AutoCompleteTextView waypointMarkerType; private AutoCompleteTextView waypointMarkerType;
private EditText waypointDescription; private EditText waypointDescription;
@@ -63,10 +60,6 @@ public class MarkerEditActivity extends AbstractActivity {
trackRecordingServiceConnection = new TrackRecordingServiceConnection(this, null); trackRecordingServiceConnection = new TrackRecordingServiceConnection(this, null);
// Setup UI elements // Setup UI elements
statisticsSection = findViewById(R.id.marker_edit_statistics_section);
statisticsName = findViewById(R.id.marker_edit_statistics_name);
waypointSection = findViewById(R.id.marker_edit_waypoint_section);
waypointName = findViewById(R.id.marker_edit_waypoint_name); waypointName = findViewById(R.id.marker_edit_waypoint_name);
waypointMarkerType = findViewById(R.id.marker_edit_waypoint_marker_type); waypointMarkerType = findViewById(R.id.marker_edit_waypoint_marker_type);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.waypoint_types, android.R.layout.simple_dropdown_item_1line); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.waypoint_types, android.R.layout.simple_dropdown_item_1line);
@@ -122,8 +115,6 @@ public class MarkerEditActivity extends AbstractActivity {
}); });
if (newMarker) { if (newMarker) {
statisticsSection.setVisibility(View.GONE);
waypointSection.setVisibility(View.VISIBLE);
int nextWaypointNumber = trackId == -1L ? -1 : new ContentProviderUtils(this).getNextWaypointNumber(trackId); int nextWaypointNumber = trackId == -1L ? -1 : new ContentProviderUtils(this).getNextWaypointNumber(trackId);
if (nextWaypointNumber == -1) { if (nextWaypointNumber == -1) {
nextWaypointNumber = 0; nextWaypointNumber = 0;
@@ -139,16 +130,9 @@ public class MarkerEditActivity extends AbstractActivity {
finish(); finish();
return; return;
} }
boolean statistics = false; //TODO REMOVE waypointName.setText(waypoint.getName());
statisticsSection.setVisibility(statistics ? View.VISIBLE : View.GONE); waypointMarkerType.setText(waypoint.getCategory());
waypointSection.setVisibility(statistics ? View.GONE : View.VISIBLE); waypointDescription.setText(waypoint.getDescription());
if (statistics) {
statisticsName.setText(waypoint.getName());
} else {
waypointName.setText(waypoint.getName());
waypointMarkerType.setText(waypoint.getCategory());
waypointDescription.setText(waypoint.getDescription());
}
} }
} }
@@ -167,14 +151,10 @@ public class MarkerEditActivity extends AbstractActivity {
* Saves a marker. * Saves a marker.
*/ */
private void saveMarker() { private void saveMarker() {
boolean statistics = false; //TODO REMOVE waypoint.setName(waypointName.getText().toString());
if (statistics) { waypoint.setCategory(waypointMarkerType.getText().toString());
waypoint.setName(statisticsName.getText().toString()); waypoint.setDescription(waypointDescription.getText().toString());
} else {
waypoint.setName(waypointName.getText().toString());
waypoint.setCategory(waypointMarkerType.getText().toString());
waypoint.setDescription(waypointDescription.getText().toString());
}
new ContentProviderUtils(this).updateWaypoint(waypoint); new ContentProviderUtils(this).updateWaypoint(waypoint);
} }
} }
-16
View File
@@ -33,22 +33,6 @@ limitations under the License.
android:text="@string/generic_name" /> android:text="@string/generic_name" />
<LinearLayout <LinearLayout
android:id="@+id/marker_edit_statistics_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<EditText
android:id="@+id/marker_edit_statistics_name"
style="@style/EditNameMarker"
android:drawableLeft="@drawable/ic_marker_blue_pushpin"
android:hint="@string/generic_name"
android:imeOptions="actionDone"
android:importantForAutofill="no" />
</LinearLayout>
<LinearLayout
android:id="@+id/marker_edit_waypoint_section"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">