Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
robinsrk committed Feb 12, 2023
1 parent a4e43cc commit 4222c2e
Show file tree
Hide file tree
Showing 18 changed files with 634 additions and 132 deletions.
151 changes: 151 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ dependencies {
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// implementation 'androidx.navigation:navigation-runtime-ktx:2.5.2'
implementation 'androidx.navigation:navigation-compose:2.5.3'
Expand All @@ -82,8 +82,8 @@ dependencies {

// Firebase
implementation 'com.google.firebase:firebase-auth-ktx:21.1.0'
implementation 'com.google.firebase:firebase-firestore-ktx:24.4.2'
implementation 'com.google.firebase:firebase-bom:31.2.0'
implementation 'com.google.firebase:firebase-firestore-ktx:24.4.3'
implementation 'com.google.firebase:firebase-bom:31.2.1'
implementation 'com.google.firebase:firebase-analytics-ktx:21.2.0'
implementation 'com.google.firebase:firebase-database-ktx:20.1.0'
implementation 'com.google.firebase:firebase-database:20.1.0'
Expand Down Expand Up @@ -121,4 +121,7 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
// Icons
implementation 'androidx.compose.material:material-icons-extended:1.3.1'

// Work manager
implementation 'androidx.work:work-runtime-ktx:2.8.0'
}
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

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

<application
android:name="com.example.buspayment.BaseApplication"
android:allowBackup="true"
Expand Down
26 changes: 5 additions & 21 deletions app/src/main/java/com/example/buspayment/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,29 @@ package com.example.buspayment
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController
import com.example.buspayment.funtions.NotificationService
import com.example.buspayment.navigations.SetupNavGraph
import com.example.buspayment.realtimeDB.repository.DBRepository
import com.example.buspayment.ui.theme.BusPaymentTheme
import dagger.hilt.android.AndroidEntryPoint


@AndroidEntryPoint
class MainActivity : ComponentActivity() {

private lateinit var navController: NavHostController

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
DBRepository.setContext(this)
NotificationService(applicationContext).createNotificationChannel()
setContent {
BusPaymentTheme {
Surface(
Expand All @@ -48,16 +45,3 @@ class MainActivity : ComponentActivity() {
}


@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
var email by remember { mutableStateOf("") }
BusPaymentTheme {
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
}
}
}
37 changes: 0 additions & 37 deletions app/src/main/java/com/example/buspayment/funtions/Credentials.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.example.buspayment.funtions

import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.os.Build
import androidx.core.app.NotificationCompat
import com.example.buspayment.R

class NotificationService(
private val context: Context,
) {
fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel =
NotificationChannel(
"BusPayment",
"Notification for bys payment",
NotificationManager.IMPORTANCE_DEFAULT
).apply {
description = "Testing new notification"
}
val notificationManager: NotificationManager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.createNotificationChannel(channel)
}
}

fun showNotification(
title: String,
text: String,
) {
val notificationManager =
context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val notification =
NotificationCompat.Builder(context, "BusPayment").setContentTitle(title)
.setSmallIcon(R.drawable.undraw_bus_stop_re_h8ej)
.setContentText(text).build()
notificationManager.notify(1, notification)
}

}

This file was deleted.

Loading

0 comments on commit 4222c2e

Please sign in to comment.