From 51bfe9503e9e21340b7811bfbdaea70d4468403f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20B=C3=B6rnert?= Date: Wed, 9 May 2018 13:33:25 +0200 Subject: [PATCH 01/21] bug4566 do not underline the boat column in the compact version with the competitor color --- .../sailing/gwt/ui/leaderboard/LeaderboardPanel.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboard/LeaderboardPanel.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboard/LeaderboardPanel.java index bf2e3a652fb..8b3726daebe 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboard/LeaderboardPanel.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboard/LeaderboardPanel.java @@ -928,11 +928,9 @@ public abstract class LeaderboardPanel extends A */ private class BoatInfoColumn extends LeaderboardSortableColumnWithMinMax { private final BoatFetcher boatFetcher; - private final CompetitorFetcher competitorFetcher; - public BoatInfoColumn(CompetitorFetcher competitorFetcher, BoatFetcher boatFetcher, LeaderBoardStyle style) { + public BoatInfoColumn(BoatFetcher boatFetcher, LeaderBoardStyle style) { super(new TextCell(), SortingOrder.ASCENDING, LeaderboardPanel.this); - this.competitorFetcher = competitorFetcher; this.boatFetcher = boatFetcher; // This style is adding to avoid contained images CSS property "max-width: 100%", which could cause // an overflow to the next column (see https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=3537) @@ -948,12 +946,7 @@ public abstract class LeaderboardPanel extends A @Override public void render(Context context, T object, SafeHtmlBuilder sb) { BoatDTO boat = boatFetcher.getBoat(object); - CompetitorDTO competitor = competitorFetcher.getCompetitor(object); - boolean boatColorShown = renderBoatColorIfNecessary(competitor, sb); sb.appendEscaped(getShortInfo(boat)); - if (boatColorShown) { - sb.appendHtmlConstant(""); - } } private String getShortInfo(BoatDTO boat) { @@ -3181,9 +3174,8 @@ public abstract class LeaderboardPanel extends A if (getLeaderboardTable().getColumnCount() <= columnIndexWhereToInsertTheNextColumn || !(getLeaderboardTable() .getColumn(columnIndexWhereToInsertTheNextColumn) instanceof LeaderboardPanel.BoatInfoColumn)) { - CompetitorFetcher competitorFetcher = (LeaderboardRowDTO row) -> row.competitor; BoatFetcher boatFetcher = (LeaderboardRowDTO row) -> row.boat; - BoatInfoColumn boatInfoColumn = new BoatInfoColumn(competitorFetcher, boatFetcher, style); + BoatInfoColumn boatInfoColumn = new BoatInfoColumn(boatFetcher, style); insertColumn(columnIndexWhereToInsertTheNextColumn, boatInfoColumn); } columnIndexWhereToInsertTheNextColumn++; From ac29f9cb6b06d0fbad34e59a91563fdfb8cbe120 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Wed, 30 May 2018 08:49:03 +0200 Subject: [PATCH 02/21] =?UTF-8?q?change=20to=20sensor=20orientation,=20so?= =?UTF-8?q?=20the=20device=20can=20be=20rotated=20by=20180=C2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sap/sailing/android/shared/util/AppUtils.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mobile/com.sap.sailing.android.shared/src/com/sap/sailing/android/shared/util/AppUtils.java b/mobile/com.sap.sailing.android.shared/src/com/sap/sailing/android/shared/util/AppUtils.java index 2d982ac227c..bf50986df35 100644 --- a/mobile/com.sap.sailing.android.shared/src/com/sap/sailing/android/shared/util/AppUtils.java +++ b/mobile/com.sap.sailing.android.shared/src/com/sap/sailing/android/shared/util/AppUtils.java @@ -1,9 +1,5 @@ package com.sap.sailing.android.shared.util; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; @@ -16,6 +12,10 @@ import android.util.Log; import com.sap.sailing.android.shared.R; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + public class AppUtils { private final static String TAG = AppUtils.class.getName(); @@ -37,9 +37,9 @@ public class AppUtils { */ public static void lockOrientation(Activity activity) { if (with(activity).isPhone()) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } else { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } } From 44fc2996724c178161dd387a6c5ce753f992681c Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Wed, 30 May 2018 12:19:05 +0200 Subject: [PATCH 03/21] compass view is always a square and images will shrink if needed --- .../res/layout/compass_view.xml | 4 +- .../app/ui/views/CompassView.java | 47 ++++++++++++++----- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/mobile/com.sap.sailing.racecommittee.app/res/layout/compass_view.xml b/mobile/com.sap.sailing.racecommittee.app/res/layout/compass_view.xml index 69cfbe2b703..9e9417d3265 100644 --- a/mobile/com.sap.sailing.racecommittee.app/res/layout/compass_view.xml +++ b/mobile/com.sap.sailing.racecommittee.app/res/layout/compass_view.xml @@ -11,6 +11,7 @@ android:layout_centerInParent="true" android:layout_gravity="center" android:contentDescription="@string/compass_view_compass" + android:scaleType="centerInside" android:src="?attr/compass_back" /> - \ No newline at end of file + diff --git a/mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/ui/views/CompassView.java b/mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/ui/views/CompassView.java index e0895e132b9..add1d3a7e83 100644 --- a/mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/ui/views/CompassView.java +++ b/mobile/com.sap.sailing.racecommittee.app/src/com/sap/sailing/racecommittee/app/ui/views/CompassView.java @@ -1,10 +1,12 @@ package com.sap.sailing.racecommittee.app.ui.views; +import android.annotation.SuppressLint; import android.content.Context; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.AttributeSet; +import android.util.TypedValue; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -19,6 +21,8 @@ import android.widget.TextView; import com.sap.sailing.racecommittee.app.R; +import java.util.Locale; + public class CompassView extends RelativeLayout { private CompassDirectionListener changeListener; @@ -29,19 +33,18 @@ public class CompassView extends RelativeLayout { private float currentDegrees; private Float deferredToDegrees; - public CompassView(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - inflate(); + public CompassView(Context context) { + this(context, null); } public CompassView(Context context, AttributeSet attrs) { - super(context, attrs); - inflate(); + this(context, attrs, 0); } - public CompassView(Context context) { - super(context); - inflate(); + public CompassView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + + LayoutInflater.from(getContext()).inflate(R.layout.compass_view, this); } private float getNeedlePivotX() { @@ -52,9 +55,26 @@ public class CompassView extends RelativeLayout { return needleView.getMeasuredHeight() / 2; } - private void inflate() { - LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - inflater.inflate(R.layout.compass_view, this); + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int widthMode = MeasureSpec.getMode(widthMeasureSpec); + int widthSize = MeasureSpec.getSize(widthMeasureSpec); + int heightMode = MeasureSpec.getMode(heightMeasureSpec); + int heightSize = MeasureSpec.getSize(heightMeasureSpec); + + int size; + if (widthMode == MeasureSpec.EXACTLY && widthSize > 0) { + size = widthSize; + } else if (heightMode == MeasureSpec.EXACTLY && heightSize > 0) { + size = heightSize; + } else { + size = widthSize < heightSize ? widthSize : heightSize; + } + + degreeView.setTextSize(TypedValue.COMPLEX_UNIT_PX, size / 10); + + int finalMeasureSpec = MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY); + super.onMeasure(finalMeasureSpec, finalMeasureSpec); } @Override @@ -70,7 +90,7 @@ public class CompassView extends RelativeLayout { public void onImeBack(BackAwareEditText editText) { float degree = currentDegrees > 0 ? currentDegrees : currentDegrees + 360; degreeView.clearFocus(); - degreeView.setText(String.format("%.0f°", degree)); + degreeView.setText(String.format(Locale.getDefault(), "%.0f°", degree)); degreeValue.setText(degreeView.getText()); } }); @@ -117,6 +137,7 @@ public class CompassView extends RelativeLayout { dialog.show(); } + @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouchEvent(MotionEvent event) { float rotateX = (-1) * (event.getY() - needleView.getY() - getNeedlePivotY()); @@ -166,7 +187,7 @@ public class CompassView extends RelativeLayout { if (degree >= 359.5f) { degree = 0; } - degreeView.setText(String.format("%.0f°", degree)); + degreeView.setText(String.format(Locale.getDefault(), "%.0f°", degree)); degreeValue.setText(degreeView.getText()); } } From e2261833d18294aa680391e52ad8a20f9fc996e0 Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Fri, 8 Jun 2018 11:43:07 +0200 Subject: [PATCH 04/21] fixed course by marks designer --- .../race_schedule_course_marks_xlarge.xml | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/mobile/com.sap.sailing.racecommittee.app/res/layout/race_schedule_course_marks_xlarge.xml b/mobile/com.sap.sailing.racecommittee.app/res/layout/race_schedule_course_marks_xlarge.xml index a38d5b76f20..7195e381d3a 100644 --- a/mobile/com.sap.sailing.racecommittee.app/res/layout/race_schedule_course_marks_xlarge.xml +++ b/mobile/com.sap.sailing.racecommittee.app/res/layout/race_schedule_course_marks_xlarge.xml @@ -46,52 +46,54 @@ android:textStyle="bold" /> - - + android:text="@string/take_previous" /> -