Skip to content

Commit

Permalink
added
Browse files Browse the repository at this point in the history
  • Loading branch information
devrath committed Jan 4, 2024
1 parent 0a3daaa commit 25e6b9f
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Code/StopwatchServiceApp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:tools="http:https://schemas.android.com/tools">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:name=".MyApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.istudio.app

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class MyApplication: Application()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.istudio.app.util

fun formatTime(seconds: String, minutes: String, hours: String): String {
return "$hours:$minutes:$seconds"
}

fun Int.pad(): String {
return this.toString().padStart(2, '0')
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.istudio.app.util

object Constants {
const val ACTION_SERVICE_START = "ACTION_SERVICE_START"
const val ACTION_SERVICE_STOP = "ACTION_SERVICE_STOP"
const val ACTION_SERVICE_CANCEL = "ACTION_SERVICE_CANCEL"

const val STOPWATCH_STATE = "STOPWATCH_STATE"

const val NOTIFICATION_CHANNEL_ID = "STOPWATCH_NOTIFICATION_ID"
const val NOTIFICATION_CHANNEL_NAME = "STOPWATCH_NOTIFICATION"
const val NOTIFICATION_ID = 10

const val CLICK_REQUEST_CODE = 100
const val CANCEL_REQUEST_CODE = 101
const val STOP_REQUEST_CODE = 102
const val RESUME_REQUEST_CODE = 103
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http:https://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M15,1L9,1v2h6L15,1zM11,14h2L13,8h-2v6zM19.03,7.39l1.42,-1.42c-0.43,-0.51 -0.9,-0.99 -1.41,-1.41l-1.42,1.42C16.07,4.74 14.12,4 12,4c-4.97,0 -9,4.03 -9,9s4.02,9 9,9 9,-4.03 9,-9c0,-2.12 -0.74,-4.07 -1.97,-5.61zM12,20c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<vector xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:aapt="http:https://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

0 comments on commit 25e6b9f

Please sign in to comment.