mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-11 06:40:53 +00:00
show merge error hint in edit dialog
This commit is contained in:
1 parent
257515074a
commit
ad418d25fb
7 files changed
+65
-20
No files matched your search
+19
@@ -1,11 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_warning_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_warning_red"
|
||||
android:gravity="center"
|
||||
android:text="@string/competitor_merge_error_message"
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_position_layout"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
+32
-13
@@ -1,11 +1,30 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_warning_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_warning_red"
|
||||
android:gravity="center"
|
||||
android:text="@string/competitor_merge_error_message"
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_position_layout"
|
||||
@@ -20,14 +39,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/position"
|
||||
android:textColor="@color/dialog_color_text"/>
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/competitor_position"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/spinner_background_light"
|
||||
android:spinnerMode="dropdown"/>
|
||||
android:spinnerMode="dropdown" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -43,14 +62,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/penalty"
|
||||
android:textColor="@color/dialog_color_text"/>
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/competitor_penalty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/spinner_background_light"
|
||||
android:spinnerMode="dropdown"/>
|
||||
android:spinnerMode="dropdown" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -72,7 +91,7 @@
|
||||
android:hint="@string/score"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="?attr/white"
|
||||
android:textColorHint="@color/dialog_color_text"/>
|
||||
android:textColorHint="@color/dialog_color_text" />
|
||||
</com.sap.sailing.racecommittee.app.ui.layouts.FloatLabelLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -90,7 +109,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/finishing_time"
|
||||
android:textColor="@color/dialog_color_text"/>
|
||||
android:textColor="@color/dialog_color_text" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/competitor_finish_time_input"
|
||||
@@ -157,7 +176,7 @@
|
||||
android:hint="@string/comment"
|
||||
android:inputType="text"
|
||||
android:textColor="?attr/white"
|
||||
android:textColorHint="@color/dialog_color_text"/>
|
||||
android:textColorHint="@color/dialog_color_text" />
|
||||
</com.sap.sailing.racecommittee.app.ui.layouts.FloatLabelLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -537,4 +537,6 @@
|
||||
<string name="hello_call_error_positive">Wiederholen</string>
|
||||
<string name="hello_call_error_negative">Beenden</string>
|
||||
|
||||
<string name="competitor_merge_error_message">Dieser Teilnehmer wurde an einem anderen Gerät verändert und hat überschneidende Änderungen. Bitte stellen Sie sicher, dass die Daten korrekt sind.</string>
|
||||
|
||||
</resources>
|
||||
@@ -566,4 +566,6 @@
|
||||
<string name="hello_call_error_positive">Retry</string>
|
||||
<string name="hello_call_error_negative">Exit</string>
|
||||
|
||||
<string name="competitor_merge_error_message">This competitor was changed from another device and you have changed the same data. Please be sure, that this data is correct now.</string>
|
||||
|
||||
</resources>
|
||||
+1
-1
@@ -679,7 +679,7 @@ public class PenaltyFragment extends BaseFragment implements PopupMenu.OnMenuIte
|
||||
builder.setTitle(item.getCompetitorDisplayName());
|
||||
final CompetitorEditLayout layout = new CompetitorEditLayout(getActivity(), item, mCompetitorResults.getFirstRankZeroPosition() +
|
||||
/* allow for setting rank as the new last in the list in case the competitor did not have a rank so far */
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0));
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0), competitor.getMergeState() == MergeState.ERROR);
|
||||
builder.setView(layout);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -730,7 +730,7 @@ public class TrackingListFragment extends BaseFragment
|
||||
final CompetitorEditLayout layout = new CompetitorEditLayout(getActivity(), getRace().getState().getFinishingTime(), item,
|
||||
mAdapter.getFirstRankZeroPosition() +
|
||||
/* allow for setting rank as the new last in the list in case the competitor did not have a rank so far */
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0), false);
|
||||
(item.getOneBasedRank() == 0 ? 1 : 0), false, item.getMergeState() == MergeState.ERROR);
|
||||
builder.setView(layout);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
||||
+8
-5
@@ -49,12 +49,12 @@ public class CompetitorEditLayout extends ScrollView implements DatePickerDialog
|
||||
|
||||
private boolean mRestricted;
|
||||
|
||||
public CompetitorEditLayout(Context context, CompetitorResultWithIdImpl competitor, int maxPos) {
|
||||
this(context, null, competitor, maxPos, true);
|
||||
public CompetitorEditLayout(Context context, CompetitorResultWithIdImpl competitor, int maxPos, boolean hasWarning) {
|
||||
this(context, null, competitor, maxPos, true, hasWarning);
|
||||
}
|
||||
|
||||
public CompetitorEditLayout(final Context context, final TimePoint startTime, CompetitorResultWithIdImpl competitor, int maxPos,
|
||||
boolean restrictedView) {
|
||||
boolean restrictedView, boolean hasWarning) {
|
||||
super(context);
|
||||
|
||||
mRestricted = restrictedView;
|
||||
@@ -74,6 +74,10 @@ public class CompetitorEditLayout extends ScrollView implements DatePickerDialog
|
||||
if (position != null) {
|
||||
position.setVisibility(restrictedView ? GONE : VISIBLE);
|
||||
}
|
||||
View warning = ViewHelper.get(layout, R.id.competitor_warning_message);
|
||||
if (warning != null) {
|
||||
warning.setVisibility(hasWarning ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
mCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
|
||||
if (mCompetitor.getFinishingTime() != null) {
|
||||
@@ -216,8 +220,7 @@ public class CompetitorEditLayout extends ScrollView implements DatePickerDialog
|
||||
comment = mComment.getText().toString();
|
||||
}
|
||||
CompetitorResult result = new CompetitorResultImpl(mCompetitor.getCompetitorId(), mCompetitor
|
||||
.getCompetitorDisplayName(), oneBaseRank, maxPointsReason, score, finishingTime, comment,
|
||||
MergeState.OK);
|
||||
.getCompetitorDisplayName(), oneBaseRank, maxPointsReason, score, finishingTime, comment, MergeState.OK);
|
||||
return new CompetitorResultWithIdImpl(mCompetitor.getId(), result);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user