Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
fixed notifications for Android S
Browse files Browse the repository at this point in the history
  • Loading branch information
icabetong committed Feb 13, 2022
1 parent 94e20ef commit 75d72bc
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 397 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

package com.isaiahvonrundstedt.fokus.components.extensions.jdk

import java.time.*
import java.time.LocalDate
import java.time.LocalTime
import java.time.ZoneId
import java.time.ZonedDateTime
import java.util.*

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.lifecycle.LiveData
import androidx.room.*
import com.isaiahvonrundstedt.fokus.features.event.Event
import com.isaiahvonrundstedt.fokus.features.event.EventPackage
import java.time.LocalDate

@Dao
interface EventDAO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ package com.isaiahvonrundstedt.fokus.features.core.activities
import android.app.NotificationManager
import android.os.Build
import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.core.os.bundleOf
import androidx.navigation.NavController
import androidx.navigation.Navigation
import androidx.navigation.findNavController
import com.isaiahvonrundstedt.fokus.R
import com.isaiahvonrundstedt.fokus.components.bottomsheet.NavigationSheet
import com.isaiahvonrundstedt.fokus.components.extensions.android.getParcelableListExtra
import com.isaiahvonrundstedt.fokus.components.utils.NotificationChannelManager
import com.isaiahvonrundstedt.fokus.databinding.ActivityMainBinding
import com.isaiahvonrundstedt.fokus.features.attachments.Attachment
import com.isaiahvonrundstedt.fokus.features.core.compose.FokusApp
import com.isaiahvonrundstedt.fokus.features.event.Event
import com.isaiahvonrundstedt.fokus.features.event.editor.EventEditor
import com.isaiahvonrundstedt.fokus.features.notifications.task.TaskReminderWorker
Expand All @@ -33,12 +33,13 @@ class MainActivity : BaseActivity() {
private val taskViewModel: TaskViewModel by viewModels()

private var controller: NavController? = null
private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//binding = ActivityMainBinding.inflate(layoutInflater)
setContent { FokusApp() }
//controller = Navigation.findNavController(this, R.id.navigationHostFragment)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
controller = findNavController(R.id.navigationHostFragment)

intent?.also { intent ->
when (intent.action) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.widget.AppCompatTextView
import androidx.compose.material.BottomSheetScaffold
import androidx.compose.material.BottomSheetScaffoldState
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.runtime.Composable
import androidx.core.os.bundleOf
import androidx.core.view.forEach
import androidx.core.view.isVisible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ abstract class BaseWorker(context: Context, workerParameters: WorkerParameters)
putExtra(NotificationActionService.EXTRA_TASK_ID, log.data)
putExtra(NotificationActionService.EXTRA_IS_PERSISTENT, log.isImportant)
action = NotificationActionService.ACTION_FINISHED
}, PendingIntent.FLAG_UPDATE_CURRENT)
}, PendingIntent.FLAG_IMMUTABLE)

manager.notify(tag ?: NOTIFICATION_TAG_TASK, NOTIFICATION_ID_TASK,
createNotification(log, NOTIFICATION_CHANNEL_ID_TASK,
Expand Down Expand Up @@ -188,7 +188,7 @@ abstract class BaseWorker(context: Context, workerParameters: WorkerParameters)
private val contentIntent: PendingIntent
get() {
return PendingIntent.getActivity(applicationContext, 0,
Intent(applicationContext, MainActivity::class.java), PendingIntent.FLAG_UPDATE_CURRENT)
Intent(applicationContext, MainActivity::class.java), PendingIntent.FLAG_IMMUTABLE)
}

private val notificationSoundUri: Uri
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 75d72bc

Please sign in to comment.