Design/Usability

- show splash screen
- increased FAB menu buttons
- long press on FAB menu triggers recorder with last activity
This commit is contained in:
jannis 2019-08-22 16:08:33 +02:00
parent c708a8cc7e
commit 31524fc92f
6 changed files with 70 additions and 15 deletions

View File

@ -22,6 +22,7 @@ package de.tadris.fitness.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import de.tadris.fitness.Instance;
import de.tadris.fitness.R;
@ -31,13 +32,14 @@ public class LauncherActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.AppThemeNoActionbar);
setContentView(R.layout.activity_main);
}
@Override
public void onResume(){
super.onResume();
init();
new Handler().postDelayed(this::init, 100);
}
void init(){
@ -48,5 +50,6 @@ public class LauncherActivity extends Activity {
void start(){
startActivity(new Intent(this, ListWorkoutsActivity.class));
finish();
overridePendingTransition(R.anim.fade_in, R.anim.stay);
}
}

View File

@ -57,6 +57,14 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
listView.setLayoutManager(layoutManager);
menu= findViewById(R.id.workoutListMenu);
menu.setOnMenuButtonLongClickListener(v -> {
if(workouts.length > 0){
startRecording(workouts[0].workoutType);
return true;
}else{
return false;
}
});
findViewById(R.id.workoutListRecordRunning).setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_RUNNING));
findViewById(R.id.workoutListRecordHiking) .setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_HIKING));

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2019 Jannis Scheibe <jannis@tadris.de>
~
~ This file is part of FitoTrack
~
~ FitoTrack is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ FitoTrack is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300">
<alpha android:fromAlpha="0" android:toAlpha="1"/>
</set>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2019 Jannis Scheibe <jannis@tadris.de>
~
~ This file is part of FitoTrack
~
~ FitoTrack is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ FitoTrack is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300">
</set>

View File

@ -25,15 +25,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".activity.ListWorkoutsActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/workoutList"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</ScrollView>
<com.github.clans.fab.FloatingActionMenu
android:id="@+id/workoutListMenu"
@ -56,7 +51,7 @@
app:fab_colorNormal="@color/colorPrimaryRunning"
app:fab_colorPressed="@color/colorPrimaryDarkRunning"
app:fab_label="@string/workoutTypeRunning"
app:fab_size="mini"/>
app:fab_size="normal"/>
<com.github.clans.fab.FloatingActionButton
android:id="@+id/workoutListRecordHiking"
@ -66,7 +61,7 @@
app:fab_colorNormal="@color/colorPrimaryHiking"
app:fab_colorPressed="@color/colorPrimaryDarkHiking"
app:fab_label="@string/workoutTypeHiking"
app:fab_size="mini" />
app:fab_size="normal" />
<com.github.clans.fab.FloatingActionButton
android:id="@+id/workoutListRecordCycling"
@ -76,7 +71,7 @@
app:fab_colorNormal="@color/colorPrimaryBicycling"
app:fab_colorPressed="@color/colorPrimaryDarkBicycling"
app:fab_label="@string/workoutTypeCycling"
app:fab_size="mini"/>
app:fab_size="normal"/>
</com.github.clans.fab.FloatingActionMenu>

View File

@ -27,8 +27,9 @@
<ImageView
android:id="@+id/imageView2"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher" />
android:background="@drawable/logo_background"
android:src="@drawable/logo_foreground" />
</FrameLayout>