mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 13:20:57 +00:00
Merge branch 'master' into bug3785
This commit is contained in:
commit
9f1f12f88e
18 files changed
+147
-112
No files matched your search
+2
-2
@@ -4,7 +4,7 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public interface SuggestedCourseAreaNames {
|
||||
static final List<String> suggestedCourseAreaNames = Arrays.asList("Alpha", "Bravo", "Charlie", "Delta", "Echo",
|
||||
"Foxtrott", "Golf", "Hotel", "India", "Juliett", "Kilo", "Stadium", "Offshore", "TV");
|
||||
static final List<String> suggestedCourseAreaNames = Arrays.asList("Alpha", "Alfa", "Bravo", "Charlie", "Delta", "Echo",
|
||||
"Foxtrot", "Golf", "Hotel", "India", "Juliett", "Juliet", "Kilo", "Stadium", "Offshore", "TV", "Media");
|
||||
|
||||
}
|
||||
@@ -1,21 +1,20 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.sap.sailing.android.shared.ui.customviews.OpenSansToolbar
|
||||
android:id="@+id/toolbar"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/toolbar_height"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/toolbar_height"
|
||||
android:theme="@style/AppTheme.Toolbar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
@@ -23,35 +22,32 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:lines="1"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/toolbar_text_color"
|
||||
android:textSize="16sp"/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:lines="1"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/toolbar_text_color"
|
||||
android:textSize="12sp"/>
|
||||
|
||||
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.sap.sailing.android.shared.ui.customviews.OpenSansToolbar>
|
||||
|
||||
<View
|
||||
android:id="@+id/toolbar_separator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/toolbar_separator_height"
|
||||
android:background="@color/separator_color"/>
|
||||
android:background="@color/separator_color" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -348,4 +348,8 @@
|
||||
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
|
||||
<item name="colorAccent">@color/fiori_primary_color</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
+10
-2
@@ -47,8 +47,16 @@ public abstract class AbstractBaseActivity extends SendingServiceAwareActivity {
|
||||
|
||||
public void dismissProgressDialog() {
|
||||
synchronized (progressDialogMonitor) {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
try {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
} catch (final IllegalArgumentException e) {
|
||||
ExLog.i(this, TAG, "progressDialog was not attached: " + e);
|
||||
} catch (final Exception e) {
|
||||
ExLog.i(this, TAG, "Unknown exception: " + e);
|
||||
} finally {
|
||||
progressDialog = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,7 +1,7 @@
|
||||
package com.sap.sailing.android.shared.ui.activities;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
import com.sap.sailing.android.shared.R;
|
||||
import com.sap.sailing.android.shared.data.BaseCheckinData;
|
||||
@@ -16,10 +16,10 @@ public abstract class CheckinDataActivity extends AbstractBaseActivity implement
|
||||
* Shows a pop-up-dialog that informs the user than an DB-operation has failed.
|
||||
*/
|
||||
public void displayDatabaseError() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppTheme_AlertDialog);
|
||||
builder.setMessage(getString(R.string.notify_user_db_operation_failed));
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
@@ -27,7 +27,6 @@ public abstract class CheckinDataActivity extends AbstractBaseActivity implement
|
||||
}
|
||||
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -1,10 +1,10 @@
|
||||
package com.sap.sailing.android.shared.util;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.location.LocationManager;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
||||
import com.sap.sailing.android.shared.R;
|
||||
|
||||
@@ -52,8 +52,11 @@ public class LocationHelper {
|
||||
*/
|
||||
public static void showNoGPSError(final Context context, String errorMessage) {
|
||||
if (context != null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context).setCancelable(true).setTitle(context.getString(R.string.warning)).setNegativeButton(context.getString(R.string.no), null)
|
||||
.setPositiveButton(context.getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AppTheme_AlertDialog)
|
||||
.setCancelable(true)
|
||||
.setTitle(context.getString(R.string.warning))
|
||||
.setNegativeButton(android.R.string.no, null)
|
||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
openLocationSettings(context);
|
||||
|
||||
+4
-5
@@ -4,13 +4,13 @@ import java.util.List;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -118,10 +118,10 @@ public abstract class AbstractHomeFragment extends BaseFragment {
|
||||
* Shows a pop-up-dialog that informs the user than an API-call has failed and recommends a retry.
|
||||
*/
|
||||
protected void displayAPIErrorRecommendRetry() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog);
|
||||
builder.setMessage(getString(R.string.notify_user_api_call_failed));
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
@@ -129,8 +129,7 @@ public abstract class AbstractHomeFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private class ClickListener implements OnClickListener {
|
||||
|
||||
+4
-4
@@ -2,11 +2,11 @@ package com.sap.sailing.android.tracking.app.ui.activities;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@@ -119,16 +119,16 @@ public class BuoyActivity extends AbstractBaseActivity {
|
||||
}
|
||||
|
||||
private void displayCheckoutConfirmationDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(R.string.warning);
|
||||
builder.setMessage(R.string.checkout_warning_message);
|
||||
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
checkout();
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, null);
|
||||
builder.setNegativeButton(android.R.string.no, null);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
|
||||
+58
-31
@@ -13,16 +13,17 @@ import java.util.Locale;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
@@ -39,6 +40,7 @@ import com.sap.sailing.android.shared.data.BaseCheckinData;
|
||||
import com.sap.sailing.android.shared.data.CheckinUrlInfo;
|
||||
import com.sap.sailing.android.shared.data.LeaderboardInfo;
|
||||
import com.sap.sailing.android.shared.data.http.HttpGetRequest;
|
||||
import com.sap.sailing.android.shared.data.http.HttpJsonPostRequest;
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.android.shared.ui.activities.AbstractRegattaActivity;
|
||||
import com.sap.sailing.android.shared.util.BitmapHelper;
|
||||
@@ -46,6 +48,7 @@ import com.sap.sailing.android.shared.util.NetworkHelper;
|
||||
import com.sap.sailing.android.shared.util.NetworkHelper.NetworkHelperError;
|
||||
import com.sap.sailing.android.shared.util.NetworkHelper.NetworkHelperFailureListener;
|
||||
import com.sap.sailing.android.shared.util.NetworkHelper.NetworkHelperSuccessListener;
|
||||
import com.sap.sailing.android.shared.util.UniqueDeviceUuid;
|
||||
import com.sap.sailing.android.tracking.app.BuildConfig;
|
||||
import com.sap.sailing.android.tracking.app.R;
|
||||
import com.sap.sailing.android.tracking.app.ui.fragments.RegattaFragment;
|
||||
@@ -55,7 +58,6 @@ import com.sap.sailing.android.tracking.app.upload.UploadTeamImageTask;
|
||||
import com.sap.sailing.android.tracking.app.utils.AboutHelper;
|
||||
import com.sap.sailing.android.tracking.app.utils.AppPreferences;
|
||||
import com.sap.sailing.android.tracking.app.utils.CheckinManager;
|
||||
import com.sap.sailing.android.tracking.app.utils.CheckoutHelper;
|
||||
import com.sap.sailing.android.tracking.app.utils.DatabaseHelper;
|
||||
import com.sap.sailing.android.tracking.app.valueobjects.CheckinData;
|
||||
import com.sap.sailing.android.tracking.app.valueobjects.CompetitorCheckinData;
|
||||
@@ -66,8 +68,8 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
implements RegattaFragment.FragmentWatcher, UploadResponseHandler {
|
||||
|
||||
private final static String TAG = RegattaActivity.class.getName();
|
||||
private final static String LEADERBOARD_IMAGE_FILENAME_PREFIX = "leaderboardImage_";
|
||||
private final static String FLAG_IMAGE_FILENAME_PREFIX = "flagImage_";
|
||||
private final static String COMPETITOR_IMAGE_FILENAME_PREFIX = "competitor_";
|
||||
private final static String FLAG_IMAGE_FILENAME_PREFIX = "flag_";
|
||||
|
||||
public EventInfo event;
|
||||
public CompetitorInfo competitor;
|
||||
@@ -105,7 +107,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
if (toolbar != null) {
|
||||
setSupportActionBar(toolbar);
|
||||
}
|
||||
if (getSupportActionBar() != null) {
|
||||
if (toolbar != null && getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
toolbar.setNavigationIcon(R.drawable.sap_logo_64dp);
|
||||
@@ -235,7 +237,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
}
|
||||
|
||||
private void setTeamImage(ImageView imageView, int width, int height) {
|
||||
String fileName = getLeaderboardImageFileName(leaderboard.name);
|
||||
String fileName = getCompetitorImageFileName(competitor.id);
|
||||
Bitmap storedImage = getStoredImage(fileName, width, height);
|
||||
if (storedImage == null) {
|
||||
askServerAboutTeamImageUrl(imageView);
|
||||
@@ -305,7 +307,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
* @param bitmap
|
||||
*/
|
||||
public void updateLeaderboardPictureChosenByUser(final Bitmap bitmap) {
|
||||
storeImageAndSendToServer(bitmap, getLeaderboardImageFileName(leaderboard.name), true);
|
||||
storeImageAndSendToServer(bitmap, getCompetitorImageFileName(competitor.id), true);
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -378,7 +380,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
File mediaStorageDir = getMediaStorageDir();
|
||||
|
||||
File mediaFile;
|
||||
String mImageName = "MI_" + fileName + ".png";
|
||||
String mImageName = fileName + ".png";
|
||||
mediaFile = new File(mediaStorageDir.getPath() + File.separator + mImageName);
|
||||
return mediaFile;
|
||||
}
|
||||
@@ -387,7 +389,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
File mediaStorageDir = getMediaStorageDir();
|
||||
|
||||
File mediaFile;
|
||||
String mImageName = "MI_" + fileName + ".png";
|
||||
String mImageName = fileName + ".png";
|
||||
mediaFile = new File(mediaStorageDir.getPath() + File.separator + mImageName);
|
||||
|
||||
return mediaFile.delete();
|
||||
@@ -441,8 +443,8 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
setUpView();
|
||||
}
|
||||
|
||||
private String getLeaderboardImageFileName(String leaderboardName) {
|
||||
return LEADERBOARD_IMAGE_FILENAME_PREFIX + leaderboardName;
|
||||
private String getCompetitorImageFileName(String competitorId) {
|
||||
return COMPETITOR_IMAGE_FILENAME_PREFIX + competitorId;
|
||||
}
|
||||
|
||||
private String getFlagImageFileName(String countryCode) {
|
||||
@@ -450,7 +452,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
}
|
||||
|
||||
private void displayCheckoutConfirmationDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(R.string.warning);
|
||||
builder.setMessage(R.string.checkout_warning_message);
|
||||
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@@ -467,23 +469,48 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
* Check out from regatta;
|
||||
*/
|
||||
public void checkout() {
|
||||
CheckoutHelper checkoutHelper = new CheckoutHelper();
|
||||
checkoutHelper.checkoutCompetitor(this, leaderboard.name, event.server, competitor.id, new NetworkHelperSuccessListener() {
|
||||
@Override
|
||||
public void performAction(JSONObject response) {
|
||||
DatabaseHelper.getInstance().deleteRegattaFromDatabase(RegattaActivity.this, event.checkinDigest);
|
||||
deleteImageFile(getLeaderboardImageFileName(leaderboard.name));
|
||||
dismissProgressDialog();
|
||||
finish();
|
||||
}
|
||||
}, new NetworkHelperFailureListener() {
|
||||
@Override
|
||||
public void performAction(NetworkHelperError e) {
|
||||
dismissProgressDialog();
|
||||
showErrorPopup(R.string.error,
|
||||
R.string.error_could_not_complete_operation_on_server_try_again);
|
||||
}
|
||||
});
|
||||
final String checkoutURLStr = event.server
|
||||
+ prefs.getServerCheckoutPath().replace("{leaderboard-name}", Uri.encode(leaderboard.name));
|
||||
|
||||
showProgressDialog(R.string.please_wait, R.string.checking_out);
|
||||
|
||||
JSONObject checkoutData = new JSONObject();
|
||||
try {
|
||||
checkoutData.put("competitorId", competitor.id);
|
||||
checkoutData.put("deviceUuid", UniqueDeviceUuid.getUniqueId(this));
|
||||
checkoutData.put("toMillis", System.currentTimeMillis());
|
||||
} catch (JSONException e) {
|
||||
showErrorPopup(R.string.error, R.string.error_could_not_complete_operation_on_server_try_again);
|
||||
ExLog.e(this, TAG, "Error populating checkout-data: " + e.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
HttpJsonPostRequest request = new HttpJsonPostRequest(this, new URL(checkoutURLStr), checkoutData.toString());
|
||||
NetworkHelper.getInstance(this).executeHttpJsonRequestAsync(request,
|
||||
new NetworkHelperSuccessListener() {
|
||||
|
||||
@Override
|
||||
public void performAction(JSONObject response) {
|
||||
DatabaseHelper.getInstance().deleteRegattaFromDatabase(RegattaActivity.this,
|
||||
event.checkinDigest);
|
||||
deleteImageFile(getCompetitorImageFileName(competitor.id));
|
||||
dismissProgressDialog();
|
||||
finish();
|
||||
}
|
||||
}, new NetworkHelperFailureListener() {
|
||||
|
||||
@Override
|
||||
public void performAction(NetworkHelperError e) {
|
||||
dismissProgressDialog();
|
||||
showErrorPopup(R.string.error,
|
||||
R.string.error_could_not_complete_operation_on_server_try_again);
|
||||
}
|
||||
});
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
ExLog.w(this, TAG, "Error, can't check out, MalformedURLException: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -527,7 +554,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
|
||||
public void retryUpload(View view) {
|
||||
if (prefs.hasFailedUpload(leaderboard.name)) {
|
||||
pictureFile = getImageFile(getLeaderboardImageFileName(leaderboard.name));
|
||||
pictureFile = getImageFile(getCompetitorImageFileName(competitor.id));
|
||||
}
|
||||
if (pictureFile != null) {
|
||||
sendTeamImageToServer(pictureFile);
|
||||
@@ -589,7 +616,7 @@ public class RegattaActivity extends AbstractRegattaActivity
|
||||
FileOutputStream outputStream = null;
|
||||
try {
|
||||
in = new java.net.URL(downloadUrl).openStream();
|
||||
imageFile = getImageFile(getLeaderboardImageFileName(leaderboard.name));
|
||||
imageFile = getImageFile(getCompetitorImageFileName(competitor.id));
|
||||
if (!imageFile.exists()) {
|
||||
imageFile.createNewFile();
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public class StartActivity extends AbstractStartActivity {
|
||||
refreshDatabase();
|
||||
|
||||
if (!EulaHelper.with(this).isEulaAccepted()) {
|
||||
EulaHelper.with(this).showEulaDialog();
|
||||
EulaHelper.with(this).showEulaDialog(R.style.AppTheme_AlertDialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-4
@@ -1,6 +1,5 @@
|
||||
package com.sap.sailing.android.tracking.app.ui.activities;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -15,6 +14,7 @@ import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v4.view.ViewPager.OnPageChangeListener;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@@ -393,13 +393,16 @@ public class TrackingActivity extends BaseActivity implements GPSQualityListener
|
||||
}
|
||||
|
||||
public void showStopTrackingConfirmationDialog() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(this).setTitle(R.string.please_confirm).setMessage(R.string.do_you_really_want_to_stop_tracking)
|
||||
.setIcon(android.R.drawable.ic_dialog_alert).setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(this, R.style.AppTheme_AlertDialog)
|
||||
.setTitle(R.string.please_confirm)
|
||||
.setMessage(R.string.do_you_really_want_to_stop_tracking)
|
||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
stopTracking();
|
||||
}
|
||||
}).setNegativeButton(android.R.string.no, null).create();
|
||||
})
|
||||
.setNegativeButton(android.R.string.no, null).create();
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
+3
-4
@@ -8,7 +8,6 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
@@ -17,6 +16,7 @@ import android.os.Bundle;
|
||||
import android.support.v4.app.LoaderManager.LoaderCallbacks;
|
||||
import android.support.v4.content.CursorLoader;
|
||||
import android.support.v4.content.Loader;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -198,7 +198,7 @@ public class HomeFragment extends AbstractHomeFragment implements LoaderCallback
|
||||
String message1 = getString(R.string.confirm_data_hello_name).replace("{full_name}", checkinData.competitorName);
|
||||
String message2 = getString(R.string.confirm_data_you_are_signed_in_as_sail_id).replace("{sail_id}", checkinData.competitorSailId);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog);
|
||||
builder.setMessage(message1 + "\n\n" + message2);
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(getString(R.string.confirm_data_is_correct), new DialogInterface.OnClickListener() {
|
||||
@@ -214,8 +214,7 @@ public class HomeFragment extends AbstractHomeFragment implements LoaderCallback
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
builder.show();
|
||||
} else if (data instanceof MarkCheckinData) {
|
||||
MarkCheckinData checkinData = (MarkCheckinData) data;
|
||||
clearScannedQRCodeInPrefs();
|
||||
|
||||
+22
-24
@@ -8,7 +8,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -18,6 +17,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -112,8 +112,7 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
|
||||
}
|
||||
|
||||
private void centerViewInParent(View view) {
|
||||
RelativeLayout.LayoutParams layoutParams =
|
||||
(RelativeLayout.LayoutParams) view.getLayoutParams();
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) view.getLayoutParams();
|
||||
layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
|
||||
view.setLayoutParams(layoutParams);
|
||||
}
|
||||
@@ -210,20 +209,20 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
|
||||
* Ask user if he wants to take a new picture or select an existing one.
|
||||
*/
|
||||
public void showChooseExistingPictureOrTakeNewPhotoAlert() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(getActivity()).setTitle(R.string.add_photo_select)
|
||||
.setMessage(R.string.do_you_want_to_choose_existing_img_or_take_a_new_one)
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setPositiveButton(R.string.existing_image, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
pickExistingImage();
|
||||
}
|
||||
}).setNegativeButton(R.string.take_photo, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
showTakePhotoActivity();
|
||||
}
|
||||
}).create();
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog)
|
||||
.setTitle(R.string.add_photo_select)
|
||||
.setMessage(R.string.do_you_want_to_choose_existing_img_or_take_a_new_one)
|
||||
.setPositiveButton(R.string.existing_image, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton) {
|
||||
pickExistingImage();
|
||||
}
|
||||
}).setNegativeButton(R.string.take_photo, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
showTakePhotoActivity();
|
||||
}
|
||||
})
|
||||
.create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@@ -300,9 +299,8 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
|
||||
|
||||
int scale = 1;
|
||||
if (options.outHeight > IMAGE_MAX_SIZE || options.outWidth > IMAGE_MAX_SIZE) {
|
||||
scale = (int) Math.pow(
|
||||
2,
|
||||
(int) Math.ceil(Math.log(IMAGE_MAX_SIZE / (double) Math.max(options.outHeight, options.outWidth)) / Math.log(0.5)));
|
||||
scale = (int) Math
|
||||
.pow(2, (int) Math.ceil(Math.log(IMAGE_MAX_SIZE / (double) Math.max(options.outHeight, options.outWidth)) / Math.log(0.5)));
|
||||
}
|
||||
|
||||
BitmapFactory.Options options2 = new BitmapFactory.Options();
|
||||
@@ -399,6 +397,10 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
|
||||
watcher = fWatcher;
|
||||
}
|
||||
|
||||
public interface FragmentWatcher {
|
||||
public void onViewCreated();
|
||||
}
|
||||
|
||||
private class TimerRunnable implements Runnable {
|
||||
|
||||
public Thread t;
|
||||
@@ -435,8 +437,4 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
|
||||
|
||||
}
|
||||
|
||||
public interface FragmentWatcher {
|
||||
public void onViewCreated();
|
||||
}
|
||||
|
||||
}
|
||||
+4
-5
@@ -13,9 +13,9 @@ import org.json.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.net.Uri;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.sap.sailing.android.shared.data.BaseCheckinData;
|
||||
@@ -332,10 +332,10 @@ public class CheckinManager {
|
||||
* Shows a pop-up-dialog that informs the user than an API-call has failed and recommends a retry.
|
||||
*/
|
||||
private void displayAPIErrorRecommendRetry() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.AppTheme_AlertDialog);
|
||||
builder.setMessage(activity.getString(R.string.notify_user_api_call_failed));
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(activity.getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
@@ -343,8 +343,7 @@ public class CheckinManager {
|
||||
}
|
||||
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
builder.show();
|
||||
setCheckinData(null);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -167,10 +167,10 @@ public class RegattaActivity extends AbstractRegattaActivity {
|
||||
}
|
||||
|
||||
private void displayCheckoutConfirmationDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppTheme_AlertDialog);
|
||||
builder.setTitle(R.string.warning);
|
||||
builder.setMessage(R.string.checkout_warning_message);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
builder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
checkOut();
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class StartActivity extends AbstractStartActivity {
|
||||
replaceFragment(R.id.content_frame, new HomeFragment());
|
||||
|
||||
if (!EulaHelper.with(this).isEulaAccepted()) {
|
||||
EulaHelper.with(this).showEulaDialog(R.style.Base_Theme_AppCompat_Dialog_Alert);
|
||||
EulaHelper.with(this).showEulaDialog(R.style.AppTheme_AlertDialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class BuoyFragment extends BaseFragment implements LocationListener {
|
||||
|
||||
private void checkGPS() {
|
||||
if (lastKnownLocation == null) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog)
|
||||
.setMessage(R.string.error_message_no_position)
|
||||
.setPositiveButton(android.R.string.ok, null);
|
||||
if (!LocationHelper.isGPSEnabled(getActivity())) {
|
||||
|
||||
+1
-1
@@ -279,7 +279,7 @@ public class CheckinManager {
|
||||
* Shows a pop-up-dialog that informs the user than an API-call has failed and recommends a retry.
|
||||
*/
|
||||
private void displayAPIErrorRecommendRetry() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext, R.style.AppTheme_AlertDialog);
|
||||
builder.setMessage(mContext.getString(R.string.notify_user_api_call_failed));
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
|
||||
Reference in new issue
Block a user