mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-23 12:33:53 +00:00
Adds message sending status icon in toolbar
This commit is contained in:
1 parent
8a36d256fc
commit
d6ebb2a216
5 files changed
+32
-28
No files matched your search
+1
-8
@@ -19,13 +19,6 @@ public class BaseActivity extends AbstractBaseActivity {
|
||||
prefs = new AppPreferences(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.about_menu, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
@@ -36,6 +29,6 @@ public class BaseActivity extends AbstractBaseActivity {
|
||||
|
||||
@Override
|
||||
protected int getOptionsMenuResId() {
|
||||
return R.menu.about_menu;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+6
-2
@@ -74,7 +74,7 @@ public class PositioningActivity extends BaseActivity implements pingListener {
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.about_menu, menu);
|
||||
return true;
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,6 +84,9 @@ public class PositioningActivity extends BaseActivity implements pingListener {
|
||||
AboutDialog aboutDialog = new AboutDialog(this);
|
||||
aboutDialog.show();
|
||||
return true;
|
||||
case R.id.settings:
|
||||
startActivity(new Intent(this, SettingActivity.class));
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
@@ -91,7 +94,8 @@ public class PositioningActivity extends BaseActivity implements pingListener {
|
||||
|
||||
@Override
|
||||
protected int getOptionsMenuResId() {
|
||||
return R.menu.about_menu;
|
||||
// Set to 0 to avoid redundant menu inflation
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setPingFromDatabase(String markerID) {
|
||||
|
||||
+3
-1
@@ -117,6 +117,7 @@ public class RegattaActivity extends AbstractRegattaActivity {
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
super.onCreateOptionsMenu(menu);
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.regatta_menu, menu);
|
||||
return true;
|
||||
@@ -144,7 +145,8 @@ public class RegattaActivity extends AbstractRegattaActivity {
|
||||
|
||||
@Override
|
||||
protected int getOptionsMenuResId() {
|
||||
return R.menu.regatta_menu;
|
||||
// Set to 0 to avoid redundant menu inflation
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+21
-16
@@ -2,12 +2,14 @@ package com.sap.sailing.android.buoy.positioning.app.ui.activities;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.View;
|
||||
import com.sap.sailing.android.buoy.positioning.app.R;
|
||||
import com.sap.sailing.android.buoy.positioning.app.ui.fragments.GeneralPreferenceFragment;
|
||||
import com.sap.sailing.android.shared.ui.customviews.OpenSansToolbar;
|
||||
|
||||
public class SettingActivity extends BaseActivity {
|
||||
public class SettingActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -20,23 +22,26 @@ public class SettingActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void setupToolbar() {
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
toolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
ActionBar supportActionBar = getSupportActionBar();
|
||||
if (supportActionBar != null) {
|
||||
supportActionBar.setDisplayHomeAsUpEnabled(true);
|
||||
supportActionBar.setHomeButtonEnabled(true);
|
||||
supportActionBar.setTitle(R.string.settings);
|
||||
OpenSansToolbar toolbar = (OpenSansToolbar) findViewById(R.id.toolbar);
|
||||
if (toolbar != null) {
|
||||
toolbar.hideSubtitle();
|
||||
toolbar.setTitleSize(20);
|
||||
toolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
setSupportActionBar(toolbar);
|
||||
toolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||
}
|
||||
if (getSupportActionBar() != null) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
toolbar.setNavigationIcon(R.drawable.sap_logo_64_sq);
|
||||
toolbar.setPadding(20, 0, 0, 0);
|
||||
getSupportActionBar().setTitle(getString(R.string.settings));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -285,12 +285,12 @@ public class BuoyFragment extends BaseFragment implements LocationListener {
|
||||
LeaderboardInfo leaderBoard = positioningActivity.getLeaderBoard();
|
||||
helper.storePingInDatabase(getActivity(), lastKnownLocation, mark);
|
||||
helper.sendPingToServer(getActivity(), lastKnownLocation, leaderBoard, mark, PingServerReplyCallback.class);
|
||||
//Toast.makeText(getActivity(), getString(R.string.position_set), Toast.LENGTH_SHORT).show();
|
||||
((PositioningActivity) getActivity()).updatePing();
|
||||
savedPosition = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());
|
||||
pingListener.updatePing();
|
||||
setUpTextUI(lastKnownLocation);
|
||||
updateMap();
|
||||
//Toast.makeText(getActivity(), getString(R.string.position_set), Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "Location is not available yet", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user