Code Monkey home page Code Monkey logo

droidconkekotlin's Introduction

droidconKE Android App

Android app for the first ever Android Developer conference-droidcon in Nairobi 2018

This project is the Android app for the conference. The app supports devices running Android 5.0+, and is optimized for phones and tablets of all shapes and sizes.

Source

The source code in this repository reflects the app as of droidconKE 2018.

Features

The app displays a list of conference events - sessions, office hours, app reviews, codelabs, etc. - Users can see details about events.

The app also displays a map of the venue and shows informational pages to guide attendees during the conference.

Schedule screenshot

Development Environment

The app is written in Java and Kotlin and uses the Gradle build system.

To build the app, use the gradlew build command or use "Import Project" in Android Studio. A canary or stable version >= 3.2 of Android Studio is required and may be downloaded here.

Architecture

The architecture is built around Android Architecture Components.

We followed the recommendations laid out in the Guide to App Architecture when deciding on the architecture for the app. We kept logic away from Activities and Fragments and moved it to ViewModels. We observed data using LiveData

We used a Repository layer for handling data operations.droidconKE's data comes from a few different sources - user data is stored in Cloud Firestore (either remotely or in a local cache for offline use), user preferences and settings are stored in SharedPreferences, conference data is stored remotely and is fetched and stored in memory for the app to use, etc. - and the repository modules are responsible for handling all data operations and abstracting the data sources from the rest of the app (we liked using Firestore, but if we wanted to swap it out for a different data source in the future, our architecture allows us to do so in a clean way).

Firebase

The app makes considerable use of the following Firebase components:

  • Cloud Firestore is our source for all conference and user data. Firestore gave us automatic sync and also seamlessly managed offline functionality for us.
  • Crashlytics allowed us to detect bugs and catch errors.
  • Firebase Cloud Messaging let us inform the app about changes to conference data on our server.
  • Remote Config helped us manage in-app constants.
  • Firebase Authentification helped us to provide easy and secure authentification using email.

[ ๐Ÿšง Work in progress ๐Ÿ‘ทโ€โ™€๏ธโ›๐Ÿ‘ท๐Ÿ”ง๏ธ ๐Ÿšง ]

  • Rewriting .droidconKE app in Kotlin and taking advantage of kotlin features like coroutines,kotlin android extensions etc
  • Version 2.0 features writeup(UI Improvements, Event Reservation Feature,Starring Session Feature etc)
  • CI/CD Setup
  • Offline First Architecture Improvements

License

MIT License

Copyright (c) 2018 droidConKE

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

droidconkekotlin's People

Contributors

bkinya avatar borwe avatar chege4179 avatar chepsi avatar cliffgor avatar emmanuelmuturia avatar etonotieno avatar github-actions[bot] avatar jacquigee avatar janewaitara avatar joelmuraguri avatar jumaallan avatar jumapaul avatar kanake10 avatar kennethmathari avatar kibettheophilus avatar mambobryan avatar mertoenjosh avatar michaelbukachi avatar misshannah avatar mog-rn avatar ndiritumichael avatar njoguu avatar paulodhiambo avatar raynafs avatar restyled-io[bot] avatar robert-nganga avatar terry-mochire avatar wangerekaharun avatar yveskalume 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

droidconkekotlin's Issues

Re-Introduce Feed Tab

Ths was removed since the API didn't have any data. We should re-add it and add API implementation.

[Fix About Us] Text colour not clear in dark mode

Describe the bug
Some of the text in the about screen is not visible in dark theme mode

To Reproduce
Steps to reproduce the behavior:

  1. Change device settings to dark theme before opening the app
  2. Go to 'About'
  3. See unreadable sections in screen

Expected behavior
Readable text

Screenshots
Added screenshot
Screenshot_20230614-222208

Remove Repetitive Setups in Gradle Files

With the new build plugins approach, we already have most stuff set up eg target SDK, and don't need to set them again in the Gradle files. Look for all the things that can be cleaned up

Session Card On homepage not showing image.

Ideally, the session card on the home page should show an image. You can compare it with the image when you open Sessions on the bottom navigation and open any session.

Check the screenshot below.
image

Chai Design System

Finalize on Chai Design System for the app. Add:

  • Texts
  • Buttons
  • Colors
  • Cards

Fix Filter Sessions Implementation

The filter session logic was using SQLBuilder logic which is commented out cause it was causing build issues. Change the implementation to use the Koltin approach.

[Fix Emojis] in the feedback section

A clear and concise description of what the bug is.
The feedback emojis show the same feeling for Okay, Great, and Bad.

Expected behavior
Show different feelings for satisfaction.

Screenshots
EXPECTED
image

ACTUAL
image

Move network/database operations to the background/IO Thread

Describe the bug

Currently, most network/database operations in the repository layer are implemented in the main/UI thread. This might lead to ANR issues due to congestion in the main thread.

To Reproduce

N/A

Expected behavior

All network/database operations should run in the background/IO thread so as to minimize ANR issues.

Crash on Home Speakers Card Click

When one is on the home screen and clicks on the Speakers card, there is a crash with the following message;

 java.lang.IllegalArgumentException: Navigation destination that matches request NavDeepLinkRequest{ uri=android-app://androidx.navigation//speaker_details/{speakerId} } cannot be found in the navigation graph NavGraph(0x0) startDestination={Destination(0x9f0a1621) route=/home}
                                                                                                    	at androidx.navigation.NavController.navigate(NavController.kt:1664)
                                                                                                    	at androidx.navigation.NavController.navigate(NavController.kt:1984)
                                                                                                    	at androidx.navigation.NavController.navigate$default(NavController.kt:1979)
                                                                                                    	at com.android254.presentation.common.navigation.NavigationKt$Navigation$2$1$2.invoke(Navigation.kt:45)
                                                                                                    	at com.android254.presentation.common.navigation.NavigationKt$Navigation$2$1$2.invoke(Navigation.kt:42)

Add End to End(e2e) UI Tests

Current UI Tests Cover only display/exist assertions. We should add more tests to cover:

  • States
  • Whole app flow
  • Screenshot testing??

Dark Mode Feed Screen

When you switch to dark mode launch app and open Feed bottom navigation destination, the text is not visible. The dark mode designs can be found here

image

Add convention plugins to version catalogs

Apply the convention plugins using a version catalog instead of a string plugin ID which can be error-prone. A version catalog also helps in the discoverability of the available plugins.

[Feature] Validate gradle wrapper when a PR is opened

Is your feature request related to a problem? Please describe.
When the wrapper is updated by external contributors, there's the possibility of embedding malicious code in the .jar file.

Describe the solution you'd like
Gradle provides a GitHub action that checks if the wrapper matches one of their published SHA-256 checksums. If any file does not match, the action will fail.

Describe alternatives you've considered
Manually checking the checksum of gradle-wrapper.jar and validating if it matches any of Gradle's checksums.

Additional context
https://blog.gradle.org/gradle-wrapper-checksum-verification-github-action

[Fix Speakers] Title text not clear in dark mode

Describe the bug
The title text in the speaker screen is not visible in dark theme mode

To Reproduce
Steps to reproduce the behavior:

See unreadable sections in screen

  1. Change device settings to dark theme before opening the app
  2. Go to 'Speakers'
  3. See unclear title

Expected behavior
Clear title

Screenshots
Added screenshot
Screenshot

Use StateFlow to hold UI Data

Currently, the app uses both StateFlow(check SpeakersViewModel ) and LiveData(Check SessionsViewModel) to hold UI data.

LiveData is officially deprecated, Check this reddit

Solution: migrate current implementations to use Stateflow and take advantage of the features of Kotlin Flows

Update the Android Gradle plugin

Currently, we are using Android Gradle Plugin Version 7.4.1 we'd like to update to the latest version. Please test thoroughly that the app works after the update.

Crash: SessionDao_Impl.fetchSessionsWithFilters

We are facing this crash on production with the below stacktrace.

Fatal Exception: android.database.sqlite.SQLiteException: near "1": syntax error (code 1 SQLITE_ERROR): , while compiling: 1
       at android.database.sqlite.SQLiteConnection.nativePrepareStatement(SQLiteConnection.java)
       at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1055)
       at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:662)
       at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:590)
       at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:61)
       at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
       at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:46)
       at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1556)
       at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1524)
       at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.query(FrameworkSQLiteDatabase.kt:156)
       at androidx.room.RoomDatabase.query(RoomDatabase.kt:481)
       at androidx.room.util.DBUtil.query(DBUtil.kt:75)
       at com.android254.data.dao.SessionDao_Impl.fetchSessionsWithFilters(SessionDao_Impl.java:709)
       at com.android254.data.repos.SessionsManager$fetchAndSaveSessions$2.invokeSuspend(SessionsManager.kt:50)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Text Color On dark mode

1.Text color doesn't change when selected in bottom Nav
2.Text color not clear on dark mode in sessions screen

Migrate some State for some screens from their composables to their respective ViewModels

There are some screens like the SpeakersScreen where the speakers state variable is in the composable,i.e

val speakers = remember { mutableStateListOf<SpeakerUI>() }
LaunchedEffect(Unit) {
       speakers.addAll(speakersViewModel.getSpeakers())
 } 

then the speakers are loaded into the state using the LaunchedEffect block. I was suggesting if we could migrate the state from the composable to the view model and load it from there. Same thing with the SpeakerDetailsScreens and others

[Fix Feed] Text colour not clear in dark mode

Describe the bug
Some of the text in the feed screen is not visible in dark theme mode

To Reproduce
Steps to reproduce the behavior:

  1. Change device settings to dark theme before opening the app
  2. Go to 'Feed'
  3. See unreadable sections in screen

Expected behavior
Readable text

Screenshots
Added screenshot
Screenshot 2

Migrate from collectAsState to collectAsStateWithLifecycle

Currently, the app uses collectAsState() API to collect flows in the UI.

collectAsState() is platform agnostic. So it's not aware of the Android lifecycle. This way it may keep the collection of the flows active even when the app is in the background wasting resources.

collectAsStateWithLifeCycle collects flows in a lifecycle-aware manner. It stops collecting flows when lifecycle moves out of the target state.
Find out more on consuming flows safely in jetpack compose here

Fix Bottom Sheet Scrim Colors

Since Bottom Sheets are not yet in MD3, we have the AOSP code for the bottom sheets but the scrim color needs to be fixed. Check Share Feed & Filter Screens

Architecture Documentation for droidconKE 2023 app

Is your feature request related to a problem? Please describe.
We need to have a proper architecture documentation that:

  • Shows what the app will look like and features it plugs into.
  • Lack of this documented vision and direction often causes confusion to the contributors.

Describe the solution you'd like

  • Create documentation before we start implementing features. Tools like Mockla or draw.io and a link to the diagram made open then linked to a docs section in the app.
  • Require documentation of features as they are developed(Inline + or - on the markdown.

Describe alternatives you've considered
No documentation is the alternative and its a painful experience.

Additional context
Previous calls for documentation have been ignored an explanation by code owners would be great. See this issue

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.