temporarily deactivate resume buttons

This commit is contained in:
y20k 2018-03-20 19:56:00 +01:00
parent 5b089130fd
commit eb5a89b398
3 changed files with 23 additions and 17 deletions

View file

@ -99,9 +99,6 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// initialize selected tab
mSelectedTab = FRAGMENT_ID_MAP;
// check state of External Storage
checkExternalStorageState();
@ -118,11 +115,17 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
mPermissionsGranted = true;
}
// restore state if saved instance is available
// initialize state
if (savedInstanceState != null) {
// restore if saved instance is available
mTrackerServiceRunning = savedInstanceState.getBoolean(INSTANCE_TRACKING_STATE, false);
mSelectedTab = savedInstanceState.getInt(INSTANCE_SELECTED_TAB, FRAGMENT_ID_MAP);
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
@ -564,16 +567,16 @@ public class MainActivity extends AppCompatActivity implements TrackbookKeys {
/* Shows (and hides) the sub menu of the floating action button */
private void showFloatingActionButtonMenu(boolean visible) {
if (visible) {
mFloatingActionButtonSubResume.setVisibility(View.VISIBLE);
mFloatingActionButtonSubResumeLabel.setVisibility(View.VISIBLE);
// mFloatingActionButtonSubResume.setVisibility(View.VISIBLE);
// mFloatingActionButtonSubResumeLabel.setVisibility(View.VISIBLE);
mFloatingActionButtonSubClear.setVisibility(View.VISIBLE);
mFloatingActionButtonSubClearLabel.setVisibility(View.VISIBLE);
mFloatingActionButtonSubSave.setVisibility(View.VISIBLE);
mFloatingActionButtonSubSaveLabel.setVisibility(View.VISIBLE);
mFloatingActionButtonSubMenuVisible = true;
} else {
mFloatingActionButtonSubResume.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubResumeLabel.setVisibility(View.INVISIBLE);
// mFloatingActionButtonSubResume.setVisibility(View.INVISIBLE);
// mFloatingActionButtonSubResumeLabel.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubClear.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubClearLabel.setVisibility(View.INVISIBLE);
mFloatingActionButtonSubSaveLabel.setVisibility(View.INVISIBLE);

View file

@ -89,8 +89,8 @@ public final class NotificationHelper implements TrackbookKeys {
builder.setContentTitle(context.getString(R.string.notification_title_trackbook_running));
builder.setContentText(getContextString(context, track));
} else {
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_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.setContentTitle(context.getString(R.string.notification_title_trackbook_not_running));
builder.setContentText(getContextString(context, track));
}

View file

@ -134,6 +134,7 @@
android:clickable="true"
android:contentDescription="@string/descr_fab_sub_menu_button_resume"
android:focusable="true"
android:visibility="gone"
app:backgroundTint="@color/trackbook_blue"
app:fabSize="mini"
app:layout_constraintBottom_toTopOf="@+id/fabMainButton"
@ -149,6 +150,7 @@
android:clickable="true"
android:contentDescription="@string/descr_fab_sub_menu_label_resume"
android:focusable="true"
android:visibility="gone"
app:cardBackgroundColor="@color/fab_button_card_background"
app:cardCornerRadius="4dp"
app:cardElevation="4dp"
@ -164,6 +166,7 @@
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:paddingTop="2dp"
android:visibility="gone"
android:text="@string/fab_sub_menu_resume"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@color/fab_button_card_text"
@ -205,13 +208,13 @@
<org.y20k.trackbook.layout.NonSwipeableViewPager
android:id="@+id/fragmentContainer"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/fragmentContainer"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>