Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pomodoro_Team_7
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
moxdlab
moco2024
Pomodoro_Team_7
Commits
9fcd11b1
Commit
9fcd11b1
authored
10 months ago
by
Khaleeq
Browse files
Options
Downloads
Patches
Plain Diff
Update
parent
75246438
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/com/pomo/myapplication/MainActivity.kt
+21
-65
21 additions, 65 deletions
app/src/main/java/com/pomo/myapplication/MainActivity.kt
with
21 additions
and
65 deletions
app/src/main/java/com/pomo/myapplication/MainActivity.kt
+
21
−
65
View file @
9fcd11b1
...
...
@@ -5,22 +5,15 @@ import android.content.pm.PackageManager
import
android.os.Bundle
import
androidx.activity.ComponentActivity
import
androidx.activity.compose.setContent
import
androidx.compose.foundation.background
import
androidx.compose.foundation.layout.Arrangement
import
androidx.compose.foundation.layout.Column
import
androidx.compose.foundation.layout.Row
import
androidx.compose.foundation.layout.Spacer
import
androidx.compose.foundation.layout.fillMaxSize
import
androidx.compose.foundation.layout.height
import
androidx.compose.foundation.layout.padding
import
androidx.compose.foundation.layout.width
import
androidx.compose.foundation.shape.RoundedCornerShape
import
androidx.compose.material.icons.Icons
import
androidx.compose.material.icons.filled.PlayArrow
import
androidx.compose.material3.Button
import
androidx.compose.material3.ButtonDefaults
import
androidx.compose.material3.Icon
import
androidx.compose.material3.IconButton
import
androidx.compose.material3.MaterialTheme
import
androidx.compose.material3.Surface
import
androidx.compose.material3.Text
...
...
@@ -42,7 +35,6 @@ import kotlinx.coroutines.Job
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.launch
class
MainActivity
:
ComponentActivity
()
{
private
lateinit
var
notificationHelper
:
NotificationHelper
...
...
@@ -131,6 +123,7 @@ class MainActivity : ComponentActivity() {
timerRunning
=
false
}
Column
(
modifier
=
Modifier
.
fillMaxSize
(),
horizontalAlignment
=
Alignment
.
CenterHorizontally
,
...
...
@@ -139,7 +132,7 @@ class MainActivity : ComponentActivity() {
TimerDisplay
(
time
=
timeFormatted
)
Spacer
(
modifier
=
Modifier
.
height
(
20
.
dp
))
Row
{
/*
Button(
Button
(
onClick
=
{
startTimer
()
timeLeftForNotification
=
timeFormatted
...
...
@@ -148,38 +141,7 @@ class MainActivity : ComponentActivity() {
enabled
=
!
timerRunning
)
{
Text
(
text
=
"Start"
)
}*/
IconButton
(
onClick
=
{
startTimer
()
timeLeftForNotification
=
timeFormatted
notificationHelper
.
showNotification
(
timeFormatted
)
},
modifier
=
Modifier
.
padding
(
8
.
dp
)
// Optional: Abstand um den IconButton herum
.
background
(
Color
(
0xFF4CAF50
),
RoundedCornerShape
(
16
.
dp
))
// Optional: Hintergrundfarbe und Form
)
{
Icon
(
imageVector
=
Icons
.
Filled
.
PlayArrow
,
contentDescription
=
"Play"
,
tint
=
Color
.
White
)
}
Spacer
(
modifier
=
Modifier
.
width
(
8
.
dp
))
Button
(
onClick
=
{
stopTimer
()
},
...
...
@@ -197,54 +159,48 @@ class MainActivity : ComponentActivity() {
Spacer
(
modifier
=
Modifier
.
height
(
20
.
dp
))
Row
{
// Dieser Button wird gelöscht ist nur für Testzwecke da
Button
(
onClick
=
{
setTimer
(
1
)
},
colors
=
ButtonDefaults
.
buttonColors
(
containerColor
=
Color
(
0xFF4CAF50
),
// Grün
contentColor
=
Color
.
White
// Weißer Text
)
)
{
Text
(
text
=
"1 min"
)
}
// Dieser Button wird gelöscht ist nur für Testzwecke da
Button
(
onClick
=
{
setTimer
(
5
)
},
colors
=
ButtonDefaults
.
buttonColors
(
containerColor
=
Color
(
0xFF
6650a4
),
// Grün
containerColor
=
Color
(
0xFF
4CAF50
),
// Grün
contentColor
=
Color
.
White
// Weißer Text
),
shape
=
RoundedCornerShape
(
10
.
dp
),
// Abgerundete Ecken
modifier
=
Modifier
.
padding
(
8
.
dp
)
// Abstand um den Button herum
.
width
(
100
.
dp
)
// Breite des Buttons
.
height
(
50
.
dp
)
// Höhe des Buttons
)
)
{
Text
(
text
=
"5 min"
)
}
Spacer
(
modifier
=
Modifier
.
width
(
8
.
dp
))
// Dieser Button wird gelöscht ist nur für Testzwecke da
Button
(
onClick
=
{
setTimer
(
15
)
},
colors
=
ButtonDefaults
.
buttonColors
(
containerColor
=
Color
(
0xFF
6650a4
),
// Grün
containerColor
=
Color
(
0xFF
4CAF50
),
// Grün
contentColor
=
Color
.
White
// Weißer Text
),
shape
=
RoundedCornerShape
(
10
.
dp
),
// Abgerundete Ecken
modifier
=
Modifier
.
padding
(
8
.
dp
)
// Abstand um den Button herum
.
width
(
100
.
dp
)
// Breite des Buttons
.
height
(
50
.
dp
)
// Höhe des Buttons
)
)
{
Text
(
text
=
"15 min"
)
}
Spacer
(
modifier
=
Modifier
.
width
(
8
.
dp
))
// Dieser Button wird gelöscht ist nur für Testzwecke da
Button
(
onClick
=
{
setTimer
(
25
)
},
colors
=
ButtonDefaults
.
buttonColors
(
containerColor
=
Color
(
0xFF
6650a4
),
// Grün
containerColor
=
Color
(
0xFF
4CAF50
),
// Grün
contentColor
=
Color
.
White
// Weißer Text
),
shape
=
RoundedCornerShape
(
10
.
dp
),
// Abgerundete Ecken
modifier
=
Modifier
.
padding
(
8
.
dp
)
// Abstand um den Button herum
.
width
(
100
.
dp
)
// Breite des Buttons
.
height
(
50
.
dp
)
// Höhe des Buttons
)
)
{
Text
(
text
=
"25 min"
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment