Compare commits
11 Commits
a2709d0813
...
4e267fae79
Author | SHA1 | Date | |
---|---|---|---|
4e267fae79 | |||
a00d3b34b0 | |||
0745430fad | |||
33629d9c80 | |||
|
41389dad90 | ||
|
7e82560aac | ||
|
56d127fd3f | ||
5ebe213205 | |||
d2163fd034 | |||
36ace631fe | |||
20c1e7a178 |
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
|||||||
|
TimerT
|
1
.idea/misc.xml
generated
@ -1,4 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.android.application)
|
alias(libs.plugins.android.application)
|
||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
|
id("org.jetbrains.kotlin.kapt")
|
||||||
|
id("androidx.room")
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@ -33,6 +35,13 @@ android {
|
|||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "11"
|
jvmTarget = "11"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
//noinspection WrongGradleMethod
|
||||||
|
room {
|
||||||
|
schemaDirectory("$projectDir/schemas")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@ -45,4 +54,13 @@ dependencies {
|
|||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
androidTestImplementation(libs.androidx.junit)
|
androidTestImplementation(libs.androidx.junit)
|
||||||
androidTestImplementation(libs.androidx.espresso.core)
|
androidTestImplementation(libs.androidx.espresso.core)
|
||||||
}
|
|
||||||
|
// Room dependencies
|
||||||
|
implementation("androidx.room:room-runtime:2.7.1") // Замените на вашу версию
|
||||||
|
implementation("androidx.room:room-ktx:2.7.1") // Замените на вашу версию
|
||||||
|
kapt("androidx.room:room-compiler:2.7.1") // Замените на вашу версию
|
||||||
|
|
||||||
|
// Lifecycle dependencies
|
||||||
|
implementation ("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0") // Замените на вашу версию
|
||||||
|
implementation ("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0") // Замените на вашу версию
|
||||||
|
}
|
||||||
|
77
app/schemas/com.example.timert.AppDatabase/1.json
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
"formatVersion": 1,
|
||||||
|
"database": {
|
||||||
|
"version": 1,
|
||||||
|
"identityHash": "87cf8dcd07bc0b2c0a8d52dbb0eca913",
|
||||||
|
"entities": [
|
||||||
|
{
|
||||||
|
"tableName": "workouts",
|
||||||
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `numApproaches` INTEGER NOT NULL, `numExercises` INTEGER NOT NULL, `restBetweenExercises` INTEGER NOT NULL, `restBetweenApproaches` INTEGER NOT NULL, `exerciseDuration` INTEGER NOT NULL, `startTime` INTEGER, `endTime` INTEGER)",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldPath": "id",
|
||||||
|
"columnName": "id",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "name",
|
||||||
|
"columnName": "name",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "numApproaches",
|
||||||
|
"columnName": "numApproaches",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "numExercises",
|
||||||
|
"columnName": "numExercises",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "restBetweenExercises",
|
||||||
|
"columnName": "restBetweenExercises",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "restBetweenApproaches",
|
||||||
|
"columnName": "restBetweenApproaches",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "exerciseDuration",
|
||||||
|
"columnName": "exerciseDuration",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "startTime",
|
||||||
|
"columnName": "startTime",
|
||||||
|
"affinity": "INTEGER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "endTime",
|
||||||
|
"columnName": "endTime",
|
||||||
|
"affinity": "INTEGER"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primaryKey": {
|
||||||
|
"autoGenerate": true,
|
||||||
|
"columnNames": [
|
||||||
|
"id"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"setupQueries": [
|
||||||
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '87cf8dcd07bc0b2c0a8d52dbb0eca913')"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:name=".MyApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
@ -12,12 +13,24 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.TimerT"
|
android:theme="@style/Theme.TimerT"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name=".History"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".SettingsActivity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".CreatingTraining"
|
android:name=".CreatingTraining"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".timer"
|
android:name=".timer"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".AllTraining"
|
||||||
|
android:exported="true" />
|
||||||
|
<activity
|
||||||
|
android:name=".AddWorkout"
|
||||||
|
android:exported="true" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
|
BIN
app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 42 KiB |
9
app/src/main/java/AppDatabase.kt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package com.example.timert
|
||||||
|
import androidx.room.Database
|
||||||
|
import androidx.room.RoomDatabase
|
||||||
|
import com.example.timert.Workout
|
||||||
|
import com.example.timert.WorkoutDao
|
||||||
|
@Database(entities = [Workout::class], version = 1)
|
||||||
|
abstract class AppDatabase : RoomDatabase() {
|
||||||
|
abstract fun workoutDao(): WorkoutDao
|
||||||
|
}
|
17
app/src/main/java/Workout.kt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.timert
|
||||||
|
import androidx.room.Entity
|
||||||
|
import androidx.room.PrimaryKey
|
||||||
|
|
||||||
|
@Entity(tableName = "workouts")
|
||||||
|
data class Workout(
|
||||||
|
@PrimaryKey(autoGenerate = true)
|
||||||
|
val id: Int = 0,
|
||||||
|
val name: String,
|
||||||
|
val numApproaches: Int,
|
||||||
|
val numExercises: Int,
|
||||||
|
val restBetweenExercises: Int,
|
||||||
|
val restBetweenApproaches: Int,
|
||||||
|
val exerciseDuration: Int,
|
||||||
|
val startTime: Long? = null,
|
||||||
|
val endTime: Long? = null
|
||||||
|
)
|
27
app/src/main/java/WorkoutAdapter.kt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
|
||||||
|
class WorkoutAdapter(private val workouts: List<Workout>) : RecyclerView.Adapter<WorkoutAdapter.WorkoutViewHolder>() {
|
||||||
|
|
||||||
|
class WorkoutViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||||
|
val textViewName: TextView = itemView.findViewById(R.id.textViewName)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WorkoutViewHolder {
|
||||||
|
val itemView = LayoutInflater.from(parent.context)
|
||||||
|
.inflate(R.layout.workout_item, parent, false)
|
||||||
|
return WorkoutViewHolder(itemView)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: WorkoutViewHolder, position: Int) {
|
||||||
|
val currentItem = workouts[position]
|
||||||
|
holder.textViewName.text = currentItem.name
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = workouts.size
|
||||||
|
}
|
22
app/src/main/java/WorkoutDao.kt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import androidx.room.Dao
|
||||||
|
import androidx.room.Insert
|
||||||
|
import androidx.room.OnConflictStrategy
|
||||||
|
import androidx.room.Query
|
||||||
|
import androidx.room.Update
|
||||||
|
|
||||||
|
@Dao
|
||||||
|
interface WorkoutDao {
|
||||||
|
@Insert(onConflict = OnConflictStrategy.IGNORE)
|
||||||
|
suspend fun insertWorkout(workout: Workout): Long
|
||||||
|
|
||||||
|
@Query("SELECT * FROM workouts")
|
||||||
|
suspend fun getAllWorkouts(): List<Workout>
|
||||||
|
|
||||||
|
@Query("SELECT * FROM workouts WHERE id = :workoutId")
|
||||||
|
suspend fun getWorkoutById(workoutId: Int): Workout?
|
||||||
|
|
||||||
|
@Update
|
||||||
|
suspend fun updateWorkout(workout: Workout)
|
||||||
|
}
|
100
app/src/main/java/com/example/timert/AddWorkout.kt
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import android.app.AlertDialog
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.EditText
|
||||||
|
import android.widget.ImageView
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
|
||||||
|
class AddWorkout : AppCompatActivity() {
|
||||||
|
private var isSave = false
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
|
setContentView(R.layout.activity_add_workout)
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||||
|
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
val buttonSaveAll: Button = findViewById(R.id.btn_save_all)
|
||||||
|
buttonSaveAll.setOnClickListener {
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
isSave = true
|
||||||
|
|
||||||
|
}
|
||||||
|
val button_on_main_all: Button = findViewById(R.id.btn_on_main_all)
|
||||||
|
button_on_main_all.setOnClickListener {
|
||||||
|
if (isSave == false) {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setTitle("Изменения не сохранены")
|
||||||
|
.setMessage("Продолжить без сохранения?")
|
||||||
|
.setPositiveButton("Да") { _, _ ->
|
||||||
|
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
.setNegativeButton("Нет") { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
.show()
|
||||||
|
} else {
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val button_add: Button = findViewById(R.id.add_workoutadd)
|
||||||
|
button_add.setOnClickListener {
|
||||||
|
val intent = Intent(this, CreatingTraining::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
val timeInputRestSetAll: EditText = findViewById(R.id.rest_sets_all)
|
||||||
|
val btnPlusTimeAll: ImageView = findViewById(R.id.add_res_set2)
|
||||||
|
val btnMinusTimeAll: ImageView = findViewById(R.id.del_res_set2)
|
||||||
|
|
||||||
|
val setsInputAll: EditText = findViewById(R.id.numbers_of_sets_all)
|
||||||
|
val btnPlusSetsAll: ImageView = findViewById(R.id.add_set3)
|
||||||
|
val btnMinusSetsAll: ImageView = findViewById(R.id.del_set3)
|
||||||
|
|
||||||
|
val timeInputRest: EditText = findViewById(R.id.rest_workout_all)
|
||||||
|
val btnPlusTimeWor: ImageView = findViewById(R.id.add_res)
|
||||||
|
val btnMinusTimeWor: ImageView = findViewById(R.id.del_res)
|
||||||
|
|
||||||
|
val timeWork: EditText = findViewById(R.id.time_work_all)
|
||||||
|
val Plus: ImageView = findViewById(R.id.add_set)
|
||||||
|
val Minus: ImageView = findViewById(R.id.del_set)
|
||||||
|
|
||||||
|
setupPlusMinus(timeInputRestSetAll, btnPlusTimeAll, btnMinusTimeAll, minValue = 5, maxValue = 600)
|
||||||
|
setupPlusMinus(setsInputAll, btnPlusSetsAll, btnMinusSetsAll, minValue = 1, maxValue = 20)
|
||||||
|
setupPlusMinus(timeInputRest, btnPlusTimeWor, btnMinusTimeWor, minValue = 5, maxValue = 600)
|
||||||
|
setupPlusMinus(timeWork, Plus, Minus, minValue = 5, maxValue = 600)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
fun setupPlusMinus(
|
||||||
|
editText: EditText,
|
||||||
|
plus: ImageView,
|
||||||
|
minus: ImageView,
|
||||||
|
minValue: Int = 5,
|
||||||
|
maxValue: Int = 600
|
||||||
|
) {
|
||||||
|
plus.setOnClickListener {
|
||||||
|
val current = editText.text.toString().toIntOrNull() ?: minValue
|
||||||
|
val newValue = (current + 1).coerceAtMost(maxValue)
|
||||||
|
editText.setText(newValue.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
minus.setOnClickListener {
|
||||||
|
val current = editText.text.toString().toIntOrNull() ?: minValue
|
||||||
|
val newValue = (current - 1).coerceAtLeast(minValue)
|
||||||
|
editText.setText(newValue.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
134
app/src/main/java/com/example/timert/AllTraining.kt
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.app.AlertDialog
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.TextUtils
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.EditText
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.Toast
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import com.example.timert.data.entity.Exercise
|
||||||
|
import com.example.timert.data.viewModel.ExerciseViewModel
|
||||||
|
|
||||||
|
class AllTraining : AppCompatActivity() {
|
||||||
|
private var isSave = false
|
||||||
|
private lateinit var editExerciseView: EditText
|
||||||
|
private lateinit var numExerciseView: EditText
|
||||||
|
private lateinit var numRestExerciseView: EditText
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
val exerciseViewModel = ViewModelProvider(
|
||||||
|
this,
|
||||||
|
ViewModelProvider.AndroidViewModelFactory.getInstance(application)
|
||||||
|
)[ExerciseViewModel::class.java]
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
|
setContentView(R.layout.activity_all_training)
|
||||||
|
editExerciseView = findViewById(R.id.name_training)
|
||||||
|
numExerciseView = findViewById(R.id.time_work)
|
||||||
|
numRestExerciseView = findViewById(R.id.rest_workout)
|
||||||
|
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||||
|
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
|
insets
|
||||||
|
}
|
||||||
|
|
||||||
|
val buttonSaveAll: Button = findViewById(R.id.btn_save_all_vse)
|
||||||
|
buttonSaveAll.setOnClickListener {
|
||||||
|
val exerciseName = editExerciseView.text.toString()
|
||||||
|
val numSetsText = numExerciseView.text.toString()
|
||||||
|
val restSetsText = numRestExerciseView.text.toString()
|
||||||
|
|
||||||
|
if (exerciseName.isBlank() || numSetsText.isBlank() || restSetsText.isBlank()) {
|
||||||
|
Toast.makeText(this, "Заполните все поля", Toast.LENGTH_SHORT).show()
|
||||||
|
} else {
|
||||||
|
val numSets = numSetsText.toIntOrNull()
|
||||||
|
val restSets = restSetsText.toIntOrNull()
|
||||||
|
|
||||||
|
if (numSets == null || restSets == null) {
|
||||||
|
Toast.makeText(this, "Неверный формат чисел", Toast.LENGTH_SHORT).show()
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
val newExercise = Exercise(
|
||||||
|
name_exercise = exerciseName,
|
||||||
|
num_sets = numSets,
|
||||||
|
rest_of_sets = restSets
|
||||||
|
)
|
||||||
|
exerciseViewModel.insert(newExercise)
|
||||||
|
Toast.makeText(this, "Упражнение сохранено", Toast.LENGTH_SHORT).show()
|
||||||
|
isSave = true
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
val button_on_main_all: Button = findViewById(R.id.btn_on_main_all_vse)
|
||||||
|
button_on_main_all.setOnClickListener {
|
||||||
|
if (isSave == false) {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setTitle("Изменения не сохранены")
|
||||||
|
.setMessage("Продолжить без сохранения?")
|
||||||
|
.setPositiveButton("Да") { _, _ ->
|
||||||
|
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
.setNegativeButton("Нет") { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
}
|
||||||
|
.show()
|
||||||
|
} else {
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val timeInputRest: EditText = findViewById(R.id.rest_workout)
|
||||||
|
val btnPlusTime: ImageView = findViewById(R.id.add_res)
|
||||||
|
val btnMinusTime: ImageView = findViewById(R.id.del_res)
|
||||||
|
|
||||||
|
val setsInput: EditText = findViewById(R.id.time_work)
|
||||||
|
val btnPlusSets: ImageView = findViewById(R.id.add_set)
|
||||||
|
val btnMinusSets: ImageView = findViewById(R.id.del_set)
|
||||||
|
|
||||||
|
setupPlusMinus(timeInputRest, btnPlusTime, btnMinusTime, minValue = 5, maxValue = 600)
|
||||||
|
setupPlusMinus(setsInput, btnPlusSets, btnMinusSets, minValue = 5, maxValue = 600)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val EXTRA_REPLY = "com.example.android.wordlistsql.REPLY"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun setupPlusMinus(
|
||||||
|
editText: EditText,
|
||||||
|
plus: ImageView,
|
||||||
|
minus: ImageView,
|
||||||
|
minValue: Int = 5,
|
||||||
|
maxValue: Int = 600
|
||||||
|
) {
|
||||||
|
plus.setOnClickListener {
|
||||||
|
val current = editText.text.toString().toIntOrNull() ?: minValue
|
||||||
|
val newValue = (current + 1).coerceAtMost(maxValue)
|
||||||
|
editText.setText(newValue.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
minus.setOnClickListener {
|
||||||
|
val current = editText.text.toString().toIntOrNull() ?: minValue
|
||||||
|
val newValue = (current - 1).coerceAtLeast(minValue)
|
||||||
|
editText.setText(newValue.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,18 +4,52 @@ import android.app.AlertDialog
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
|
import android.widget.EditText
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
|
import android.widget.ImageView
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.example.timert.data.adapter.ExerciseAdapter
|
||||||
|
import com.example.timert.data.viewModel.ExerciseViewModel
|
||||||
|
|
||||||
class CreatingTraining : AppCompatActivity() {
|
class CreatingTraining : AppCompatActivity() {
|
||||||
|
|
||||||
|
private lateinit var viewModel: ExerciseViewModel
|
||||||
|
|
||||||
private var isSave = false
|
private var isSave = false
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
setContentView(R.layout.activity_creating_training)
|
setContentView(R.layout.activity_creating_training)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
viewModel = ViewModelProvider(
|
||||||
|
this,
|
||||||
|
ViewModelProvider.AndroidViewModelFactory.getInstance(application)
|
||||||
|
)[ExerciseViewModel::class.java]
|
||||||
|
|
||||||
|
|
||||||
|
val adapter = ExerciseAdapter { id ->
|
||||||
|
viewModel.deleteExerciseById(id)
|
||||||
|
}
|
||||||
|
// adapter = ExerciseAdapter(this)
|
||||||
|
val recyclerView = findViewById<RecyclerView>(R.id.exercise)
|
||||||
|
recyclerView.adapter = adapter
|
||||||
|
recyclerView.layoutManager = LinearLayoutManager(this)
|
||||||
|
|
||||||
|
|
||||||
|
viewModel.allExercise.observe(this) { exercises ->
|
||||||
|
exercises?.let {
|
||||||
|
adapter.setExercises(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
@ -25,8 +59,20 @@ class CreatingTraining : AppCompatActivity() {
|
|||||||
buttonSave.setOnClickListener {
|
buttonSave.setOnClickListener {
|
||||||
|
|
||||||
isSave=true
|
isSave=true
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
val timeInputRest: EditText = findViewById(R.id.rest_sets)
|
||||||
|
val btnPlusTime: ImageView = findViewById(R.id.add_res)
|
||||||
|
val btnMinusTime: ImageView = findViewById(R.id.del_res)
|
||||||
|
|
||||||
|
val setsInput: EditText = findViewById(R.id.numbers_of_sets)
|
||||||
|
val btnPlusSets: ImageView = findViewById(R.id.add_set)
|
||||||
|
val btnMinusSets: ImageView = findViewById(R.id.del_set)
|
||||||
|
|
||||||
|
setupPlusMinus(timeInputRest, btnPlusTime, btnMinusTime, minValue = 5, maxValue = 600)
|
||||||
|
setupPlusMinus(setsInput, btnPlusSets, btnMinusSets, minValue = 1, maxValue = 20)
|
||||||
val button_on_main: Button = findViewById(R.id.btn_on_main)
|
val button_on_main: Button = findViewById(R.id.btn_on_main)
|
||||||
button_on_main.setOnClickListener {
|
button_on_main.setOnClickListener {
|
||||||
if(isSave==false){
|
if(isSave==false){
|
||||||
@ -48,6 +94,30 @@ class CreatingTraining : AppCompatActivity() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
val button_add: Button = findViewById(R.id.add_workout)
|
||||||
|
button_add.setOnClickListener {
|
||||||
|
val intent = Intent(this, AllTraining::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
fun setupPlusMinus(
|
||||||
|
editText: EditText,
|
||||||
|
plus: ImageView,
|
||||||
|
minus: ImageView,
|
||||||
|
minValue: Int = 5,
|
||||||
|
maxValue: Int = 600
|
||||||
|
) {
|
||||||
|
plus.setOnClickListener {
|
||||||
|
val current = editText.text.toString().toIntOrNull() ?: minValue
|
||||||
|
val newValue = (current + 1).coerceAtMost(maxValue)
|
||||||
|
editText.setText(newValue.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
minus.setOnClickListener {
|
||||||
|
val current = editText.text.toString().toIntOrNull() ?: minValue
|
||||||
|
val newValue = (current - 1).coerceAtLeast(minValue)
|
||||||
|
editText.setText(newValue.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
30
app/src/main/java/com/example/timert/History.kt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Button
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
|
||||||
|
class History : AppCompatActivity() {
|
||||||
|
|
||||||
|
private lateinit var recyclerViewHistory: RecyclerView
|
||||||
|
private val coroutineScope = CoroutineScope(Dispatchers.IO)
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
|
setContentView(R.layout.activity_history)
|
||||||
|
|
||||||
|
recyclerViewHistory = findViewById(R.id.recyclerViewHistory)
|
||||||
|
recyclerViewHistory.layoutManager = LinearLayoutManager(this)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -2,13 +2,19 @@ package com.example.timert
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.util.Log
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
@ -18,18 +24,38 @@ class MainActivity : AppCompatActivity() {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
var button: Button = findViewById(R.id.button1)
|
|
||||||
|
|
||||||
button.setOnClickListener{
|
// Кнопки главной формы:
|
||||||
val intent = Intent(this,timer::class.java)
|
val settingsButton: Button = findViewById(R.id.settingsButton)
|
||||||
|
settingsButton.setOnClickListener {
|
||||||
|
val intent = Intent(this, SettingsActivity::class.java)
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
var button2: Button = findViewById(R.id.button2)
|
|
||||||
|
|
||||||
button2.setOnClickListener{
|
val startTrainingButton: Button = findViewById(R.id.startTrainingButton)
|
||||||
val intent = Intent(this,CreatingTraining::class.java)
|
startTrainingButton.setOnClickListener {
|
||||||
|
Toast.makeText(this, "Запуск тренировки!", Toast.LENGTH_SHORT).show() // Заглушка
|
||||||
|
//TODO: Intent для запуска Activity тренировки (форма 5)
|
||||||
|
val intent = Intent(this, timer::class.java)
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val templatesButton: Button = findViewById(R.id.templatesButton)
|
||||||
|
templatesButton.setOnClickListener {
|
||||||
|
//Toast.makeText(this, "Открытие шаблонов!", Toast.LENGTH_SHORT).show() // Заглушка
|
||||||
|
//TODO: Intent для открытия Activity шаблонов (форма 3)
|
||||||
|
val intent = Intent(this, AddWorkout::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
val newTemplateButton: Button = findViewById(R.id.newTemplateButton)
|
||||||
|
newTemplateButton.setOnClickListener {
|
||||||
|
//Toast.makeText(this, "Создание нового шаблона!", Toast.LENGTH_SHORT).show() // Заглушка
|
||||||
|
//TODO: Intent для открытия Activity создания шаблона (форма 7)
|
||||||
|
val intent = Intent(this, History::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---- ROOM TEST ----
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
20
app/src/main/java/com/example/timert/MyApplication.kt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import androidx.room.Room
|
||||||
|
import com.example.timert.AppDatabase
|
||||||
|
|
||||||
|
class MyApplication : Application() {
|
||||||
|
companion object {
|
||||||
|
lateinit var database: AppDatabase
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
database = Room.databaseBuilder(
|
||||||
|
applicationContext,
|
||||||
|
AppDatabase::class.java,
|
||||||
|
"workout_database"
|
||||||
|
).build()
|
||||||
|
}
|
||||||
|
}
|
45
app/src/main/java/com/example/timert/SettingsActivity.kt
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package com.example.timert
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.pm.PackageManager
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Switch
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import android.widget.Button
|
||||||
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.core.text.HtmlCompat
|
||||||
|
|
||||||
|
class SettingsActivity : AppCompatActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_settings2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
val developersButton: Button = findViewById(R.id.developersButton)
|
||||||
|
|
||||||
|
|
||||||
|
// Обработчик нажатия на кнопку "Разработчики"
|
||||||
|
developersButton.setOnClickListener {
|
||||||
|
AlertDialog.Builder(this)
|
||||||
|
.setTitle("Разработчики")
|
||||||
|
.setMessage(HtmlCompat.fromHtml(
|
||||||
|
"<p style='margin-left: 2em;'><b>Программу разработали:</b></p><br>" +
|
||||||
|
"<p style='margin-left: 2em;'>Емцова Надежда Александровна</p>" +
|
||||||
|
"<p style='margin-left: 2em;'>Новиков Николай Алексеевич</p>" +
|
||||||
|
"<p style='margin-left: 2em;'>Пискун Алёна Викторовна</p>",
|
||||||
|
HtmlCompat.FROM_HTML_MODE_LEGACY
|
||||||
|
))
|
||||||
|
.setPositiveButton("ОК", null)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
|
val on_main: Button = findViewById(R.id.btn_on_main)
|
||||||
|
on_main.setOnClickListener {
|
||||||
|
val intent = Intent(this, MainActivity::class.java)
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.example.timert.data.adapter
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.Button
|
||||||
|
import android.widget.ImageButton
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.example.timert.R
|
||||||
|
import com.example.timert.data.entity.Exercise
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
|
||||||
|
//class ExerciseAdapter internal constructor(context: Context):RecyclerView.Adapter<ExerciseAdapter.ExerciseViewHolder>(){
|
||||||
|
class ExerciseAdapter(
|
||||||
|
private val onDeleteClick: (Int) -> Unit
|
||||||
|
) : RecyclerView.Adapter<ExerciseAdapter.ExerciseViewHolder>() {
|
||||||
|
private var exerciseList: List<Exercise> = emptyList()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
inner class ExerciseViewHolder(itemView: View):RecyclerView.ViewHolder(itemView){
|
||||||
|
val textViewExercise: TextView = itemView.findViewById(R.id.textView13)
|
||||||
|
val deleteButton: ImageButton = itemView.findViewById(R.id.deleteButton)
|
||||||
|
}
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ExerciseViewHolder {
|
||||||
|
val view = LayoutInflater.from(parent.context).inflate(R.layout.resyclerview_item, parent, false)
|
||||||
|
return ExerciseViewHolder(view)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: ExerciseViewHolder, position: Int) {
|
||||||
|
|
||||||
|
val exercise = exerciseList[position]
|
||||||
|
|
||||||
|
holder.textViewExercise.text =
|
||||||
|
"${exercise.name_exercise} — работа: ${exercise.num_sets} сек, отдых: ${exercise.rest_of_sets} сек"
|
||||||
|
holder.deleteButton.setOnClickListener {
|
||||||
|
onDeleteClick(exercise.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount() = exerciseList.size
|
||||||
|
|
||||||
|
fun setExercises(exercises: List<Exercise>) {
|
||||||
|
this.exerciseList = exercises
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
26
app/src/main/java/com/example/timert/data/dao/ExerciseDao.kt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package com.example.timert.data.dao
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.room.Dao
|
||||||
|
import androidx.room.Delete
|
||||||
|
import androidx.room.Insert
|
||||||
|
import androidx.room.OnConflictStrategy
|
||||||
|
import androidx.room.Query
|
||||||
|
import com.example.timert.data.entity.Exercise
|
||||||
|
|
||||||
|
|
||||||
|
@Dao
|
||||||
|
interface ExerciseDao {
|
||||||
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||||
|
suspend fun insert(exercise: Exercise)
|
||||||
|
|
||||||
|
@Query("SELECT * FROM exercise_table")
|
||||||
|
fun getExercise(): LiveData<List<Exercise>>
|
||||||
|
|
||||||
|
|
||||||
|
//@Delete
|
||||||
|
// suspend fun delete(exercise: Exercise)
|
||||||
|
|
||||||
|
@Query("DELETE FROM exercise_table WHERE id = :id")
|
||||||
|
suspend fun deleteById(id: Int)
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.example.timert.data.database
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.room.Database
|
||||||
|
import androidx.room.Room
|
||||||
|
import androidx.room.RoomDatabase
|
||||||
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||||
|
import com.example.timert.data.dao.ExerciseDao
|
||||||
|
import com.example.timert.data.entity.Exercise
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
@Database(entities = [Exercise::class], version = 1, exportSchema = false)
|
||||||
|
abstract class ExerciseDatabase:RoomDatabase(){
|
||||||
|
abstract fun exerciseDao():ExerciseDao
|
||||||
|
|
||||||
|
// private class ExerciseDatabaseCallback (private val scope: CoroutineScope) : RoomDatabase.Callback(){
|
||||||
|
|
||||||
|
//override fun onOpen(db: SupportSQLiteDatabase) {
|
||||||
|
// super.onOpen(db)
|
||||||
|
// INSTANCE?.let { database ->
|
||||||
|
// scope.launch {
|
||||||
|
// populateDatabase(database.exerciseDao())
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//suspend fun populateDatabase(exerciseDao: ExerciseDao) {
|
||||||
|
// Delete all content here.
|
||||||
|
//exerciseDao.deleteAll()
|
||||||
|
// Add sample words.
|
||||||
|
//var exercise = Exercise(0, "training", 10, 45 )
|
||||||
|
// exerciseDao.insert(exercise)
|
||||||
|
|
||||||
|
// TODO: Add your own words!
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
companion object {
|
||||||
|
@Volatile
|
||||||
|
private var INSTANCE: ExerciseDatabase? = null
|
||||||
|
fun getDatabase(context: Context,
|
||||||
|
scope: CoroutineScope
|
||||||
|
): ExerciseDatabase {
|
||||||
|
val tempInstance = INSTANCE
|
||||||
|
if (tempInstance != null) {
|
||||||
|
return tempInstance
|
||||||
|
}
|
||||||
|
synchronized(this) {
|
||||||
|
val instance = Room.databaseBuilder(
|
||||||
|
context.applicationContext,
|
||||||
|
ExerciseDatabase::class.java,
|
||||||
|
"exercise_database"
|
||||||
|
)
|
||||||
|
//.addCallback(ExerciseDatabaseCallback(scope))
|
||||||
|
.build()
|
||||||
|
INSTANCE = instance
|
||||||
|
return instance
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
app/src/main/java/com/example/timert/data/entity/Exercise.kt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.example.timert.data.entity
|
||||||
|
|
||||||
|
import androidx.room.Entity
|
||||||
|
import androidx.room.PrimaryKey
|
||||||
|
|
||||||
|
|
||||||
|
@Entity(tableName = "exercise_table")
|
||||||
|
data class Exercise(@PrimaryKey(autoGenerate = true) val id: Int = 0,
|
||||||
|
val name_exercise: String,
|
||||||
|
val num_sets: Int,
|
||||||
|
val rest_of_sets: Int)
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.timert.data.repository
|
||||||
|
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import com.example.timert.data.dao.ExerciseDao
|
||||||
|
import com.example.timert.data.entity.Exercise
|
||||||
|
|
||||||
|
class ExerciseRepository(private val exerciseDao:ExerciseDao){
|
||||||
|
val allExercise: LiveData<List<Exercise>> = exerciseDao.getExercise()
|
||||||
|
suspend fun insert(training: Exercise) {
|
||||||
|
exerciseDao.insert(training)
|
||||||
|
}
|
||||||
|
|
||||||
|
suspend fun deleteExerciseById(id: Int) {
|
||||||
|
exerciseDao.deleteById(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.example.timert.data.viewModel
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import androidx.lifecycle.AndroidViewModel
|
||||||
|
import androidx.lifecycle.LiveData
|
||||||
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.example.timert.data.database.ExerciseDatabase
|
||||||
|
import com.example.timert.data.entity.Exercise
|
||||||
|
import com.example.timert.data.repository.ExerciseRepository
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
class ExerciseViewModel(application: Application):AndroidViewModel(application){
|
||||||
|
private val repository: ExerciseRepository
|
||||||
|
val allExercise: LiveData<List<Exercise>>
|
||||||
|
|
||||||
|
init{
|
||||||
|
val exercisesDao = ExerciseDatabase.getDatabase(application, viewModelScope).exerciseDao()
|
||||||
|
repository = ExerciseRepository(exercisesDao)
|
||||||
|
allExercise = repository.allExercise
|
||||||
|
}
|
||||||
|
fun insert(exercise: Exercise) = viewModelScope.launch {
|
||||||
|
repository.insert(exercise)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deleteExerciseById(id: Int) = viewModelScope.launch {
|
||||||
|
repository.deleteExerciseById(id)
|
||||||
|
}
|
||||||
|
}
|
@ -2,17 +2,39 @@ package com.example.timert
|
|||||||
|
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.media.Image
|
import android.media.MediaPlayer
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.Button
|
import android.os.CountDownTimer
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
|
import android.widget.TextView
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
|
||||||
class timer : AppCompatActivity() {
|
class timer : AppCompatActivity() {
|
||||||
private var isPlay = false
|
private var isPlay = false
|
||||||
|
|
||||||
|
private lateinit var statusText: TextView
|
||||||
|
private lateinit var timerText: TextView
|
||||||
|
private lateinit var statusSet: TextView
|
||||||
|
private lateinit var statusExercise: TextView
|
||||||
|
private var numApproaches = 3
|
||||||
|
private var numExercises = 5
|
||||||
|
private var restBetweenExercises = 30
|
||||||
|
private var restBetweenApproaches = 60
|
||||||
|
private var exerciseDuration = 45 // например, 45 секунд упражнение
|
||||||
|
private var currentTimer: CountDownTimer? = null
|
||||||
|
private var timeLeftInMillis: Long = 0
|
||||||
|
|
||||||
|
// Объявляем переменные для MediaPlayer
|
||||||
|
private var startWorkoutSound: MediaPlayer? = null
|
||||||
|
private var workSound: MediaPlayer? = null
|
||||||
|
private var startRestSound: MediaPlayer? = null
|
||||||
|
private var restSound: MediaPlayer? = null
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
@ -22,6 +44,24 @@ class timer : AppCompatActivity() {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
|
statusText = findViewById(R.id.statusText)
|
||||||
|
timerText = findViewById(R.id.timerText)
|
||||||
|
statusSet = findViewById(R.id.number_set)
|
||||||
|
statusExercise = findViewById(R.id.num_exercise)
|
||||||
|
numApproaches = intent.getIntExtra("numApproaches", numApproaches)
|
||||||
|
numExercises = intent.getIntExtra("numExercises", numExercises)
|
||||||
|
restBetweenExercises = intent.getIntExtra("restBetweenExercises", restBetweenExercises)
|
||||||
|
restBetweenApproaches = intent.getIntExtra("restBetweenApproaches", restBetweenApproaches)
|
||||||
|
exerciseDuration = intent.getIntExtra("exerciseDuration", exerciseDuration)
|
||||||
|
|
||||||
|
// Инициализируем MediaPlayer
|
||||||
|
startWorkoutSound = MediaPlayer.create(this, R.raw.sound1)
|
||||||
|
workSound = MediaPlayer.create(this, R.raw.sound1)
|
||||||
|
startRestSound = MediaPlayer.create(this, R.raw.sound2)
|
||||||
|
restSound = MediaPlayer.create(this, R.raw.sound3)
|
||||||
|
|
||||||
|
startTraining()
|
||||||
|
|
||||||
val button: ImageButton = findViewById(R.id.stop)
|
val button: ImageButton = findViewById(R.id.stop)
|
||||||
button.setOnClickListener {
|
button.setOnClickListener {
|
||||||
AlertDialog.Builder(this)
|
AlertDialog.Builder(this)
|
||||||
@ -40,23 +80,128 @@ class timer : AppCompatActivity() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
val pauseButton: ImageButton = findViewById(R.id.play)
|
val pauseButton: ImageButton = findViewById(R.id.play)
|
||||||
|
|
||||||
pauseButton.setOnClickListener {
|
pauseButton.setOnClickListener {
|
||||||
if (isPlay) {
|
if (isPlay) {
|
||||||
|
|
||||||
pauseButton.setImageResource(R.drawable.icon_play)
|
pauseButton.setImageResource(R.drawable.icon_play)
|
||||||
// здесь ещё можно возобновить таймер
|
// здесь ещё можно возобновить таймер
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
pauseButton.setImageResource(R.drawable.icon_pause)
|
pauseButton.setImageResource(R.drawable.icon_pause)
|
||||||
// здесь можно остановить таймер
|
// здесь можно остановить таймер
|
||||||
}
|
|
||||||
isPlay = !isPlay
|
|
||||||
}
|
}
|
||||||
|
isPlay = !isPlay
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private fun resumeTimer(onFinish: () -> Unit) {
|
||||||
|
currentTimer = object : CountDownTimer(timeLeftInMillis, 1000) {
|
||||||
|
override fun onTick(millisUntilFinished: Long) {
|
||||||
|
timeLeftInMillis = millisUntilFinished
|
||||||
|
timerText.text = "${millisUntilFinished / 1000}"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFinish() {
|
||||||
|
onFinish()
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startTraining() {
|
||||||
|
var currentApproach = 1
|
||||||
|
val rootLayout = findViewById<ConstraintLayout>(R.id.main)
|
||||||
|
fun nextApproach() {
|
||||||
|
if (currentApproach > numApproaches) {
|
||||||
|
statusText.text = "Тренировка завершена!"
|
||||||
|
rootLayout.setBackgroundResource(R.drawable.blue_gradient)
|
||||||
|
timerText.text = "00:00"
|
||||||
|
// Здесь должен быть звук завершения тренировки, если нужно
|
||||||
|
return
|
||||||
|
}
|
||||||
|
statusSet.text = "Подход № $currentApproach"
|
||||||
|
var currentExercise = 1
|
||||||
|
|
||||||
|
fun nextExercise() {
|
||||||
|
if (currentExercise > numExercises) {
|
||||||
|
statusText.text = "Отдых между подходами"
|
||||||
|
rootLayout.setBackgroundResource(R.drawable.green_gradient)
|
||||||
|
// Звук перед началом отдыха между подходами
|
||||||
|
startRestSound?.start()
|
||||||
|
startRest(restBetweenApproaches) {
|
||||||
|
currentApproach++
|
||||||
|
nextApproach()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rootLayout.setBackgroundResource(R.drawable.gradient_pink)
|
||||||
|
statusText.text = "Работа"
|
||||||
|
statusExercise.text = "$currentExercise / $numExercises"
|
||||||
|
statusSet.text = "$currentApproach"
|
||||||
|
|
||||||
|
// Звук перед началом упражнения
|
||||||
|
workSound?.start()
|
||||||
|
|
||||||
|
startTimer(exerciseDuration) {
|
||||||
|
statusText.text = "Отдых"
|
||||||
|
rootLayout.setBackgroundResource(R.drawable.green_gradient)
|
||||||
|
// Звук перед началом отдыха между упражнениями
|
||||||
|
restSound?.start()
|
||||||
|
startRest(restBetweenExercises) {
|
||||||
|
currentExercise++
|
||||||
|
nextExercise()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Звук перед началом подхода
|
||||||
|
startWorkoutSound?.start()
|
||||||
|
nextExercise()
|
||||||
|
}
|
||||||
|
nextApproach()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startTimer(seconds: Int, onFinish: () -> Unit) {
|
||||||
|
timeLeftInMillis = seconds * 1000L
|
||||||
|
object : CountDownTimer(seconds * 1000L, 1000) {
|
||||||
|
override fun onTick(millisUntilFinished: Long) {
|
||||||
|
timerText.text = "${millisUntilFinished / 1000}"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFinish() {
|
||||||
|
onFinish()
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startRest(seconds: Int, onFinish: () -> Unit) {
|
||||||
|
val rootLayout = findViewById<ConstraintLayout>(R.id.main)
|
||||||
|
rootLayout.setBackgroundResource(R.drawable.green_gradient)
|
||||||
|
object : CountDownTimer(seconds * 1000L, 1000) {
|
||||||
|
override fun onTick(millisUntilFinished: Long) {
|
||||||
|
timerText.text = "${millisUntilFinished / 1000}"
|
||||||
|
statusText.text = "Отдых"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFinish() {
|
||||||
|
onFinish()
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
override fun onDestroy() {
|
||||||
|
super.onDestroy()
|
||||||
|
currentTimer?.cancel()
|
||||||
|
// Освобождаем ресурсы MediaPlayer
|
||||||
|
startWorkoutSound?.release()
|
||||||
|
workSound?.release()
|
||||||
|
startRestSound?.release()
|
||||||
|
restSound?.release()
|
||||||
|
|
||||||
|
startWorkoutSound = null
|
||||||
|
workSound = null
|
||||||
|
startRestSound = null
|
||||||
|
restSound = null
|
||||||
|
}
|
||||||
}
|
}
|
BIN
app/src/main/res/drawable/background_image2.jpg
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable/background_imagemain.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
5
app/src/main/res/drawable/ic_settings.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#3D6ADC" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
||||||
|
|
||||||
|
</vector>
|
277
app/src/main/res/layout/activity_add_workout.xml
Normal file
@ -0,0 +1,277 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/blue_gradient"
|
||||||
|
tools:context=".AddWorkout">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="130dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Тренировка"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="34sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/name_training"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:ems="10"
|
||||||
|
android:inputType="text"
|
||||||
|
android:text="Тренировка 1"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/setting_training"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="400dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
|
||||||
|
tools:layout_editor_absoluteX="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView6"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Количество подходов"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del_set3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/numbers_of_sets_all"
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ems="10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:text="1"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_set3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView8_all2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Отдых между подходами"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del_res_set2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/rest_sets_all"
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ems="10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:text="5"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_res_set2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView5"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Время работы"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del_set"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/time_work_all"
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ems="10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:text="5"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_set"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView8_all"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Отдых между упражнениями"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del_res"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/rest_workout_all"
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ems="10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:text="5"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_res"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/setting_training"
|
||||||
|
tools:layout_editor_absoluteX="0dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/add_workoutadd"
|
||||||
|
android:layout_width="208dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="@drawable/green_rectangle"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Выбор упражнений"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_on_main_all"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/gradient_purpure"
|
||||||
|
android:text="на главную"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_save_all"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/gradient_purpure"
|
||||||
|
android:text="Сохранить"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
174
app/src/main/res/layout/activity_all_training.xml
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/gradient_pink"
|
||||||
|
tools:context=".AllTraining">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Добавить упражнение"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="34sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/name_training"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:ems="10"
|
||||||
|
android:inputType="text"
|
||||||
|
android:text="Упражнение"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/setting_training"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
|
||||||
|
tools:layout_editor_absoluteX="16dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Время работы, сек"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del_set"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/time_work"
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ems="10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:text="5"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_set"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView8_all"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Отдых между упражнениями, сек"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/del_res"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/rest_workout"
|
||||||
|
android:layout_width="3dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ems="10"
|
||||||
|
android:gravity="center"
|
||||||
|
android:inputType="number"
|
||||||
|
android:text="5"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/add_res"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
tools:layout_editor_absoluteX="7dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_on_main_all_vse"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/gradient_purpure"
|
||||||
|
android:text="на главную"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
tools:layout_editor_absoluteX="16dp"
|
||||||
|
tools:layout_editor_absoluteY="653dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_save_all_vse"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/gradient_purpure"
|
||||||
|
android:text="Сохранить"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
tools:layout_editor_absoluteX="245dp"
|
||||||
|
tools:layout_editor_absoluteY="653dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -11,7 +11,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout"
|
android:id="@+id/linearLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="130dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="25dp"
|
android:layout_marginTop="25dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@ -28,10 +28,9 @@
|
|||||||
android:id="@+id/name_training"
|
android:id="@+id/name_training"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:text="Тренировка 1"
|
android:text="Моя тренировка"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="20sp" />
|
android:textSize="20sp" />
|
||||||
|
|
||||||
@ -40,11 +39,12 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/setting_training"
|
android:id="@+id/setting_training"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="37dp"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
|
app:layout_constraintBottom_toTopOf="@+id/exercise"
|
||||||
tools:layout_editor_absoluteX="16dp">
|
app:layout_constraintTop_toBottomOf="@+id/linearLayout">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView5"
|
android:id="@+id/textView5"
|
||||||
@ -57,33 +57,39 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/del_set"
|
android:id="@+id/del_set"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="37dp"
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:srcCompat="@drawable/ic_remove_24px" />
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
<TextView
|
<EditText
|
||||||
android:id="@+id/numbers_of_sets"
|
android:id="@+id/numbers_of_sets"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="3dp"
|
||||||
android:layout_height="38dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="0"
|
android:ems="10"
|
||||||
android:textAlignment="center"
|
android:gravity="center"
|
||||||
android:textSize="34sp" />
|
android:inputType="number"
|
||||||
|
android:text="1"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/add_set"
|
android:id="@+id/add_set"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="37dp"
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:srcCompat="@drawable/ic_add_24px" />
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView8"
|
android:id="@+id/textView8"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -94,47 +100,74 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/del_res"
|
android:id="@+id/del_res"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="37dp"
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:srcCompat="@drawable/ic_remove_24px" />
|
app:srcCompat="@drawable/ic_remove_24px" />
|
||||||
|
|
||||||
<TextView
|
<EditText
|
||||||
android:id="@+id/rest_sets"
|
android:id="@+id/rest_sets"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="3dp"
|
||||||
android:layout_height="39dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="0"
|
android:ems="10"
|
||||||
android:textAlignment="center"
|
android:gravity="center"
|
||||||
android:textSize="34sp" />
|
android:inputType="number"
|
||||||
|
android:text="5"
|
||||||
|
android:textSize="26sp" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/add_res"
|
android:id="@+id/add_res"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="37dp"
|
android:layout_height="37dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
app:srcCompat="@drawable/ic_add_24px" />
|
app:srcCompat="@drawable/ic_add_24px" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:layout_width="match_parent"
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:layout_height="60dp"
|
android:id="@+id/exercise"
|
||||||
android:layout_marginTop="19dp"
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/frameLayout"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.373"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/setting_training"
|
app:layout_constraintTop_toBottomOf="@+id/setting_training"
|
||||||
tools:layout_editor_absoluteX="0dp">
|
app:layout_constraintVertical_bias="0.178" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frameLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="1.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/add_workout"
|
android:id="@+id/add_workout"
|
||||||
android:layout_width="176dp"
|
android:layout_width="176dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:background="@drawable/green_rectangle"
|
android:background="@drawable/green_rectangle"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="+ упражнение"
|
android:text="+ упражнение"
|
||||||
@ -144,12 +177,13 @@
|
|||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="60dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="35dp"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@ -157,8 +191,8 @@
|
|||||||
android:layout_width="150dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/gradient_purpure"
|
android:background="@drawable/gradient_purpure"
|
||||||
android:text="на главную"
|
android:text="на главную"
|
||||||
@ -170,8 +204,8 @@
|
|||||||
android:layout_width="150dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/gradient_purpure"
|
android:background="@drawable/gradient_purpure"
|
||||||
android:text="Сохранить"
|
android:text="Сохранить"
|
||||||
|
66
app/src/main/res/layout/activity_history.xml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/gradient_purpure"
|
||||||
|
tools:context=".History">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerViewHistory"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:text="История тренировок"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="34sp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_on_main"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/green_gradient"
|
||||||
|
android:text="на главную"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_save"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/green_gradient"
|
||||||
|
android:text="Выбрать"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -7,24 +7,96 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/background_imagemain"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/settingsButton"
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="@android:drawable/ic_menu_info_details"
|
||||||
|
android:backgroundTint="@color/black"
|
||||||
|
android:contentDescription="Настройки"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/startTrainingCardView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
app:cardBackgroundColor="#80000000"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/settingsButton">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button1"
|
android:id="@+id/startTrainingButton"
|
||||||
android:layout_width="171dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:background="@android:color/transparent"
|
||||||
android:text="Button" />
|
android:text="Начать тренировку"
|
||||||
|
android:textColor="@android:color/white" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/templatesCardView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
app:cardBackgroundColor="#80000000"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/startTrainingCardView">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button2"
|
android:id="@+id/templatesButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:background="@android:color/transparent"
|
||||||
android:text="Button2" />
|
android:text="Создать новую тренировку"
|
||||||
</LinearLayout>
|
android:textColor="@android:color/white" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/newTemplateCardView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
app:cardBackgroundColor="#80000000"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/templatesCardView">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/newTemplateButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:text="История тренировок"
|
||||||
|
android:textColor="@android:color/white" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
106
app/src/main/res/layout/activity_settings2.xml
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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:orientation="vertical"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@drawable/background_image2"> <!-- Добавили background -->
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/about_progr_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="450dp"
|
||||||
|
android:layout_marginTop="35dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:layout_editor_absoluteX="0dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="О программе"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="Название приложения: Таймер для тренировок"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView7"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="Данное приложение поможет пользователю в организации своих тренировок."
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView9"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="Оно поможет задавать количество подходов и упражнений, устанавливать время работы и отдыха, запускать последние 3 тренировки."
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView12"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="Можно задавать как интервалы для всех упражнений, так и для каждого отдельно, добавляя названия упражнений."
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/versionTextView2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="При возникновении проблем обращаться на почту: stud179277@vyatsu.ru" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/versionTextView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="Версия: 1.0" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btn_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
tools:layout_editor_absoluteX="0dp">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/developersButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/blue_gradient"
|
||||||
|
android:text="Разработчики" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_on_main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:background="@drawable/blue_gradient"
|
||||||
|
android:text="На главную" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -69,9 +69,9 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="Подход №"
|
android:text="Подход № "
|
||||||
android:textAlignment="textEnd"
|
android:textAlignment="textEnd"
|
||||||
android:textColor="#D0CBCB"
|
android:textColor="@color/black"
|
||||||
android:textSize="34sp" />
|
android:textSize="34sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -82,7 +82,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text=" 1"
|
android:text=" 1"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textColor="#D0CBCB"
|
android:textColor="@color/black"
|
||||||
android:textSize="34sp" />
|
android:textSize="34sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -96,9 +96,9 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="Упражнение"
|
android:text="Упражнение "
|
||||||
android:textAlignment="textEnd"
|
android:textAlignment="textEnd"
|
||||||
android:textColor="#D0CBCB"
|
android:textColor="@color/black"
|
||||||
android:textSize="34sp" />
|
android:textSize="34sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -108,12 +108,12 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text=" 1"
|
android:text=" 1"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textColor="#D0CBCB"
|
android:textColor="@color/black"
|
||||||
android:textSize="34sp" />
|
android:textSize="34sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:id="@+id/timerText"
|
||||||
android:layout_width="163dp"
|
android:layout_width="163dp"
|
||||||
android:layout_height="153dp"
|
android:layout_height="153dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
@ -123,13 +123,13 @@
|
|||||||
android:textSize="60sp" />
|
android:textSize="60sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/work"
|
android:id="@+id/statusText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="Работа"
|
android:text="Работа"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="#D0CBCB"
|
android:textColor="@color/black"
|
||||||
android:textSize="34sp" />
|
android:textSize="34sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
39
app/src/main/res/layout/resyclerview_item.xml
Normal file
@ -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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_marginBottom="4dp">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#410F3FED"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView13"
|
||||||
|
android:layout_width="353dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:text="Название упражнения"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/deleteButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="#00FFFFFF"
|
||||||
|
app:srcCompat="@android:drawable/ic_menu_delete" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
17
app/src/main/res/layout/workout_item.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?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="4dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:text="Workout Name"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
|
||||||
</adaptive-icon>
|
</adaptive-icon>
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/raw/sound1.mp3
Normal file
BIN
app/src/main/res/raw/sound2.mp3
Normal file
BIN
app/src/main/res/raw/sound3.mp3
Normal file
4
app/src/main/res/values/ic_launcher_background.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#943DDC</color>
|
||||||
|
</resources>
|
@ -20,4 +20,5 @@ kotlin.code.style=official
|
|||||||
# Enables namespacing of each library's R class so that its R class includes only the
|
# 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,
|
# resources declared in the library itself and none from the library's dependencies,
|
||||||
# thereby reducing the size of the R class for that library
|
# thereby reducing the size of the R class for that library
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
|
kapt.compiler.jvmtarget=11
|
@ -1,5 +1,5 @@
|
|||||||
[versions]
|
[versions]
|
||||||
agp = "8.9.1"
|
agp = "8.10.0"
|
||||||
kotlin = "2.0.21"
|
kotlin = "2.0.21"
|
||||||
coreKtx = "1.16.0"
|
coreKtx = "1.16.0"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
|
@ -10,6 +10,12 @@ pluginManagement {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
|
plugins {
|
||||||
|
id("com.android.application") version "8.3.2" apply false // Замените на вашу версию
|
||||||
|
id("org.jetbrains.kotlin.android") version "1.9.0" apply false // Замените на вашу версию Kotlin
|
||||||
|
id("org.jetbrains.kotlin.kapt") version "1.9.0" apply false // замените на вашу версию Kotlin
|
||||||
|
id("androidx.room") version "2.7.1" apply false // Добавьте эту строку, заменив на вашу версию Room
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
@ -20,5 +26,4 @@ dependencyResolutionManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "TimerT"
|
rootProject.name = "TimerT"
|
||||||
include(":app")
|
include(":app")
|
||||||
|
|