temporarily deactivate resume buttons
This commit is contained in:
parent
5b089130fd
commit
eb5a89b398
3 changed files with 23 additions and 17 deletions
|
@ -99,9 +99,6 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
// initialize selected tab
|
|
||||||
mSelectedTab = FRAGMENT_ID_MAP;
|
|
||||||
|
|
||||||
// check state of External Storage
|
// check state of External Storage
|
||||||
checkExternalStorageState();
|
checkExternalStorageState();
|
||||||
|
|
||||||
|
@ -118,11 +115,17 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
mPermissionsGranted = true;
|
mPermissionsGranted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore state if saved instance is available
|
// initialize state
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
|
// restore if saved instance is available
|
||||||
mTrackerServiceRunning = savedInstanceState.getBoolean(INSTANCE_TRACKING_STATE, false);
|
mTrackerServiceRunning = savedInstanceState.getBoolean(INSTANCE_TRACKING_STATE, false);
|
||||||
mSelectedTab = savedInstanceState.getInt(INSTANCE_SELECTED_TAB, FRAGMENT_ID_MAP);
|
mSelectedTab = savedInstanceState.getInt(INSTANCE_SELECTED_TAB, FRAGMENT_ID_MAP);
|
||||||
mFloatingActionButtonSubMenuVisible = savedInstanceState.getBoolean(INSTANCE_FAB_SUB_MENU_VISIBLE, false);
|
mFloatingActionButtonSubMenuVisible = savedInstanceState.getBoolean(INSTANCE_FAB_SUB_MENU_VISIBLE, false);
|
||||||
|
} else {
|
||||||
|
// use default values
|
||||||
|
mTrackerServiceRunning = false;
|
||||||
|
mSelectedTab = FRAGMENT_ID_MAP;
|
||||||
|
mFloatingActionButtonSubMenuVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set user agent to prevent getting banned from the osm servers
|
// set user agent to prevent getting banned from the osm servers
|
||||||
|
@ -564,16 +567,16 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
|
||||||
/* Shows (and hides) the sub menu of the floating action button */
|
/* Shows (and hides) the sub menu of the floating action button */
|
||||||
private void showFloatingActionButtonMenu(boolean visible) {
|
private void showFloatingActionButtonMenu(boolean visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
mFloatingActionButtonSubResume.setVisibility(View.VISIBLE);
|
// mFloatingActionButtonSubResume.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubResumeLabel.setVisibility(View.VISIBLE);
|
// mFloatingActionButtonSubResumeLabel.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubClear.setVisibility(View.VISIBLE);
|
mFloatingActionButtonSubClear.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubClearLabel.setVisibility(View.VISIBLE);
|
mFloatingActionButtonSubClearLabel.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubSave.setVisibility(View.VISIBLE);
|
mFloatingActionButtonSubSave.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubSaveLabel.setVisibility(View.VISIBLE);
|
mFloatingActionButtonSubSaveLabel.setVisibility(View.VISIBLE);
|
||||||
mFloatingActionButtonSubMenuVisible = true;
|
mFloatingActionButtonSubMenuVisible = true;
|
||||||
} else {
|
} else {
|
||||||
mFloatingActionButtonSubResume.setVisibility(View.INVISIBLE);
|
// mFloatingActionButtonSubResume.setVisibility(View.INVISIBLE);
|
||||||
mFloatingActionButtonSubResumeLabel.setVisibility(View.INVISIBLE);
|
// mFloatingActionButtonSubResumeLabel.setVisibility(View.INVISIBLE);
|
||||||
mFloatingActionButtonSubClear.setVisibility(View.INVISIBLE);
|
mFloatingActionButtonSubClear.setVisibility(View.INVISIBLE);
|
||||||
mFloatingActionButtonSubClearLabel.setVisibility(View.INVISIBLE);
|
mFloatingActionButtonSubClearLabel.setVisibility(View.INVISIBLE);
|
||||||
mFloatingActionButtonSubSaveLabel.setVisibility(View.INVISIBLE);
|
mFloatingActionButtonSubSaveLabel.setVisibility(View.INVISIBLE);
|
||||||
|
|
|
@ -89,8 +89,8 @@ public final class NotificationHelper implements TrackbookKeys {
|
||||||
builder.setContentTitle(context.getString(R.string.notification_title_trackbook_running));
|
builder.setContentTitle(context.getString(R.string.notification_title_trackbook_running));
|
||||||
builder.setContentText(getContextString(context, track));
|
builder.setContentText(getContextString(context, track));
|
||||||
} else {
|
} else {
|
||||||
builder.addAction(R.drawable.ic_fiber_manual_record_white_24dp, context.getString(R.string.notification_resume), resuneActionPendingIntent);
|
// builder.addAction(R.drawable.ic_fiber_manual_record_white_24dp, context.getString(R.string.notification_resume), resuneActionPendingIntent);
|
||||||
builder.addAction(R.drawable.ic_compass_needle_white_24dp, context.getString(R.string.notification_show), tapActionPendingIntent);
|
// builder.addAction(R.drawable.ic_compass_needle_white_24dp, context.getString(R.string.notification_show), tapActionPendingIntent);
|
||||||
builder.setContentTitle(context.getString(R.string.notification_title_trackbook_not_running));
|
builder.setContentTitle(context.getString(R.string.notification_title_trackbook_not_running));
|
||||||
builder.setContentText(getContextString(context, track));
|
builder.setContentText(getContextString(context, track));
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,6 +134,7 @@
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:contentDescription="@string/descr_fab_sub_menu_button_resume"
|
android:contentDescription="@string/descr_fab_sub_menu_button_resume"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:visibility="gone"
|
||||||
app:backgroundTint="@color/trackbook_blue"
|
app:backgroundTint="@color/trackbook_blue"
|
||||||
app:fabSize="mini"
|
app:fabSize="mini"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/fabMainButton"
|
app:layout_constraintBottom_toTopOf="@+id/fabMainButton"
|
||||||
|
@ -149,6 +150,7 @@
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:contentDescription="@string/descr_fab_sub_menu_label_resume"
|
android:contentDescription="@string/descr_fab_sub_menu_label_resume"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
|
android:visibility="gone"
|
||||||
app:cardBackgroundColor="@color/fab_button_card_background"
|
app:cardBackgroundColor="@color/fab_button_card_background"
|
||||||
app:cardCornerRadius="4dp"
|
app:cardCornerRadius="4dp"
|
||||||
app:cardElevation="4dp"
|
app:cardElevation="4dp"
|
||||||
|
@ -164,6 +166,7 @@
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="6dp"
|
||||||
android:paddingRight="6dp"
|
android:paddingRight="6dp"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
|
android:visibility="gone"
|
||||||
android:text="@string/fab_sub_menu_resume"
|
android:text="@string/fab_sub_menu_resume"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
android:textColor="@color/fab_button_card_text"
|
android:textColor="@color/fab_button_card_text"
|
||||||
|
|
Loading…
Reference in a new issue