mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 06:17:27 +00:00
Merge branch 'ubilabs--tracking_app--develop--hotfix--team_photo_menu_item' into ubilabs--tracking_app--develop
This commit is contained in:
commit
457108b015
5 files changed
+35
-9
No files matched your search
@@ -14,4 +14,8 @@
|
||||
android:title="@string/options_menu_checkout"
|
||||
app:showAsAction=""/>
|
||||
|
||||
<item
|
||||
android:id="@+id/options_menu_add_team_image"
|
||||
android:title="@string/options_add_team_photo"
|
||||
app:showAsAction=""/>
|
||||
</menu>
|
||||
@@ -7,6 +7,8 @@
|
||||
<string name="app_name">SAP Sailing Tracking App</string>
|
||||
<string name="options_menu_settings">Einstellungen</string>
|
||||
<string name="options_menu_checkout">Checkout</string>
|
||||
<string name="options_add_team_photo">Team Foto hinzufügen</string>
|
||||
<string name="options_replace_team_photo">Team Foto ersetzen</string>
|
||||
<string name="settings_category_other">Andere Einstellungen</string>
|
||||
<string name="scan_hint">Der QR-Code befindet sich auf Ihrer Teilnahmebestätigung</string>
|
||||
<string name="device_identifier">Geräte-ID</string>
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<string name="app_name">SAP Sailing Tracking App</string>
|
||||
<string name="options_menu_settings">Settings</string>
|
||||
<string name="options_menu_checkout">Checkout</string>
|
||||
<string name="options_add_team_photo">Add Team Photo</string>
|
||||
<string name="options_replace_team_photo">Replace Team Photo</string>
|
||||
<string name="settings_category_other">Other Settings</string>
|
||||
<string name="device_identifier">Device Identifier</string>
|
||||
<string name="tracker_started">SAP Sailing Tracker started</string>
|
||||
|
||||
+26
-8
@@ -59,8 +59,9 @@ public class RegattaActivity extends BaseActivity {
|
||||
public EventInfo event;
|
||||
public CompetitorInfo competitor;
|
||||
public LeaderboardInfo leaderboard;
|
||||
|
||||
|
||||
|
||||
private boolean hasPicture;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -91,8 +92,7 @@ public class RegattaActivity extends BaseActivity {
|
||||
getSupportActionBar().setTitle(leaderboard.name);
|
||||
getSupportActionBar().setSubtitle(event.name);
|
||||
}
|
||||
|
||||
replaceFragment(R.id.content_frame, new RegattaFragment());
|
||||
replaceFragment(R.id.content_frame, new RegattaFragment());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +111,21 @@ public class RegattaActivity extends BaseActivity {
|
||||
inflater.inflate(R.menu.options_menu_with_checkout, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
MenuItem teamPhotoItem = menu.findItem(R.id.options_menu_add_team_image);
|
||||
if(hasPicture)
|
||||
{
|
||||
teamPhotoItem.setTitle(getString(R.string.options_replace_team_photo));
|
||||
}
|
||||
else
|
||||
{
|
||||
teamPhotoItem.setTitle(getString(R.string.options_add_team_photo));
|
||||
}
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
@@ -123,6 +137,10 @@ public class RegattaActivity extends BaseActivity {
|
||||
ExLog.i(this, TAG, "Clicked CHECKOUT.");
|
||||
checkout();
|
||||
return true;
|
||||
case R.id.options_menu_add_team_image:
|
||||
ExLog.i(this, TAG, "Clicked ADD TEAM IMAGE");
|
||||
getRegattaFragment().showChooseExistingPictureOrTakeNewPhotoAlert();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
@@ -136,11 +154,12 @@ public class RegattaActivity extends BaseActivity {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
hasPicture = true;
|
||||
LinearLayout addTeamPhotoTextView = (LinearLayout) findViewById(R.id.add_photo);
|
||||
addTeamPhotoTextView.setVisibility(View.INVISIBLE);
|
||||
|
||||
getRegattaFragment().setChangePhotoButtonHidden(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -160,7 +179,7 @@ public class RegattaActivity extends BaseActivity {
|
||||
|
||||
TextView sailIdTextView = (TextView)findViewById(R.id.sail_id);
|
||||
sailIdTextView.setText(competitor.sailId);
|
||||
|
||||
|
||||
// ImageView flagImageView = (ImageView)findViewById(R.id.flag_image);
|
||||
//String flagStr = String.format("%s.png", countryCode);
|
||||
// String uri = "@drawable/" + competitor.countryCode.toLowerCase(Locale.getDefault());
|
||||
@@ -179,7 +198,6 @@ public class RegattaActivity extends BaseActivity {
|
||||
|
||||
ImageView imageView = (ImageView) findViewById(R.id.userImage);
|
||||
Bitmap storedImage = getStoredImage(getLeaderboardImageFileName(leaderboard.name));
|
||||
|
||||
if (storedImage == null)
|
||||
{
|
||||
if (event.imageUrl != null)
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ public class RegattaFragment extends BaseFragment implements OnClickListener {
|
||||
/**
|
||||
* Ask user if he wants to take a new picture or select an existing one.
|
||||
*/
|
||||
private void showChooseExistingPictureOrTakeNewPhotoAlert() {
|
||||
public void showChooseExistingPictureOrTakeNewPhotoAlert() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.add_photo_select)
|
||||
.setMessage(
|
||||
|
||||
Reference in new issue
Block a user