GithubHelp home page GithubHelp logo

code-with-the-italians / bundel Goto Github PK

View Code? Open in Web Editor NEW
279.0 7.0 25.0 1.53 MB

A digital wellbeing Android app that helps minimise distractions when you don't want them. Watch us live code it at https://cwti.link/twitch or catch up on YouTube at https://cwti.link/yt. Merch available at https://cwti.link/spaccio.

Home Page: https://codewiththeitalians.it

License: Apache License 2.0

Kotlin 100.00%
kotlin android kotlin-android coroutines-android jetpack-compose android-studio static-analysis hilt-android room

bundel's People

Contributors

atulgpt avatar blundell avatar hamen avatar hvisser avatar maiatoday avatar martinbonnin avatar rock3r avatar santansarah avatar tikurahul avatar tiwiz avatar zianea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bundel's Issues

Add Crashlytics

  • Add basic dependency
  • Disable it by default
  • Provide the user with a way to enable it during the onboarding
  • Provide the user with a way to disable/enable it in the Settings screen

Something is off with WEBP_LOSSLESS support

Describe the bug
App crashing after giving access to notifications

To Reproduce
Steps to reproduce the behavior:

  1. Give permissions
  2. Go back to the app

Expected behavior
I would expect to reach the main screen.

Screenshots
N.A.

Smartphone (please complete the following information):

  • Device: S9
  • OS: Android 10

Additional context

java.lang.NoSuchFieldError: No static field WEBP_LOSSLESS of type Landroid/graphics/Bitmap$CompressFormat; in class Landroid/graphics/Bitmap$CompressFormat; or its superclasses (declaration of 'android.graphics.Bitmap$CompressFormat' appears in /system/framework/framework.jar)
        at dev.sebastiano.bundel.storage.DiskImagesStorage$ImageFormat.<clinit>(DiskImagesStorage.kt:109)
        at dev.sebastiano.bundel.storage.DiskImagesStorage.getCachedImageFormat(DiskImagesStorage.kt:99)
        at dev.sebastiano.bundel.storage.DiskImagesStorage.getIconFile(DiskImagesStorage.kt:59)
        at dev.sebastiano.bundel.storage.DiskImagesStorage.saveIcon(DiskImagesStorage.kt:37)
        at dev.sebastiano.bundel.storage.DiskImagesStorage.saveIconsFrom(DiskImagesStorage.kt:24)
        at dev.sebastiano.bundel.storage.RobertoRepository.saveNotification(RobertoRepository.kt:15)
        at dev.sebastiano.bundel.storage.RobertoRepository$saveNotification$1.invokeSuspend(Unknown Source:15)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
        at dev.sebastiano.bundel.notifications.BundelNotificationListenerService.onListenerConnected(BundelNotificationListenerService.kt:30)
        at android.service.notification.NotificationListenerService$MyHandler.handleMessage(NotificationListenerService.java:2076)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8167)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Add documentation to properly run the app locally

The app requires a google-services.json to run; we need to document it and explain how users can generate it, and also how they can make do with the dummy one in build-config/ if they only need to run tests or static analysis.

App crashes at startup

Describe the bug
The app crashes on startup with the following exception:

java.lang.NullPointerException: getString(context.contentResolver, "enabled_notification_listeners") must not be null
at dev.sebastiano.bundel.notifications.NotificationServiceHelpersKt.needsNotificationsPermission(NotificationServiceHelpers.kt:9)

To Reproduce
I was able to get the app to start by making the following changes:

internal fun needsNotificationsPermission(context: Context): Boolean {
    val pkgName = context.packageName
    val enabledListeners = Settings.Secure.getString(context.contentResolver, "enabled_notification_listeners")
        ?.split(":")
    if (enabledListeners != null && enabledListeners.isEmpty()) return false

    return enabledListeners == null || enabledListeners
        .map { listenerPackageName -> ComponentName.unflattenFromString(listenerPackageName) }
        .none { pkgName == it?.packageName }
}

However, after the fix, I couldn't reproduce the error by simply uninstalling the app. I had to wipe the device data for the error to recur.

Desktop (please complete the following information):

  • OS: Windows 10

Smartphone (please complete the following information):

  • Device: Emulator
  • OS: Android API 30

Crash on giving notification access

Describe the bug
App crashes on giving notification access

To Reproduce
Steps to reproduce the behavior:

  1. Open project in Android Studio.
  2. Run it on Emulator API 29 or API 30
  3. Give notification access to the app on device
  4. App Crashes

Error via logcat:

2021-05-14 14:38:24.583 11014-11014/dev.sebastiano.bundel E/AndroidRuntime: FATAL EXCEPTION: main
    Process: dev.sebastiano.bundel, PID: 11014
    java.lang.RuntimeException: Tried to marshall a Parcel that contained Binder objects.
        at android.os.Parcel.nativeMarshall(Native Method)
        at android.os.Parcel.marshall(Parcel.java:552)
        at dev.sebastiano.bundel.storage.NotificationsCache.toByteArray(NotificationsCache.kt:53)
        at dev.sebastiano.bundel.storage.NotificationsCache.writeToFile(NotificationsCache.kt:44)
        at dev.sebastiano.bundel.storage.NotificationsCache.storeStatusBarNotification(NotificationsCache.kt:36)
        at dev.sebastiano.bundel.storage.RobertoRepository$saveNotification$2.invokeSuspend(RobertoRepository.kt:24)

Expected behavior
To not crash

Add Settings screen PoC

Let's create a Settings screen to setup the navigation infrastructure in the app.

  • Create a Settings screen
  • Setup Navigation Components for Compose
  • Add a button on Main screen to navigate to Settings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.