Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Formatting #55

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ fastlane/readme.md
app/schemas/com.example.android.january2022.db.GymDatabase/1.json
*.json
/app/signing/
.idea
.DS_Store
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

37 changes: 0 additions & 37 deletions .idea/androidTestResultsUserPreferences.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

38 changes: 0 additions & 38 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

19 changes: 0 additions & 19 deletions .idea/misc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.example.android.january2022

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import junit.framework.TestCase.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.android.january2022", appContext.packageName)
}
}
}
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/Theme.January2022.NoActionBar">
<intent-filter>
Expand Down
40 changes: 20 additions & 20 deletions app/src/main/java/com/example/android/january2022/GymApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class GymApp : Application() {
override fun onCreate() {
super.onCreate()
val channel = NotificationChannel(
TimerService.CHANNEL_ID,
"Workout Timer",
NotificationManager.IMPORTANCE_DEFAULT
).also {
it.setSound(null, null)
override fun onCreate() {
super.onCreate()
val channel = NotificationChannel(
TimerService.CHANNEL_ID,
"Workout Timer",
NotificationManager.IMPORTANCE_DEFAULT,
).also {
it.setSound(null, null)
}
val alertChannel = NotificationChannel(
TimerService.ALERT_CHANNEL_ID,
"Workout Timer Alerts",
NotificationManager.IMPORTANCE_HIGH,
).also {
it.enableVibration(true)
}
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
notificationManager.createNotificationChannel(alertChannel)
}
val alertChannel = NotificationChannel(
TimerService.ALERT_CHANNEL_ID,
"Workout Timer Alerts",
NotificationManager.IMPORTANCE_HIGH
).also {
it.enableVibration(true)
}
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
notificationManager.createNotificationChannel(alertChannel)
}
}
}
59 changes: 29 additions & 30 deletions app/src/main/java/com/example/android/january2022/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,41 @@ import dagger.hilt.android.AndroidEntryPoint
import timber.log.Timber
import timber.log.Timber.DebugTree


@AndroidEntryPoint
class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (BuildConfig.DEBUG) {
Timber.plant(DebugTree())
}
setContent {
WorkoutTheme {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
ActivityCompat.requestPermissions(
this,
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
0
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (BuildConfig.DEBUG) {
Timber.plant(DebugTree())
}
setContent {
WorkoutTheme {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
ActivityCompat.requestPermissions(
this,
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
0,
)
}
val navController = rememberNavController()
WindowCompat.setDecorFitsSystemWindows(window, false)
NavHost(navController)
}
}
val navController = rememberNavController()
WindowCompat.setDecorFitsSystemWindows(window, false)
NavHost(navController)
}
}
}

override fun onStart() {
super.onStart()
this.sendTimerIntent {
it.action = TimerService.Actions.MOVE_TO_BACKGROUND.toString()
override fun onStart() {
super.onStart()
this.sendTimerIntent {
it.action = TimerService.Actions.MOVE_TO_BACKGROUND.toString()
}
}
}

override fun onPause() {
super.onPause()
this.sendTimerIntent {
it.action = TimerService.Actions.MOVE_TO_FOREGROUND.toString()
override fun onPause() {
super.onPause()
this.sendTimerIntent {
it.action = TimerService.Actions.MOVE_TO_FOREGROUND.toString()
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.android.january2022.db


object Equipment {
const val ATLAS_STONE = "Atlas Stone"
const val BARBELL = "Barbell"
Expand Down Expand Up @@ -40,7 +39,7 @@ object Equipment {
SMITH_MACHINE,
STABILITY_BALL,
SUSPENSION,
WEIGHT
WEIGHT,
)
}
}
}
Loading