first commit
|
|
@ -0,0 +1,15 @@
|
|||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
|
|
@ -0,0 +1 @@
|
|||
GymFlow-Martim
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="21" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.gymflow_martim"
|
||||
compileSdk = 36
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.gymflow_martim"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity)
|
||||
implementation(libs.constraintlayout)
|
||||
implementation(libs.recyclerview)
|
||||
implementation(libs.cardview)
|
||||
implementation(libs.coordinatorlayout)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.example.gymflow_martim;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.gymflow_martim", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.GymFlowMartim">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package adapters;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
import models.Exercise;
|
||||
import models.FeedReaderContract;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ExerciseAdapter extends RecyclerView.Adapter<ExerciseAdapter.ViewHolder> {
|
||||
|
||||
private List<Exercise> exercises = new ArrayList<>();
|
||||
private OnItemClickListener listener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(Exercise exercise);
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_exercise, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
Exercise exercise = exercises.get(position);
|
||||
holder.textViewName.setText(exercise.getName());
|
||||
holder.textViewSetsReps.setText(exercise.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return exercises.size();
|
||||
}
|
||||
|
||||
public void setExercises(Cursor cursor) {
|
||||
exercises.clear();
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
int id = cursor.getInt(cursor.getColumnIndexOrThrow(FeedReaderContract.ExerciseEntry.COLUMN_ID));
|
||||
String name = cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.ExerciseEntry.COLUMN_NAME));
|
||||
int sets = cursor.getInt(cursor.getColumnIndexOrThrow(FeedReaderContract.ExerciseEntry.COLUMN_SETS));
|
||||
int reps = cursor.getInt(cursor.getColumnIndexOrThrow(FeedReaderContract.ExerciseEntry.COLUMN_REPS));
|
||||
exercises.add(new Exercise(id, name, sets, reps));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void removeItem(int position) {
|
||||
exercises.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView textViewName;
|
||||
TextView textViewSetsReps;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
textViewName = itemView.findViewById(R.id.textViewExerciseName);
|
||||
textViewSetsReps = itemView.findViewById(R.id.textViewSetsReps);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
int position = getAdapterPosition();
|
||||
if (listener != null && position != RecyclerView.NO_POSITION) {
|
||||
listener.onItemClick(exercises.get(position));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package adapters;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
import models.Workout;
|
||||
import models.FeedReaderContract;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WorkoutAdapter extends RecyclerView.Adapter<WorkoutAdapter.ViewHolder> {
|
||||
|
||||
private List<Workout> workouts = new ArrayList<>();
|
||||
private OnItemClickListener listener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(Workout workout);
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.item_workout, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
Workout workout = workouts.get(position);
|
||||
holder.textViewName.setText(workout.getName());
|
||||
holder.textViewDate.setText(workout.getDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return workouts.size();
|
||||
}
|
||||
|
||||
public void setWorkouts(Cursor cursor) {
|
||||
workouts.clear();
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
do {
|
||||
int id = cursor.getInt(cursor.getColumnIndexOrThrow(FeedReaderContract.WorkoutEntry.COLUMN_ID));
|
||||
String name = cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.WorkoutEntry.COLUMN_NAME));
|
||||
String date = cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.WorkoutEntry.COLUMN_DATE));
|
||||
workouts.add(new Workout(id, name, date));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void removeItem(int position) {
|
||||
workouts.remove(position);
|
||||
notifyItemRemoved(position);
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView textViewName;
|
||||
TextView textViewDate;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
textViewName = itemView.findViewById(R.id.textViewWorkoutName);
|
||||
textViewDate = itemView.findViewById(R.id.textViewDate);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
int position = getAdapterPosition();
|
||||
if (listener != null && position != RecyclerView.NO_POSITION) {
|
||||
listener.onItemClick(workouts.get(position));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.example.gymflow_martim;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.example.gymflow_martim.fragments.ExercisesFragment;
|
||||
import com.example.gymflow_martim.fragments.ProgressFragment;
|
||||
import com.example.gymflow_martim.fragments.SettingsFragment;
|
||||
import com.example.gymflow_martim.fragments.WorkoutsFragment;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private ExercisesFragment exercisesFragment;
|
||||
private WorkoutsFragment workoutsFragment;
|
||||
private ProgressFragment progressFragment;
|
||||
private SettingsFragment settingsFragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_main);
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||
return insets;
|
||||
});
|
||||
|
||||
BottomNavigationView bottomNav = findViewById(R.id.bottom_navigation);
|
||||
|
||||
// Create fragment instances
|
||||
exercisesFragment = new ExercisesFragment();
|
||||
workoutsFragment = new WorkoutsFragment();
|
||||
progressFragment = new ProgressFragment();
|
||||
settingsFragment = new SettingsFragment();
|
||||
|
||||
// Load default fragment
|
||||
loadFragment(exercisesFragment);
|
||||
|
||||
// Set up bottom navigation
|
||||
bottomNav.setOnItemSelectedListener(item -> {
|
||||
Fragment selectedFragment = null;
|
||||
|
||||
if (item.getItemId() == R.id.nav_exercises) {
|
||||
selectedFragment = exercisesFragment;
|
||||
} else if (item.getItemId() == R.id.nav_workouts) {
|
||||
selectedFragment = workoutsFragment;
|
||||
} else if (item.getItemId() == R.id.nav_progress) {
|
||||
selectedFragment = progressFragment;
|
||||
} else if (item.getItemId() == R.id.nav_settings) {
|
||||
selectedFragment = settingsFragment;
|
||||
}
|
||||
|
||||
if (selectedFragment != null) {
|
||||
loadFragment(selectedFragment);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
private void loadFragment(Fragment fragment) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||
fragmentTransaction.replace(R.id.fragment_container, fragment);
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.example.gymflow_martim.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
import models.Exercise;
|
||||
import models.db.DbHelper;
|
||||
import models.FeedReaderContract;
|
||||
import adapters.ExerciseAdapter;
|
||||
|
||||
public class ExercisesFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private ExerciseAdapter adapter;
|
||||
private DbHelper dbHelper;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.fragment_exercises, container, false);
|
||||
|
||||
recyclerView = root.findViewById(R.id.recyclerView);
|
||||
Button buttonAdd = root.findViewById(R.id.buttonAdd);
|
||||
|
||||
dbHelper = DbHelper.getInstance(requireContext());
|
||||
|
||||
adapter = new ExerciseAdapter();
|
||||
adapter.setOnItemClickListener(exercise -> {
|
||||
// TODO: Show exercise details dialog
|
||||
});
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
buttonAdd.setOnClickListener(v -> showAddExerciseDialog());
|
||||
|
||||
loadExercises();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void loadExercises() {
|
||||
Cursor cursor = dbHelper.getAllExercises();
|
||||
adapter.setExercises(cursor);
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void showAddExerciseDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
View dialogView = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_add_exercise, null);
|
||||
|
||||
EditText editTextName = dialogView.findViewById(R.id.editTextName);
|
||||
EditText editTextSets = dialogView.findViewById(R.id.editTextSets);
|
||||
EditText editTextReps = dialogView.findViewById(R.id.editTextReps);
|
||||
|
||||
builder.setView(dialogView)
|
||||
.setTitle("Adicionar Exercício")
|
||||
.setPositiveButton("Adicionar", (dialog, which) -> {
|
||||
String name = editTextName.getText().toString();
|
||||
String setsStr = editTextSets.getText().toString();
|
||||
String repsStr = editTextReps.getText().toString();
|
||||
|
||||
if (name.isEmpty() || setsStr.isEmpty() || repsStr.isEmpty()) {
|
||||
Toast.makeText(requireContext(), "Por favor, preencha todos os campos", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
Exercise exercise = new Exercise(name, Integer.parseInt(setsStr), Integer.parseInt(repsStr));
|
||||
dbHelper.addExercise(exercise);
|
||||
loadExercises();
|
||||
Toast.makeText(requireContext(), "Exercício adicionado", Toast.LENGTH_SHORT).show();
|
||||
})
|
||||
.setNegativeButton("Cancelar", null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.example.gymflow_martim.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
import models.ProgressEntry;
|
||||
import models.db.DbHelper;
|
||||
import models.FeedReaderContract;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ProgressFragment extends Fragment {
|
||||
|
||||
private TextView textViewCurrentDate;
|
||||
private TextView textViewValue;
|
||||
private DbHelper dbHelper;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.fragment_progress, container, false);
|
||||
|
||||
textViewCurrentDate = root.findViewById(R.id.textViewCurrentDate);
|
||||
textViewValue = root.findViewById(R.id.textViewValue);
|
||||
Button buttonAdd = root.findViewById(R.id.buttonAdd);
|
||||
|
||||
dbHelper = DbHelper.getInstance(requireContext());
|
||||
|
||||
buttonAdd.setOnClickListener(v -> showAddProgressDialog());
|
||||
|
||||
loadLatestProgress();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void loadLatestProgress() {
|
||||
Cursor cursor = dbHelper.getAllProgressEntries("Peso corporal");
|
||||
|
||||
if (cursor != null && cursor.moveToLast()) {
|
||||
String date = cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.ProgressEntry.COLUMN_DATE));
|
||||
double value = cursor.getDouble(cursor.getColumnIndexOrThrow(FeedReaderContract.ProgressEntry.COLUMN_VALUE));
|
||||
|
||||
textViewCurrentDate.setText(date);
|
||||
textViewValue.setText(String.format(Locale.getDefault(), "%.1f kg", value));
|
||||
}
|
||||
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void showAddProgressDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
View dialogView = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_add_progress, null);
|
||||
|
||||
EditText editTextValue = dialogView.findViewById(R.id.editTextValue);
|
||||
|
||||
builder.setView(dialogView)
|
||||
.setTitle("Adicionar Registo")
|
||||
.setPositiveButton("Adicionar", (dialog, which) -> {
|
||||
String valueStr = editTextValue.getText().toString();
|
||||
|
||||
if (valueStr.isEmpty()) {
|
||||
Toast.makeText(requireContext(), "Por favor, insira o valor", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy", Locale.getDefault());
|
||||
String date = sdf.format(new Date());
|
||||
|
||||
ProgressEntry entry = new ProgressEntry(date, "Peso corporal", Double.parseDouble(valueStr));
|
||||
dbHelper.addProgressEntry(entry);
|
||||
loadLatestProgress();
|
||||
Toast.makeText(requireContext(), "Registo adicionado", Toast.LENGTH_SHORT).show();
|
||||
})
|
||||
.setNegativeButton("Cancelar", null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.example.gymflow_martim.fragments;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
import models.User;
|
||||
import models.db.DbHelper;
|
||||
import models.FeedReaderContract;
|
||||
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
public class SettingsFragment extends Fragment {
|
||||
|
||||
private EditText editTextName;
|
||||
private EditText editTextAge;
|
||||
private EditText editTextHeight;
|
||||
private EditText editTextWeight;
|
||||
private Spinner spinnerGender;
|
||||
private RadioGroup radioGroupTheme;
|
||||
private RadioButton radioLight;
|
||||
private DbHelper dbHelper;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
|
||||
editTextName = root.findViewById(R.id.editTextName);
|
||||
editTextAge = root.findViewById(R.id.editTextAge);
|
||||
editTextHeight = root.findViewById(R.id.editTextHeight);
|
||||
editTextWeight = root.findViewById(R.id.editTextWeight);
|
||||
spinnerGender = root.findViewById(R.id.spinnerGender);
|
||||
radioGroupTheme = root.findViewById(R.id.radioGroupTheme);
|
||||
radioLight = root.findViewById(R.id.radioLight);
|
||||
|
||||
Button buttonSave = root.findViewById(R.id.buttonSave);
|
||||
|
||||
dbHelper = DbHelper.getInstance(requireContext());
|
||||
|
||||
String[] genders = {"Masculino", "Feminino"};
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(), android.R.layout.simple_spinner_item, genders);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinnerGender.setAdapter(adapter);
|
||||
|
||||
buttonSave.setOnClickListener(v -> saveSettings());
|
||||
|
||||
loadSettings();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void loadSettings() {
|
||||
if (dbHelper.userExists()) {
|
||||
Cursor cursor = dbHelper.getUser();
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
editTextName.setText(cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.UserEntry.COLUMN_NAME)));
|
||||
editTextAge.setText(String.valueOf(cursor.getInt(cursor.getColumnIndexOrThrow(FeedReaderContract.UserEntry.COLUMN_AGE))));
|
||||
editTextHeight.setText(String.valueOf(cursor.getDouble(cursor.getColumnIndexOrThrow(FeedReaderContract.UserEntry.COLUMN_HEIGHT))));
|
||||
editTextWeight.setText(String.valueOf(cursor.getDouble(cursor.getColumnIndexOrThrow(FeedReaderContract.UserEntry.COLUMN_WEIGHT))));
|
||||
String gender = cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.UserEntry.COLUMN_GENDER));
|
||||
int position = gender.equals("Masculino") ? 0 : 1;
|
||||
spinnerGender.setSelection(position);
|
||||
String theme = cursor.getString(cursor.getColumnIndexOrThrow(FeedReaderContract.UserEntry.COLUMN_THEME));
|
||||
if ("Escuro".equals(theme)) {
|
||||
radioGroupTheme.check(R.id.radioDark);
|
||||
}
|
||||
}
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveSettings() {
|
||||
String name = editTextName.getText().toString();
|
||||
String ageStr = editTextAge.getText().toString();
|
||||
String heightStr = editTextHeight.getText().toString();
|
||||
String weightStr = editTextWeight.getText().toString();
|
||||
String gender = spinnerGender.getSelectedItem().toString();
|
||||
|
||||
RadioButton selectedRadio = getView().findViewById(radioGroupTheme.getCheckedRadioButtonId());
|
||||
String theme = selectedRadio.getText().toString();
|
||||
|
||||
if (name.isEmpty() || ageStr.isEmpty() || heightStr.isEmpty() || weightStr.isEmpty()) {
|
||||
Toast.makeText(requireContext(), "Por favor, preencha todos os campos", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
User user = new User(name, Integer.parseInt(ageStr), Double.parseDouble(heightStr),
|
||||
Double.parseDouble(weightStr), gender, theme);
|
||||
|
||||
if (dbHelper.userExists()) {
|
||||
dbHelper.updateUser(user);
|
||||
Toast.makeText(requireContext(), "Dados atualizados", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
dbHelper.saveUser(user);
|
||||
Toast.makeText(requireContext(), "Dados guardados", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.example.gymflow_martim.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.database.Cursor;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.gymflow_martim.R;
|
||||
import models.Workout;
|
||||
import models.db.DbHelper;
|
||||
import adapters.WorkoutAdapter;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class WorkoutsFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private WorkoutAdapter adapter;
|
||||
private DbHelper dbHelper;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.fragment_workouts, container, false);
|
||||
|
||||
recyclerView = root.findViewById(R.id.recyclerView);
|
||||
Button buttonCreate = root.findViewById(R.id.buttonCreate);
|
||||
|
||||
dbHelper = DbHelper.getInstance(requireContext());
|
||||
|
||||
adapter = new WorkoutAdapter();
|
||||
adapter.setOnItemClickListener(workout -> {
|
||||
// TODO: Show workout details dialog
|
||||
});
|
||||
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
buttonCreate.setOnClickListener(v -> showCreateWorkoutDialog());
|
||||
|
||||
loadWorkouts();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void loadWorkouts() {
|
||||
Cursor cursor = dbHelper.getAllWorkouts();
|
||||
adapter.setWorkouts(cursor);
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void showCreateWorkoutDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||
View dialogView = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_add_workout, null);
|
||||
|
||||
EditText editTextName = dialogView.findViewById(R.id.editTextName);
|
||||
|
||||
builder.setView(dialogView)
|
||||
.setTitle("Criar Novo Treino")
|
||||
.setPositiveButton("Criar", (dialog, which) -> {
|
||||
String name = editTextName.getText().toString();
|
||||
|
||||
if (name.isEmpty()) {
|
||||
Toast.makeText(requireContext(), "Por favor, insira o nome do treino", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());
|
||||
String date = sdf.format(new Date());
|
||||
|
||||
Workout workout = new Workout(name, date);
|
||||
dbHelper.addWorkout(workout);
|
||||
loadWorkouts();
|
||||
Toast.makeText(requireContext(), "Treino criado", Toast.LENGTH_SHORT).show();
|
||||
})
|
||||
.setNegativeButton("Cancelar", null)
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package models;
|
||||
|
||||
public class Exercise {
|
||||
private int id;
|
||||
private String name;
|
||||
private int sets;
|
||||
private int reps;
|
||||
|
||||
public Exercise() {
|
||||
}
|
||||
|
||||
public Exercise(String name, int sets, int reps) {
|
||||
this.name = name;
|
||||
this.sets = sets;
|
||||
this.reps = reps;
|
||||
}
|
||||
|
||||
public Exercise(int id, String name, int sets, int reps) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.sets = sets;
|
||||
this.reps = reps;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getSets() {
|
||||
return sets;
|
||||
}
|
||||
|
||||
public void setSets(int sets) {
|
||||
this.sets = sets;
|
||||
}
|
||||
|
||||
public int getReps() {
|
||||
return reps;
|
||||
}
|
||||
|
||||
public void setReps(int reps) {
|
||||
this.reps = reps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return sets + " x " + reps;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package models;
|
||||
|
||||
public class FeedReaderContract {
|
||||
|
||||
public static class ExerciseEntry {
|
||||
public static final String TABLE_NAME = "exercises";
|
||||
public static final String COLUMN_ID = "id";
|
||||
public static final String COLUMN_NAME = "name";
|
||||
public static final String COLUMN_SETS = "sets";
|
||||
public static final String COLUMN_REPS = "reps";
|
||||
}
|
||||
|
||||
public static class WorkoutEntry {
|
||||
public static final String TABLE_NAME = "workouts";
|
||||
public static final String COLUMN_ID = "id";
|
||||
public static final String COLUMN_NAME = "name";
|
||||
public static final String COLUMN_DATE = "date";
|
||||
}
|
||||
|
||||
public static class WorkoutExerciseEntry {
|
||||
public static final String TABLE_NAME = "workout_exercises";
|
||||
public static final String COLUMN_ID = "id";
|
||||
public static final String COLUMN_WORKOUT_ID = "workout_id";
|
||||
public static final String COLUMN_EXERCISE_NAME = "exercise_name";
|
||||
public static final String COLUMN_SETS = "sets";
|
||||
public static final String COLUMN_REPS = "reps";
|
||||
}
|
||||
|
||||
public static class ProgressEntry {
|
||||
public static final String TABLE_NAME = "progress";
|
||||
public static final String COLUMN_ID = "id";
|
||||
public static final String COLUMN_DATE = "date";
|
||||
public static final String COLUMN_METRIC = "metric";
|
||||
public static final String COLUMN_VALUE = "value";
|
||||
}
|
||||
|
||||
public static class UserEntry {
|
||||
public static final String TABLE_NAME = "user";
|
||||
public static final String COLUMN_ID = "id";
|
||||
public static final String COLUMN_NAME = "name";
|
||||
public static final String COLUMN_AGE = "age";
|
||||
public static final String COLUMN_HEIGHT = "height";
|
||||
public static final String COLUMN_WEIGHT = "weight";
|
||||
public static final String COLUMN_GENDER = "gender";
|
||||
public static final String COLUMN_THEME = "theme";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package models;
|
||||
|
||||
public class ProgressEntry {
|
||||
private int id;
|
||||
private String date;
|
||||
private String metric;
|
||||
private double value;
|
||||
|
||||
public ProgressEntry() {
|
||||
}
|
||||
|
||||
public ProgressEntry(String date, String metric, double value) {
|
||||
this.date = date;
|
||||
this.metric = metric;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public ProgressEntry(int id, String date, String metric, double value) {
|
||||
this.id = id;
|
||||
this.date = date;
|
||||
this.metric = metric;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(String date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getMetric() {
|
||||
return metric;
|
||||
}
|
||||
|
||||
public void setMetric(String metric) {
|
||||
this.metric = metric;
|
||||
}
|
||||
|
||||
public double getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(double value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package models;
|
||||
|
||||
public class User {
|
||||
private int id;
|
||||
private String name;
|
||||
private int age;
|
||||
private double height;
|
||||
private double weight;
|
||||
private String gender;
|
||||
private String theme;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public User(String name, int age, double height, double weight, String gender, String theme) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
this.height = height;
|
||||
this.weight = weight;
|
||||
this.gender = gender;
|
||||
this.theme = theme;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public double getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(double height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public double getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getTheme() {
|
||||
return theme;
|
||||
}
|
||||
|
||||
public void setTheme(String theme) {
|
||||
this.theme = theme;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package models;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Workout {
|
||||
private int id;
|
||||
private String name;
|
||||
private String date;
|
||||
private List<Exercise> exercises;
|
||||
|
||||
public Workout() {
|
||||
}
|
||||
|
||||
public Workout(String name, String date) {
|
||||
this.name = name;
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public Workout(int id, String name, String date) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(String date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public List<Exercise> getExercises() {
|
||||
return exercises;
|
||||
}
|
||||
|
||||
public void setExercises(List<Exercise> exercises) {
|
||||
this.exercises = exercises;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
package models.db;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
import models.Exercise;
|
||||
import models.ProgressEntry;
|
||||
import models.User;
|
||||
import models.Workout;
|
||||
import models.FeedReaderContract;
|
||||
|
||||
public class DbHelper extends SQLiteOpenHelper {
|
||||
|
||||
private static final String DATABASE_NAME = "GymFlow.db";
|
||||
private static final int DATABASE_VERSION = 1;
|
||||
private static DbHelper instance;
|
||||
|
||||
private DbHelper(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
}
|
||||
|
||||
public static synchronized DbHelper getInstance(Context context) {
|
||||
if (instance == null) {
|
||||
instance = new DbHelper(context.getApplicationContext());
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
// Create exercises table
|
||||
String SQL_CREATE_EXERCISES_TABLE = "CREATE TABLE " +
|
||||
FeedReaderContract.ExerciseEntry.TABLE_NAME + " (" +
|
||||
FeedReaderContract.ExerciseEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
FeedReaderContract.ExerciseEntry.COLUMN_NAME + " TEXT NOT NULL, " +
|
||||
FeedReaderContract.ExerciseEntry.COLUMN_SETS + " INTEGER NOT NULL, " +
|
||||
FeedReaderContract.ExerciseEntry.COLUMN_REPS + " INTEGER NOT NULL);";
|
||||
|
||||
// Create workouts table
|
||||
String SQL_CREATE_WORKOUTS_TABLE = "CREATE TABLE " +
|
||||
FeedReaderContract.WorkoutEntry.TABLE_NAME + " (" +
|
||||
FeedReaderContract.WorkoutEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
FeedReaderContract.WorkoutEntry.COLUMN_NAME + " TEXT NOT NULL, " +
|
||||
FeedReaderContract.WorkoutEntry.COLUMN_DATE + " TEXT NOT NULL);";
|
||||
|
||||
// Create workout_exercises table
|
||||
String SQL_CREATE_WORKOUT_EXERCISES_TABLE = "CREATE TABLE " +
|
||||
FeedReaderContract.WorkoutExerciseEntry.TABLE_NAME + " (" +
|
||||
FeedReaderContract.WorkoutExerciseEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
FeedReaderContract.WorkoutExerciseEntry.COLUMN_WORKOUT_ID + " INTEGER NOT NULL, " +
|
||||
FeedReaderContract.WorkoutExerciseEntry.COLUMN_EXERCISE_NAME + " TEXT NOT NULL, " +
|
||||
FeedReaderContract.WorkoutExerciseEntry.COLUMN_SETS + " INTEGER NOT NULL, " +
|
||||
FeedReaderContract.WorkoutExerciseEntry.COLUMN_REPS + " INTEGER NOT NULL);";
|
||||
|
||||
// Create progress table
|
||||
String SQL_CREATE_PROGRESS_TABLE = "CREATE TABLE " +
|
||||
FeedReaderContract.ProgressEntry.TABLE_NAME + " (" +
|
||||
FeedReaderContract.ProgressEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
FeedReaderContract.ProgressEntry.COLUMN_DATE + " TEXT NOT NULL, " +
|
||||
FeedReaderContract.ProgressEntry.COLUMN_METRIC + " TEXT NOT NULL, " +
|
||||
FeedReaderContract.ProgressEntry.COLUMN_VALUE + " REAL NOT NULL);";
|
||||
|
||||
// Create user table
|
||||
String SQL_CREATE_USER_TABLE = "CREATE TABLE " +
|
||||
FeedReaderContract.UserEntry.TABLE_NAME + " (" +
|
||||
FeedReaderContract.UserEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
FeedReaderContract.UserEntry.COLUMN_NAME + " TEXT, " +
|
||||
FeedReaderContract.UserEntry.COLUMN_AGE + " INTEGER, " +
|
||||
FeedReaderContract.UserEntry.COLUMN_HEIGHT + " REAL, " +
|
||||
FeedReaderContract.UserEntry.COLUMN_WEIGHT + " REAL, " +
|
||||
FeedReaderContract.UserEntry.COLUMN_GENDER + " TEXT, " +
|
||||
FeedReaderContract.UserEntry.COLUMN_THEME + " TEXT);";
|
||||
|
||||
db.execSQL(SQL_CREATE_EXERCISES_TABLE);
|
||||
db.execSQL(SQL_CREATE_WORKOUTS_TABLE);
|
||||
db.execSQL(SQL_CREATE_WORKOUT_EXERCISES_TABLE);
|
||||
db.execSQL(SQL_CREATE_PROGRESS_TABLE);
|
||||
db.execSQL(SQL_CREATE_USER_TABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
db.execSQL("DROP TABLE IF EXISTS " + FeedReaderContract.ExerciseEntry.TABLE_NAME);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + FeedReaderContract.WorkoutEntry.TABLE_NAME);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + FeedReaderContract.WorkoutExerciseEntry.TABLE_NAME);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + FeedReaderContract.ProgressEntry.TABLE_NAME);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + FeedReaderContract.UserEntry.TABLE_NAME);
|
||||
onCreate(db);
|
||||
}
|
||||
|
||||
// Exercise methods
|
||||
public long addExercise(Exercise exercise) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(FeedReaderContract.ExerciseEntry.COLUMN_NAME, exercise.getName());
|
||||
values.put(FeedReaderContract.ExerciseEntry.COLUMN_SETS, exercise.getSets());
|
||||
values.put(FeedReaderContract.ExerciseEntry.COLUMN_REPS, exercise.getReps());
|
||||
return db.insert(FeedReaderContract.ExerciseEntry.TABLE_NAME, null, values);
|
||||
}
|
||||
|
||||
public Cursor getAllExercises() {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
return db.query(FeedReaderContract.ExerciseEntry.TABLE_NAME,
|
||||
null, null, null, null, null, FeedReaderContract.ExerciseEntry.COLUMN_NAME);
|
||||
}
|
||||
|
||||
public boolean deleteExercise(int id) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
return db.delete(FeedReaderContract.ExerciseEntry.TABLE_NAME,
|
||||
FeedReaderContract.ExerciseEntry.COLUMN_ID + "=?", new String[]{String.valueOf(id)}) > 0;
|
||||
}
|
||||
|
||||
// Workout methods
|
||||
public long addWorkout(Workout workout) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(FeedReaderContract.WorkoutEntry.COLUMN_NAME, workout.getName());
|
||||
values.put(FeedReaderContract.WorkoutEntry.COLUMN_DATE, workout.getDate());
|
||||
return db.insert(FeedReaderContract.WorkoutEntry.TABLE_NAME, null, values);
|
||||
}
|
||||
|
||||
public Cursor getAllWorkouts() {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
return db.query(FeedReaderContract.WorkoutEntry.TABLE_NAME,
|
||||
null, null, null, null, null, FeedReaderContract.WorkoutEntry.COLUMN_DATE + " DESC");
|
||||
}
|
||||
|
||||
public boolean deleteWorkout(int id) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
db.delete(FeedReaderContract.WorkoutExerciseEntry.TABLE_NAME,
|
||||
FeedReaderContract.WorkoutExerciseEntry.COLUMN_WORKOUT_ID + "=?", new String[]{String.valueOf(id)});
|
||||
return db.delete(FeedReaderContract.WorkoutEntry.TABLE_NAME,
|
||||
FeedReaderContract.WorkoutEntry.COLUMN_ID + "=?", new String[]{String.valueOf(id)}) > 0;
|
||||
}
|
||||
|
||||
// Progress methods
|
||||
public long addProgressEntry(ProgressEntry entry) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(FeedReaderContract.ProgressEntry.COLUMN_DATE, entry.getDate());
|
||||
values.put(FeedReaderContract.ProgressEntry.COLUMN_METRIC, entry.getMetric());
|
||||
values.put(FeedReaderContract.ProgressEntry.COLUMN_VALUE, entry.getValue());
|
||||
return db.insert(FeedReaderContract.ProgressEntry.TABLE_NAME, null, values);
|
||||
}
|
||||
|
||||
public Cursor getAllProgressEntries(String metric) {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
String selection = FeedReaderContract.ProgressEntry.COLUMN_METRIC + "=?";
|
||||
String[] selectionArgs = {metric};
|
||||
return db.query(FeedReaderContract.ProgressEntry.TABLE_NAME,
|
||||
null, selection, selectionArgs, null, null, FeedReaderContract.ProgressEntry.COLUMN_DATE + " ASC");
|
||||
}
|
||||
|
||||
// User methods
|
||||
public long saveUser(User user) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_NAME, user.getName());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_AGE, user.getAge());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_HEIGHT, user.getHeight());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_WEIGHT, user.getWeight());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_GENDER, user.getGender());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_THEME, user.getTheme());
|
||||
return db.insert(FeedReaderContract.UserEntry.TABLE_NAME, null, values);
|
||||
}
|
||||
|
||||
public void updateUser(User user) {
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_NAME, user.getName());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_AGE, user.getAge());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_HEIGHT, user.getHeight());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_WEIGHT, user.getWeight());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_GENDER, user.getGender());
|
||||
values.put(FeedReaderContract.UserEntry.COLUMN_THEME, user.getTheme());
|
||||
db.update(FeedReaderContract.UserEntry.TABLE_NAME, values,
|
||||
FeedReaderContract.UserEntry.COLUMN_ID + "=1", null);
|
||||
}
|
||||
|
||||
public Cursor getUser() {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
return db.query(FeedReaderContract.UserEntry.TABLE_NAME,
|
||||
null, null, null, null, null, null, "1");
|
||||
}
|
||||
|
||||
public boolean userExists() {
|
||||
SQLiteDatabase db = this.getReadableDatabase();
|
||||
Cursor cursor = db.query(FeedReaderContract.UserEntry.TABLE_NAME,
|
||||
new String[]{FeedReaderContract.UserEntry.COLUMN_ID},
|
||||
null, null, null, null, null, "1");
|
||||
boolean exists = cursor.getCount() > 0;
|
||||
cursor.close();
|
||||
return exists;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<corners android:radius="16dp"/>
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E0E0E0"/>
|
||||
<padding
|
||||
android:left="16dp"
|
||||
android:top="16dp"
|
||||
android:right="16dp"
|
||||
android:bottom="16dp"/>
|
||||
</shape>
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/white"/>
|
||||
<corners android:radius="16dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:top="0dp"
|
||||
android:left="0dp"
|
||||
android:width="4dp"
|
||||
android:gravity="start">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/md_primary"/>
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#E8F4F8"
|
||||
android:pathData="M0,0h12v12H0z"/>
|
||||
<path
|
||||
android:fillColor="#F5F5F5"
|
||||
android:pathData="M12,12h12v12H12z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="200dp"
|
||||
android:height="200dp"
|
||||
android:viewportWidth="200"
|
||||
android:viewportHeight="200">
|
||||
<!-- Gym icon/dumbbell illustration -->
|
||||
<group>
|
||||
<!-- Left dumbbell -->
|
||||
<path
|
||||
android:fillColor="#BDBDBD"
|
||||
android:pathData="M50,100 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0"/>
|
||||
<path
|
||||
android:fillColor="#9E9E9E"
|
||||
android:pathData="M40,100 Q40,85 40,70 L60,70 L60,85 Q60,100 60,100 L40,100"/>
|
||||
<path
|
||||
android:fillColor="#9E9E9E"
|
||||
android:pathData="M40,130 Q40,145 40,160 L60,160 L60,145 Q60,130 60,130 L40,130"/>
|
||||
|
||||
<!-- Center bar -->
|
||||
<path
|
||||
android:fillColor="#757575"
|
||||
android:pathData="M60,70 L140,70 L140,130 L60,130 Z"/>
|
||||
|
||||
<!-- Right dumbbell -->
|
||||
<path
|
||||
android:fillColor="#BDBDBD"
|
||||
android:pathData="M150,100 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0"/>
|
||||
<path
|
||||
android:fillColor="#9E9E9E"
|
||||
android:pathData="M140,100 Q140,85 140,70 L160,70 L160,85 Q160,100 160,100 L140,100"/>
|
||||
<path
|
||||
android:fillColor="#9E9E9E"
|
||||
android:pathData="M140,130 Q140,145 140,160 L160,160 L160,145 Q160,130 160,130 L140,130"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="200dp"
|
||||
android:height="200dp"
|
||||
android:viewportWidth="200"
|
||||
android:viewportHeight="200">
|
||||
<!-- Progress chart illustration -->
|
||||
<path
|
||||
android:fillColor="#E3F2FD"
|
||||
android:pathData="M20,180 L20,20 L180,20 L180,180 Z"/>
|
||||
<path
|
||||
android:strokeColor="#2196F3"
|
||||
android:strokeWidth="4"
|
||||
android:pathData="M40,120 L80,100 L120,80 L160,60"/>
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M40,120 m -6,0 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"/>
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M80,100 m -6,0 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"/>
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M120,80 m -6,0 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"/>
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M160,60 m -6,0 a 6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="200dp"
|
||||
android:height="200dp"
|
||||
android:viewportWidth="200"
|
||||
android:viewportHeight="200">
|
||||
<!-- Calendar illustration -->
|
||||
<path
|
||||
android:fillColor="#E3F2FD"
|
||||
android:pathData="M20,20 L20,180 L180,180 L180,20 Z"/>
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M20,20 L180,20 L180,60 L20,60 Z"/>
|
||||
<path
|
||||
android:fillColor="#1976D2"
|
||||
android:pathData="M30,30 L50,30 L50,50 L30,50 Z"/>
|
||||
<path
|
||||
android:fillColor="#1976D2"
|
||||
android:pathData="M60,30 L80,30 L80,50 L60,50 Z"/>
|
||||
<path
|
||||
android:fillColor="#1976D2"
|
||||
android:pathData="M90,30 L110,30 L110,50 L90,50 Z"/>
|
||||
<path
|
||||
android:fillColor="#1976D2"
|
||||
android:pathData="M120,30 L140,30 L140,50 L120,50 Z"/>
|
||||
<path
|
||||
android:fillColor="#1976D2"
|
||||
android:pathData="M150,30 L170,30 L170,50 L150,50 Z"/>
|
||||
<path
|
||||
android:strokeColor="#1976D2"
|
||||
android:strokeWidth="3"
|
||||
android:pathData="M50,90 L80,110 L100,85 L120,130 L150,80"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M19,3L20,3C21.11,3 22,3.89 22,5L22,19C22,20.11 21.11,21 20,21L4,21C2.89,21 2,20.11 2,19L2,5C2,3.89 2.89,3 4,3L5,3L5,1L7,1L7,3L17,3L17,1L19,1L19,3M20,5L4,5L4,8L20,8L20,5M20,10L4,10L4,19L20,19L20,10M6,12L8,12L8,14L6,14L6,12M11,12L13,12L13,14L11,14L11,12M16,12L18,12L18,14L16,14L16,12"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M20.57,14.66L22,13.24L20.57,11.82C20.38,11.63 20.18,11.41 19.97,11.18C19.76,10.95 19.57,10.74 19.41,10.56L18,12L16.58,10.56C16.43,10.74 16.24,10.95 16.03,11.18C15.82,11.41 15.62,11.63 15.43,11.82L14,10.35L12.59,11.76C12.4,11.95 12.18,12.14 11.95,12.35C11.72,12.56 11.53,12.75 11.35,12.91L12.76,14.32L11.35,15.72C11.53,15.87 11.72,16.06 11.95,16.27C12.18,16.48 12.4,16.66 12.59,16.85L14,15.44L15.43,16.87C15.62,17.06 15.82,17.24 16.03,17.45C16.24,17.66 16.43,17.85 16.58,18L18,16.59L19.41,18C19.57,17.85 19.76,17.66 19.97,17.45C20.18,17.24 20.38,17.06 20.57,16.87L22,18.3L20.57,19.72C20.38,19.53 20.18,19.32 19.97,19.09C19.76,18.86 19.57,18.65 19.41,18.47L18,19.88L16.58,18.47C16.43,18.65 16.24,18.86 16.03,19.09C15.82,19.32 15.62,19.53 15.43,19.72L14,18.3L12.59,19.72C12.4,19.53 12.18,19.32 11.95,19.09C11.72,18.86 11.53,18.65 11.35,18.47L10,19.82L8.59,18.41L9.41,17.59L8,16.18L9.41,14.76L8,13.35L9.41,11.94L8,10.53L9.41,9.12L8.59,8.29L10,6.88L11.35,8.23C11.53,8.06 11.72,7.86 11.95,7.65C12.18,7.44 12.4,7.25 12.59,7.07L14,8.48L15.43,7.06C15.62,6.87 15.82,6.69 16.03,6.48C16.24,6.27 16.43,6.08 16.58,5.94L18,7.35L19.41,5.94C19.57,6.08 19.76,6.27 19.97,6.48C20.18,6.69 20.38,6.87 20.57,7.06L22,5.65L20.57,4.23L19.41,5.41L18,4L16.58,5.41L15.43,4.23L14,5.65L12.59,4.24L11.41,5.41L12.82,6.82L11.41,8.24L12.82,9.65L11.41,11.06L12.82,12.47L11.41,13.88L12.82,15.29L11.41,16.7L12.82,18.12L11.41,19.53L12.82,20.94L11.41,22.35L12.59,23.53L14,22.12L15.43,23.53L16.58,22.35L18,23.76L19.41,22.35L20.57,23.53L22,22.12L20.57,20.7Z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M16,11.78L20.24,4.45L21.97,5.45L16.74,14.5L10.23,10.75L5.46,19H22V21H2V3H4V17.54L9.5,8L15.25,11.25L20.24,4.45L20.24,4.45Z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="200dp"
|
||||
android:height="200dp"
|
||||
android:viewportWidth="200"
|
||||
android:viewportHeight="200">
|
||||
|
||||
<!-- Background -->
|
||||
<path
|
||||
android:fillColor="#F44336"
|
||||
android:pathData="M0,0h200v200H0z"/>
|
||||
|
||||
<!-- Torso outline -->
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M100,30 Q100,25 105,25 L120,25 Q125,25 125,30 L125,70 Q125,75 120,75 L110,75 L110,90 L115,95 L115,110 L105,110 L100,115 L95,110 L85,110 L85,95 L90,90 L90,75 L80,75 Q75,75 75,70 L75,30 Q75,25 80,25 L95,25 Q100,25 100,30 Z"/>
|
||||
|
||||
<!-- Tank top -->
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M90,35 L90,55 L75,60 L75,65 L100,70 L125,65 L125,60 L110,55 L110,35 L90,35 Z"/>
|
||||
|
||||
<!-- Hand lifting tank top (left) -->
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M70,40 Q65,38 60,40 L58,50 Q60,55 65,53 Q70,51 70,47 Z"/>
|
||||
|
||||
<!-- Hand pointing (right) -->
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="3"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M130,75 L145,70 L148,75 L145,80 Z"/>
|
||||
|
||||
<!-- Wristband -->
|
||||
<path
|
||||
android:fillColor="#008B8B"
|
||||
android:pathData="M145,72 L148,72 L148,78 L145,78 Z"/>
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M145,74 L148,74 M145,76 L148,76"/>
|
||||
|
||||
<!-- Six-pack abs -->
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="2"
|
||||
android:pathData="M95,80 L105,80 M90,90 L110,90 M95,100 L105,100"/>
|
||||
|
||||
<!-- Shield with number 30 -->
|
||||
<group>
|
||||
<path
|
||||
android:fillColor="#C62828"
|
||||
android:pathData="M160,20 L180,25 Q185,25 188,28 L190,35 Q190,40 185,42 L175,45 Q170,45 167,42 L165,35 Q165,30 168,28 L170,25 Q173,22 175,22 L178,23 Z"/>
|
||||
<path
|
||||
android:strokeColor="#FFFFFF"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:pathData="M165,25 L175,27 Q178,29 178,32 L178,38 Q178,41 175,43 L165,44 Q162,44 162,38 L162,32 Q162,28 165,26 Z"/>
|
||||
<!-- Note: VectorDrawable doesn't support <text>; removed to avoid resource linking errors. -->
|
||||
</group>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#F44336"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<!-- Muscular torso with six-pack -->
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="2.5"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M45,25 L50,20 L58,20 L63,25 L63,45 Q63,50 58,50 L52,52 L50,60 L48,52 L42,50 Q37,50 37,45 L37,25 Z"/>
|
||||
|
||||
<!-- Tank top -->
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M45,25 L45,35 L40,38 L40,42 L50,45 L60,42 L60,38 L55,35 L55,25 Z"/>
|
||||
|
||||
<!-- Six-pack ab definition -->
|
||||
<path
|
||||
android:strokeColor="#000000"
|
||||
android:strokeWidth="1.5"
|
||||
android:pathData="M48,48 L52,48 M46,53 L54,53 M48,58 L52,58"/>
|
||||
|
||||
<!-- Shield badge with number 30 -->
|
||||
<path
|
||||
android:fillColor="#C62828"
|
||||
android:pathData="M75,18 L85,20 Q88,22 88,25 L88,35 Q88,38 85,40 L75,42 Q72,40 72,37 L72,25 Q72,22 75,20 Z"/>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M76,21 L84,23 L84,33 L76,31 Z"/>
|
||||
<!-- Number 3 -->
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:strokeWidth="1.2"
|
||||
android:pathData="M78,25 Q79,26 79,27 L77,28 Q78,29 77,30 Q79,31 79,32 Q78,33 76,33 Q74,33 73.5,31.5 L75,30.5 Q75.5,31 76,31 Q76.5,30.5 76,30 Q76.5,29 75.5,28.5 Q75,28 75,27.5 Q75,27 75.5,27 Q78,26 78,27 Q79,26 79,27 Z"/>
|
||||
<!-- Number 0 -->
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M81,25.5 Q84,26 84,28.5 Q84,31 81,31.5 Q78,31 78,28.5 Q78,26 81,25.5 Z
|
||||
M82,27 Q81.5,27.5 82,28 Q82.5,28.5 83,28 Q83.5,27.5 82,27 Z"/>
|
||||
</vector>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11.03L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11.03C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.68 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"/>
|
||||
</vector>
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/md_primary" />
|
||||
<item android:state_enabled="true" android:color="@color/md_on_surface_variant" />
|
||||
<item android:color="@color/md_on_surface_variant" />
|
||||
|
||||
</selector>
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/main"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="@string/app_name"
|
||||
app:titleCentered="true"
|
||||
app:titleTextColor="@color/md_on_primary"
|
||||
app:backgroundTint="@color/md_primary" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:layout_marginBottom="72dp" />
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bottom_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
app:itemIconTint="@drawable/nav_item_color"
|
||||
app:itemTextColor="@drawable/nav_item_color"
|
||||
app:labelVisibilityMode="labeled"
|
||||
app:menu="@menu/bottom_nav_menu" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Nome do exercício" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Ex: Supino Reto"
|
||||
android:inputType="textPersonName"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Séries"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextSets"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="3"
|
||||
android:inputType="number"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Repetições"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextReps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="8"
|
||||
android:inputType="number"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Peso corporal (kg)" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="75.3"
|
||||
android:inputType="numberDecimal"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Nome do treino" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Ex: Treino A - Peito e Tríceps"
|
||||
android:inputType="textPersonName"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:background="@color/md_surface">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/textViewTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exercises"
|
||||
style="@style/TextAppearance.GymFlow.Headline"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/textViewTitle"
|
||||
app:layout_constraintBottom_toTopOf="@id/buttonAdd"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonAdd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_exercise"
|
||||
style="@style/Widget.GymFlow.PrimaryButton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:background="@color/md_surface">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/textViewTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/progress"
|
||||
style="@style/TextAppearance.GymFlow.Headline"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewCurrentDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
app:layout_constraintTop_toBottomOf="@id/textViewTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewMetric"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/body_weight"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/textViewCurrentDate"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0.0 kg"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@id/textViewMetric"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonAdd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_record"
|
||||
style="@style/Widget.GymFlow.PrimaryButton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/md_surface"
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/textViewTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings"
|
||||
style="@style/TextAppearance.GymFlow.Headline"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/name"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/textViewTitle"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/enter_name"
|
||||
android:inputType="textPersonName"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelName"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelAge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/age"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/editTextName"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextAge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/enter_age"
|
||||
android:inputType="number"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelAge"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelHeight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/height"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/editTextAge"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextHeight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/enter_height"
|
||||
android:inputType="numberDecimal"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelHeight"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelWeight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/weight"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/editTextHeight"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextWeight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/enter_weight"
|
||||
android:inputType="numberDecimal"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelWeight"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelGender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gender"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/editTextWeight"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinnerGender"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelGender"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/labelTheme"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/theme"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/spinnerGender"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroupTheme"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@id/labelTheme"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioLight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/light"
|
||||
android:checked="true" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radioDark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dark" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonSave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/save"
|
||||
style="@style/Widget.GymFlow.PrimaryButton"
|
||||
app:layout_constraintTop_toBottomOf="@id/radioGroupTheme"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="32dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:background="@color/md_surface">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/textViewTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/workouts"
|
||||
style="@style/TextAppearance.GymFlow.Headline"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/textViewTitle"
|
||||
app:layout_constraintBottom_toTopOf="@id/buttonCreate"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonCreate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/create_new_workout"
|
||||
style="@style/Widget.GymFlow.PrimaryButton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/bg_card_exercise">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_dumbbell"
|
||||
android:background="@color/md_primary_container"
|
||||
android:padding="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:tint="@color/md_primary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/textViewExerciseName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:text="Exercise Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSetsReps"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/md_on_surface_variant"
|
||||
android:text="3 x 8" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_menu_more"
|
||||
app:tint="@color/md_on_surface_variant" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_calendar"
|
||||
android:background="@color/md_primary_container"
|
||||
android:padding="12dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:tint="@color/md_primary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/textViewWorkoutName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:text="Workout Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/md_on_surface_variant"
|
||||
android:text="date" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@android:drawable/ic_menu_more"
|
||||
app:tint="@color/md_on_surface_variant" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/nav_exercises"
|
||||
android:icon="@drawable/ic_dumbbell"
|
||||
android:title="@string/exercises" />
|
||||
<item
|
||||
android:id="@+id/nav_workouts"
|
||||
android:icon="@drawable/ic_calendar"
|
||||
android:title="@string/workouts" />
|
||||
<item
|
||||
android:id="@+id/nav_progress"
|
||||
android:icon="@drawable/ic_graph"
|
||||
android:title="@string/progress" />
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_settings"
|
||||
android:title="@string/settings" />
|
||||
</menu>
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="md_primary">#90CAF9</color>
|
||||
<color name="md_on_primary">#002F6C</color>
|
||||
<color name="md_primary_container">#003C8F</color>
|
||||
<color name="md_on_primary_container">#D1E3FF</color>
|
||||
|
||||
<color name="md_surface">#121212</color>
|
||||
<color name="md_on_surface">#E3E3E3</color>
|
||||
<color name="md_surface_variant">#2C2C2C</color>
|
||||
<color name="md_on_surface_variant">#C6C6C6</color>
|
||||
|
||||
<color name="md_secondary">#8C88FF</color>
|
||||
<color name="md_on_secondary">#121212</color>
|
||||
</resources>
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.GymFlowMartim" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<!-- Material palette -->
|
||||
<color name="md_primary">#1565C0</color>
|
||||
<color name="md_on_primary">#FFFFFF</color>
|
||||
<color name="md_primary_container">#D1E3FF</color>
|
||||
<color name="md_on_primary_container">#001D36</color>
|
||||
|
||||
<color name="md_surface">#FFFBFE</color>
|
||||
<color name="md_on_surface">#1C1B1F</color>
|
||||
<color name="md_surface_variant">#E7E0EC</color>
|
||||
<color name="md_on_surface_variant">#49454F</color>
|
||||
|
||||
<color name="md_secondary">#5E5ADB</color>
|
||||
<color name="md_on_secondary">#FFFFFF</color>
|
||||
|
||||
<!-- Legacy aliases used by layouts -->
|
||||
<color name="blue">#2196F3</color>
|
||||
<color name="blue_dark">#1976D2</color>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<resources>
|
||||
<string name="app_name">GymFlow-Martim</string>
|
||||
|
||||
<!-- Navigation -->
|
||||
<string name="exercises">Exercícios</string>
|
||||
<string name="workouts">Treinos</string>
|
||||
<string name="progress">Progresso</string>
|
||||
<string name="settings">Definições</string>
|
||||
|
||||
<!-- Exercise Screen -->
|
||||
<string name="add_exercise">Adicionar Exercício</string>
|
||||
<string name="enter_exercise_name">Nome do exercício</string>
|
||||
<string name="sets">Séries</string>
|
||||
<string name="reps">Repetições</string>
|
||||
|
||||
<!-- Workout Screen -->
|
||||
<string name="create_new_workout">Criar Novo Treino</string>
|
||||
<string name="enter_workout_name">Nome do treino</string>
|
||||
|
||||
<!-- Progress Screen -->
|
||||
<string name="add_record">Adicionar Registo</string>
|
||||
<string name="body_weight">Peso corporal</string>
|
||||
|
||||
<!-- Settings Screen -->
|
||||
<string name="name">Nome</string>
|
||||
<string name="age">Idade</string>
|
||||
<string name="height">Altura (cm)</string>
|
||||
<string name="weight">Peso (kg)</string>
|
||||
<string name="gender">Género</string>
|
||||
<string name="theme">Tema da aplicação</string>
|
||||
<string name="light">Claro</string>
|
||||
<string name="dark">Escuro</string>
|
||||
<string name="save">Guardar</string>
|
||||
|
||||
<string name="enter_name">João</string>
|
||||
<string name="enter_age">29</string>
|
||||
<string name="enter_height">180</string>
|
||||
<string name="enter_weight">82.0</string>
|
||||
|
||||
<string name="male">Masculino</string>
|
||||
<string name="female">Feminino</string>
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<resources>
|
||||
|
||||
<!-- Text appearance used by textAppearanceHeadlineMedium in theme -->
|
||||
<style name="TextAppearance.GymFlow.Headline" parent="TextAppearance.MaterialComponents.Headline6">
|
||||
<item name="android:textColor">@color/md_on_surface</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">24sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
|
||||
|
||||
<style name="Theme.GymFlowMartim" parent="Base.Theme.GymFlowMartim" />
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.GymFlowMartim" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/md_primary</item>
|
||||
<item name="colorOnPrimary">@color/md_on_primary</item>
|
||||
<item name="colorPrimaryContainer">@color/md_primary_container</item>
|
||||
<item name="colorOnPrimaryContainer">@color/md_on_primary_container</item>
|
||||
<item name="colorSurface">@color/md_surface</item>
|
||||
<item name="colorOnSurface">@color/md_on_surface</item>
|
||||
<item name="colorSurfaceVariant">@color/md_surface_variant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_on_surface_variant</item>
|
||||
<item name="android:statusBarColor">?attr/colorPrimary</item>
|
||||
<item name="android:navigationBarColor">?attr/colorSurface</item>
|
||||
<item name="materialButtonStyle">@style/Widget.GymFlow.PrimaryButton</item>
|
||||
<item name="textAppearanceHeadlineMedium">@style/TextAppearance.GymFlow.Headline</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="Widget.GymFlow.PrimaryButton" parent="Widget.MaterialComponents.Button"><!-- Before -->
|
||||
<item name="backgroundTint">@color/md_primary</item>
|
||||
<item name="android:textColor">@color/md_on_primary</item>
|
||||
<item name="cornerRadius">16dp</item>
|
||||
<item name="android:insetLeft">0dp</item>
|
||||
<item name="android:insetRight">0dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older than API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.example.gymflow_martim;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. For more details, visit
|
||||
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
[versions]
|
||||
agp = "8.13.0"
|
||||
junit = "4.13.2"
|
||||
junitVersion = "1.1.5"
|
||||
espressoCore = "3.5.1"
|
||||
appcompat = "1.7.1"
|
||||
material = "1.10.0"
|
||||
activity = "1.11.0"
|
||||
constraintlayout = "2.1.4"
|
||||
recyclerview = "1.3.2"
|
||||
cardview = "1.0.0"
|
||||
coordinatorlayout = "1.2.0"
|
||||
|
||||
[libraries]
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
|
||||
activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
|
||||
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
||||
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
|
||||
cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardview" }
|
||||
coordinatorlayout = { group = "androidx.coordinatorlayout", name = "coordinatorlayout", version.ref = "coordinatorlayout" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#Thu Oct 23 15:45:18 WEST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
google {
|
||||
content {
|
||||
includeGroupByRegex("com\\.android.*")
|
||||
includeGroupByRegex("com\\.google.*")
|
||||
includeGroupByRegex("androidx.*")
|
||||
}
|
||||
}
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "GymFlow-Martim"
|
||||
include(":app")
|
||||
|
||||