mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-29 00:32:11 -07:00
Design/Usability
- show splash screen - increased FAB menu buttons - long press on FAB menu triggers recorder with last activity
This commit is contained in:
parent
c708a8cc7e
commit
31524fc92f
@ -22,6 +22,7 @@ package de.tadris.fitness.activity;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
import de.tadris.fitness.Instance;
|
import de.tadris.fitness.Instance;
|
||||||
import de.tadris.fitness.R;
|
import de.tadris.fitness.R;
|
||||||
@ -31,13 +32,14 @@ public class LauncherActivity extends Activity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
setTheme(R.style.AppThemeNoActionbar);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume(){
|
public void onResume(){
|
||||||
super.onResume();
|
super.onResume();
|
||||||
init();
|
new Handler().postDelayed(this::init, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(){
|
void init(){
|
||||||
@ -48,5 +50,6 @@ public class LauncherActivity extends Activity {
|
|||||||
void start(){
|
void start(){
|
||||||
startActivity(new Intent(this, ListWorkoutsActivity.class));
|
startActivity(new Intent(this, ListWorkoutsActivity.class));
|
||||||
finish();
|
finish();
|
||||||
|
overridePendingTransition(R.anim.fade_in, R.anim.stay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,14 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
|
|||||||
listView.setLayoutManager(layoutManager);
|
listView.setLayoutManager(layoutManager);
|
||||||
|
|
||||||
menu= findViewById(R.id.workoutListMenu);
|
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.workoutListRecordRunning).setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_RUNNING));
|
||||||
findViewById(R.id.workoutListRecordHiking) .setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_HIKING));
|
findViewById(R.id.workoutListRecordHiking) .setOnClickListener(v -> startRecording(Workout.WORKOUT_TYPE_HIKING));
|
||||||
|
|||||||
24
app/src/main/res/anim/fade_in.xml
Normal file
24
app/src/main/res/anim/fade_in.xml
Normal 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>
|
||||||
24
app/src/main/res/anim/stay.xml
Normal file
24
app/src/main/res/anim/stay.xml
Normal 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>
|
||||||
@ -25,15 +25,10 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
tools:context=".activity.ListWorkoutsActivity">
|
tools:context=".activity.ListWorkoutsActivity">
|
||||||
|
|
||||||
<ScrollView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/workoutList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/workoutList"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionMenu
|
<com.github.clans.fab.FloatingActionMenu
|
||||||
android:id="@+id/workoutListMenu"
|
android:id="@+id/workoutListMenu"
|
||||||
@ -56,7 +51,7 @@
|
|||||||
app:fab_colorNormal="@color/colorPrimaryRunning"
|
app:fab_colorNormal="@color/colorPrimaryRunning"
|
||||||
app:fab_colorPressed="@color/colorPrimaryDarkRunning"
|
app:fab_colorPressed="@color/colorPrimaryDarkRunning"
|
||||||
app:fab_label="@string/workoutTypeRunning"
|
app:fab_label="@string/workoutTypeRunning"
|
||||||
app:fab_size="mini"/>
|
app:fab_size="normal"/>
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/workoutListRecordHiking"
|
android:id="@+id/workoutListRecordHiking"
|
||||||
@ -66,7 +61,7 @@
|
|||||||
app:fab_colorNormal="@color/colorPrimaryHiking"
|
app:fab_colorNormal="@color/colorPrimaryHiking"
|
||||||
app:fab_colorPressed="@color/colorPrimaryDarkHiking"
|
app:fab_colorPressed="@color/colorPrimaryDarkHiking"
|
||||||
app:fab_label="@string/workoutTypeHiking"
|
app:fab_label="@string/workoutTypeHiking"
|
||||||
app:fab_size="mini" />
|
app:fab_size="normal" />
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/workoutListRecordCycling"
|
android:id="@+id/workoutListRecordCycling"
|
||||||
@ -76,7 +71,7 @@
|
|||||||
app:fab_colorNormal="@color/colorPrimaryBicycling"
|
app:fab_colorNormal="@color/colorPrimaryBicycling"
|
||||||
app:fab_colorPressed="@color/colorPrimaryDarkBicycling"
|
app:fab_colorPressed="@color/colorPrimaryDarkBicycling"
|
||||||
app:fab_label="@string/workoutTypeCycling"
|
app:fab_label="@string/workoutTypeCycling"
|
||||||
app:fab_size="mini"/>
|
app:fab_size="normal"/>
|
||||||
|
|
||||||
</com.github.clans.fab.FloatingActionMenu>
|
</com.github.clans.fab.FloatingActionMenu>
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,9 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView2"
|
||||||
android:layout_width="200dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@mipmap/ic_launcher" />
|
android:background="@drawable/logo_background"
|
||||||
|
android:src="@drawable/logo_foreground" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
Loading…
x
Reference in New Issue
Block a user