diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 665aab3..281b6d5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,8 @@ + + - + + + + + diff --git a/app/src/main/assets/index.html b/app/src/main/assets/index.html new file mode 100644 index 0000000..094f2da --- /dev/null +++ b/app/src/main/assets/index.html @@ -0,0 +1,22 @@ + + + + API карт 2ГИС + + + + +
+ + \ No newline at end of file diff --git a/app/src/main/java/com/nibble/musspeed/BodySelectionActivity.kt b/app/src/main/java/com/nibble/musspeed/BodySelectionActivity.kt new file mode 100644 index 0000000..e3ab3e2 --- /dev/null +++ b/app/src/main/java/com/nibble/musspeed/BodySelectionActivity.kt @@ -0,0 +1,51 @@ +package com.nibble.musspeed + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.view.View +import android.widget.ImageButton + +class BodySelectionActivity : AppCompatActivity() { + private lateinit var btnToRun : ImageButton + private lateinit var btnToMap : ImageButton + private lateinit var btnToBody : ImageButton + private lateinit var btnToMus : ImageButton + private lateinit var btnToWorkout : ImageButton + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_body_selection) + btnToRun = findViewById(R.id.to_path_run) + btnToRun.setOnClickListener { toRun() } + btnToMap = findViewById(R.id.to_path_selector) + btnToMap.setOnClickListener { toMap() } + btnToBody = findViewById(R.id.to_body_selector) + btnToBody.setOnClickListener { toBody() } + btnToMus = findViewById(R.id.to_music_selector) + btnToMus.setOnClickListener { toMus() } + btnToWorkout = findViewById(R.id.to_workout_selector) + btnToWorkout.setOnClickListener { toWorkout() } + } + + private fun toRun(){ + val intent = Intent(this, PathRunActivity::class.java) + startActivity(intent) + } + private fun toMap(){ + val intent = Intent(this, PathSelectionActivity::class.java) + startActivity(intent) + } + private fun toBody(){ + val intent = Intent(this, BodySelectionActivity::class.java) + startActivity(intent) + } + private fun toMus(){ + val intent = Intent(this, MusicSelectionActivity::class.java) + startActivity(intent) + } + private fun toWorkout(){ + val intent = Intent(this, WorkoutSelectionActivity::class.java) + startActivity(intent) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nibble/musspeed/MainActivity.kt b/app/src/main/java/com/nibble/musspeed/MainActivity.kt deleted file mode 100644 index 0a89f53..0000000 --- a/app/src/main/java/com/nibble/musspeed/MainActivity.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.nibble.musspeed - -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/nibble/musspeed/MusicSelectionActivity.kt b/app/src/main/java/com/nibble/musspeed/MusicSelectionActivity.kt new file mode 100644 index 0000000..381d9d8 --- /dev/null +++ b/app/src/main/java/com/nibble/musspeed/MusicSelectionActivity.kt @@ -0,0 +1,50 @@ +package com.nibble.musspeed + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.ImageButton + +class MusicSelectionActivity : AppCompatActivity() { + private lateinit var btnToRun : ImageButton + private lateinit var btnToMap : ImageButton + private lateinit var btnToBody : ImageButton + private lateinit var btnToMus : ImageButton + private lateinit var btnToWorkout : ImageButton + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_music_selection) + btnToRun = findViewById(R.id.to_path_run) + btnToRun.setOnClickListener { toRun() } + btnToMap = findViewById(R.id.to_path_selector) + btnToMap.setOnClickListener { toMap() } + btnToBody = findViewById(R.id.to_body_selector) + btnToBody.setOnClickListener { toBody() } + btnToMus = findViewById(R.id.to_music_selector) + btnToMus.setOnClickListener { toMus() } + btnToWorkout = findViewById(R.id.to_workout_selector) + btnToWorkout.setOnClickListener { toWorkout() } + } + + private fun toRun(){ + val intent = Intent(this, PathRunActivity::class.java) + startActivity(intent) + } + private fun toMap(){ + val intent = Intent(this, PathSelectionActivity::class.java) + startActivity(intent) + } + private fun toBody(){ + val intent = Intent(this, BodySelectionActivity::class.java) + startActivity(intent) + } + private fun toMus(){ + val intent = Intent(this, MusicSelectionActivity::class.java) + startActivity(intent) + } + private fun toWorkout(){ + val intent = Intent(this, WorkoutSelectionActivity::class.java) + startActivity(intent) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nibble/musspeed/PathRunActivity.kt b/app/src/main/java/com/nibble/musspeed/PathRunActivity.kt new file mode 100644 index 0000000..5219e19 --- /dev/null +++ b/app/src/main/java/com/nibble/musspeed/PathRunActivity.kt @@ -0,0 +1,72 @@ +package com.nibble.musspeed + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.webkit.WebView +import android.widget.ImageButton +import android.widget.ProgressBar +import android.widget.TextView + +class PathRunActivity : AppCompatActivity() { + private lateinit var btnToRun : ImageButton + private lateinit var btnToMap : ImageButton + private lateinit var btnToBody : ImageButton + private lateinit var btnToMus : ImageButton + private lateinit var btnToWorkout : ImageButton + private lateinit var webView : WebView; + private var progress : Int? = 0 + private var progressBar: ProgressBar? = null + private var textViewProgressBar: TextView? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_path_run) + btnToRun = findViewById(R.id.to_path_run) + btnToRun.setOnClickListener { toRun() } + btnToMap = findViewById(R.id.to_path_selector) + btnToMap.setOnClickListener { toMap() } + btnToBody = findViewById(R.id.to_body_selector) + btnToBody.setOnClickListener { toBody() } + btnToMus = findViewById(R.id.to_music_selector) + btnToMus.setOnClickListener { toMus() } + btnToWorkout = findViewById(R.id.to_workout_selector) + btnToWorkout.setOnClickListener { toWorkout() } + webView = findViewById(R.id.webView) + webView.settings.javaScriptEnabled = true + webView.loadUrl("file:///android_asset/index.html") + progressBar = findViewById(R.id.path_progress_bar); + textViewProgressBar = findViewById(R.id.text_view_path_progress_bar); + } + + private fun postProgress(progress: Int) { + val strProgress = "Вы прошли: $progress% пути" + progressBar?.progress = progress + if (progress == 0) { + progressBar?.secondaryProgress = 0 + } else { + progressBar?.secondaryProgress = progress + 5 + } + textViewProgressBar?.text = strProgress + } + private fun toRun(){ + val intent = Intent(this, PathRunActivity::class.java) + startActivity(intent) + } + private fun toMap(){ + val intent = Intent(this, PathSelectionActivity::class.java) + startActivity(intent) + } + private fun toBody(){ + val intent = Intent(this, BodySelectionActivity::class.java) + startActivity(intent) + } + private fun toMus(){ + val intent = Intent(this, MusicSelectionActivity::class.java) + startActivity(intent) + } + private fun toWorkout(){ + val intent = Intent(this, WorkoutSelectionActivity::class.java) + startActivity(intent) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nibble/musspeed/PathSelectionActivity.kt b/app/src/main/java/com/nibble/musspeed/PathSelectionActivity.kt new file mode 100644 index 0000000..6325aa9 --- /dev/null +++ b/app/src/main/java/com/nibble/musspeed/PathSelectionActivity.kt @@ -0,0 +1,50 @@ +package com.nibble.musspeed + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.ImageButton + +class PathSelectionActivity : AppCompatActivity() { + private lateinit var btnToRun : ImageButton + private lateinit var btnToMap : ImageButton + private lateinit var btnToBody : ImageButton + private lateinit var btnToMus : ImageButton + private lateinit var btnToWorkout : ImageButton + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_path_selection) + btnToRun = findViewById(R.id.to_path_run) + btnToRun.setOnClickListener { toRun() } + btnToMap = findViewById(R.id.to_path_selector) + btnToMap.setOnClickListener { toMap() } + btnToBody = findViewById(R.id.to_body_selector) + btnToBody.setOnClickListener { toBody() } + btnToMus = findViewById(R.id.to_music_selector) + btnToMus.setOnClickListener { toMus() } + btnToWorkout = findViewById(R.id.to_workout_selector) + btnToWorkout.setOnClickListener { toWorkout() } + } + + private fun toRun(){ + val intent = Intent(this, PathRunActivity::class.java) + startActivity(intent) + } + private fun toMap(){ + val intent = Intent(this, PathSelectionActivity::class.java) + startActivity(intent) + } + private fun toBody(){ + val intent = Intent(this, BodySelectionActivity::class.java) + startActivity(intent) + } + private fun toMus(){ + val intent = Intent(this, MusicSelectionActivity::class.java) + startActivity(intent) + } + private fun toWorkout(){ + val intent = Intent(this, WorkoutSelectionActivity::class.java) + startActivity(intent) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nibble/musspeed/WorkoutSelectionActivity.kt b/app/src/main/java/com/nibble/musspeed/WorkoutSelectionActivity.kt new file mode 100644 index 0000000..709a3ad --- /dev/null +++ b/app/src/main/java/com/nibble/musspeed/WorkoutSelectionActivity.kt @@ -0,0 +1,50 @@ +package com.nibble.musspeed + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.ImageButton + +class WorkoutSelectionActivity : AppCompatActivity() { + private lateinit var btnToRun : ImageButton + private lateinit var btnToMap : ImageButton + private lateinit var btnToBody : ImageButton + private lateinit var btnToMus : ImageButton + private lateinit var btnToWorkout : ImageButton + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_workout_selection) + btnToRun = findViewById(R.id.to_path_run) + btnToRun.setOnClickListener { toRun() } + btnToMap = findViewById(R.id.to_path_selector) + btnToMap.setOnClickListener { toMap() } + btnToBody = findViewById(R.id.to_body_selector) + btnToBody.setOnClickListener { toBody() } + btnToMus = findViewById(R.id.to_music_selector) + btnToMus.setOnClickListener { toMus() } + btnToWorkout = findViewById(R.id.to_workout_selector) + btnToWorkout.setOnClickListener { toWorkout() } + } + + private fun toRun(){ + val intent = Intent(this, PathRunActivity::class.java) + startActivity(intent) + } + private fun toMap(){ + val intent = Intent(this, PathSelectionActivity::class.java) + startActivity(intent) + } + private fun toBody(){ + val intent = Intent(this, BodySelectionActivity::class.java) + startActivity(intent) + } + private fun toMus(){ + val intent = Intent(this, MusicSelectionActivity::class.java) + startActivity(intent) + } + private fun toWorkout(){ + val intent = Intent(this, WorkoutSelectionActivity::class.java) + startActivity(intent) + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/btn_bg.xml b/app/src/main/res/drawable/btn_bg.xml new file mode 100644 index 0000000..13148ba --- /dev/null +++ b/app/src/main/res/drawable/btn_bg.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_baseline_pause_24.xml b/app/src/main/res/drawable/ic_baseline_pause_24.xml new file mode 100644 index 0000000..6daeb98 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_pause_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_play_arrow_24.xml b/app/src/main/res/drawable/ic_baseline_play_arrow_24.xml new file mode 100644 index 0000000..f2fd651 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_play_arrow_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_skip_next_24.xml b/app/src/main/res/drawable/ic_baseline_skip_next_24.xml new file mode 100644 index 0000000..39ee00d --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_skip_next_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_body.xml b/app/src/main/res/drawable/ic_body.xml new file mode 100644 index 0000000..07ab00c --- /dev/null +++ b/app/src/main/res/drawable/ic_body.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_body_inactive.xml b/app/src/main/res/drawable/ic_body_inactive.xml new file mode 100644 index 0000000..1309179 --- /dev/null +++ b/app/src/main/res/drawable/ic_body_inactive.xml @@ -0,0 +1,6 @@ + + + diff --git a/app/src/main/res/drawable/ic_map.xml b/app/src/main/res/drawable/ic_map.xml new file mode 100644 index 0000000..8f39fdb --- /dev/null +++ b/app/src/main/res/drawable/ic_map.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app/src/main/res/drawable/ic_map_inactive.xml b/app/src/main/res/drawable/ic_map_inactive.xml new file mode 100644 index 0000000..ceb79b4 --- /dev/null +++ b/app/src/main/res/drawable/ic_map_inactive.xml @@ -0,0 +1,8 @@ + + + + diff --git a/app/src/main/res/drawable/ic_music.xml b/app/src/main/res/drawable/ic_music.xml new file mode 100644 index 0000000..c90939f --- /dev/null +++ b/app/src/main/res/drawable/ic_music.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/ic_music_inactive.xml b/app/src/main/res/drawable/ic_music_inactive.xml new file mode 100644 index 0000000..3ee5d6a --- /dev/null +++ b/app/src/main/res/drawable/ic_music_inactive.xml @@ -0,0 +1,6 @@ + + + diff --git a/app/src/main/res/drawable/ic_run.xml b/app/src/main/res/drawable/ic_run.xml new file mode 100644 index 0000000..95f9296 --- /dev/null +++ b/app/src/main/res/drawable/ic_run.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app/src/main/res/drawable/ic_run_inactive.xml b/app/src/main/res/drawable/ic_run_inactive.xml new file mode 100644 index 0000000..e60bd62 --- /dev/null +++ b/app/src/main/res/drawable/ic_run_inactive.xml @@ -0,0 +1,8 @@ + + + + diff --git a/app/src/main/res/drawable/ic_workout_inactive.xml b/app/src/main/res/drawable/ic_workout_inactive.xml new file mode 100644 index 0000000..1929aab --- /dev/null +++ b/app/src/main/res/drawable/ic_workout_inactive.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/app/src/main/res/layout/activity_body_selection.xml b/app/src/main/res/layout/activity_body_selection.xml new file mode 100644 index 0000000..f4f369a --- /dev/null +++ b/app/src/main/res/layout/activity_body_selection.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 4fc2444..0000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_music_selection.xml b/app/src/main/res/layout/activity_music_selection.xml new file mode 100644 index 0000000..d32f704 --- /dev/null +++ b/app/src/main/res/layout/activity_music_selection.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_path_run.xml b/app/src/main/res/layout/activity_path_run.xml new file mode 100644 index 0000000..524a43c --- /dev/null +++ b/app/src/main/res/layout/activity_path_run.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_path_selection.xml b/app/src/main/res/layout/activity_path_selection.xml new file mode 100644 index 0000000..17a4b77 --- /dev/null +++ b/app/src/main/res/layout/activity_path_selection.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_workout_selection.xml b/app/src/main/res/layout/activity_workout_selection.xml new file mode 100644 index 0000000..7800cba --- /dev/null +++ b/app/src/main/res/layout/activity_workout_selection.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index b5b71d8..a5f1545 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -13,4 +13,9 @@ ?attr/colorPrimaryVariant + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..e52391d --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f8c6127..935e17a 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,4 +7,10 @@ #FF018786 #FF000000 #FFFFFFFF + #4CAF50 + #FF039BE5 + #FF01579B + #FF40C4FF + #FF00B0FF + #66000000 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f9aeeb5..94cb0bd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,8 @@ MuSSpeed + FullscreenActivity + Dummy Button + DUMMY\nCONTENT + FullscreenActivity + MuSSpeed \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..c1926a6 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 67c7170..1fa74f6 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -13,4 +13,15 @@ ?attr/colorPrimaryVariant + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index ef7bd27..a33d7ea 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath "com.android.tools.build:gradle:4.1.2" + classpath 'com.android.tools.build:gradle:4.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong