Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to AS Flamingo #126

Merged
merged 12 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ jobs:
run: echo $AUTH | base64 --decode > /tmp/keystore

- name: Checkout the Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
java-version: '17'

- name: Cache gradle
uses: actions/cache@v1
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-to-playstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
distribution: 'zulu'
java-version: '17'

- name: Assemble Release Bundle
run: ./gradlew bundleRelease
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ jobs:
run: echo $AUTH | base64 --decode > /tmp/keystore

- name: Checkout the Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
java-version: '17'

- name: Cache gradle
uses: actions/cache@v1
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
source "https://rubygems.org"

gem "fastlane"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
62 changes: 48 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# droidcon KE 23 🔥🔨

Android app for the 4th Android Developer conference- droidcon to be held in Nairobi on 8th - 10th November.
Android app for the 4th Android Developer conference- droidcon to be held in Nairobi on 8th - 10th
November.

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.

## Running the Project

To ensure the project runs on your local environment ensure to you have Java 11 on your pc or if you don't have you can install it from [here](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html).
To ensure the project runs on your local environment ensure to you have Java 11 on your pc or if you
don't have you can install it
from [here](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html).

If you have multiple installations of Java make sure to set Java 11 as your preferred version to run the project.
If you have multiple installations of Java make sure to set Java 11 as your preferred version to run
the project.

With the new Android Gradle Plugin version 8.0.0, you need Java 17 to run the project and any
terminal commands. A workaround for this, it to add this in your **global** gradle.properties file:

```properties
org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
```

This simply sets the Gradle Java home to the one set in Android Studio. Android Studio
Flamingo comes bundled with Java 17. You only need to ensure the project uses Java 17. To do so,
go to **File -> Project Structure -> SDK Location -> Gradle Settings** and set the Java Version to
17 from the list that appears.

![image](java_version.png)

## Dependencies

Expand Down Expand Up @@ -69,23 +87,32 @@ This is the link to the app designs:
[Light Theme] (https://xd.adobe.com/view/dd5d0245-b92b-4678-9d4a-48b3a6f48191-880e/)
[Dark Theme] (https://xd.adobe.com/view/5ec235b6-c3c6-49a9-b783-1f1303deb1a8-0b91/)

The app uses a design system: Chai
The app uses a design system: Chai

## Dependencies

The project uses [Versions Catalog](https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog) to set up and share dependencies across the modules. The main reasons for choosing to adopt Versions Catalog are:
The project
uses [Versions Catalog](https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog)
to set up and share dependencies across the modules. The main reasons for choosing to adopt Versions
Catalog are:

- Central place to define dependencies.
- Easy syntax.
- Does not compromise on build speeds as changes do not need the module to be compiled.

To add a dependency, navigate to **gradle/libs.versions.toml*** file, which has all the dependencies for the whole project. This file has the following sections:
To add a dependency, navigate to **gradle/libs.versions.toml*** file, which has all the dependencies
for the whole project. This file has the following sections:

[versions] is used to declare the version numbers that will be referenced later by plugins and libraries.
[versions] is used to declare the version numbers that will be referenced later by plugins and
libraries.
[libraries] Define the libraries that will be later accessed in our Gradle files.
[bundles] Are used to define a set of dependencies. For this, we have `compose`, `room`, `lifecycle` and `ktor` as examples.
[bundles] Are used to define a set of dependencies. For this, we have `compose`, `room`, `lifecycle`
and `ktor` as examples.
[plugins] Used to define plugins.

You need to add your dependency version in [versions]. This is unnecessary if you are not sharing the version across different dependencies. After defining the version, add your library in the [libraries] section as:
You need to add your dependency version in [versions]. This is unnecessary if you are not sharing
the version across different dependencies. After defining the version, add your library in
the [libraries] section as:

```toml
compose-activity = "androidx.activity:activity-compose:1.5.0"
Expand All @@ -98,16 +125,23 @@ androidx-splashscreen = { module = "androidx.core:core-splashscreen", version.re
```

**Note**:
- You can use separators such as -, _v, . that will be normalized by Gradle to . in the Catalog and allow you to create subsections.

- You can use separators such as -, _v, . that will be normalized by Gradle to . in the Catalog and
allow you to create subsections.
- Define variables using **CamelCase**.\
- Check if the library can be added to any existing bundles.

## Compatibility

This project uses `coreLibraryDesugaring` to support newer Java 8 APIs that are not available on API levels 25 and below. Specifically the Kotlin `kotlinx.datetime` API which depends on Java's `java.time`.
This allows use of `kotlinx.datetime.LocalDate` without having to wrap it in `@RequiresAPI(Build.VERSION_CODES.O)` and also backports the fix to API level 21.
More on Desugaring using Android Gradle Plugin can be found [here](https://developer.android.com/studio/write/java8-support).
Instructions on how to set up and add `coreLibraryDesugaring` to your project can be found [here](https://developer.android.com/studio/write/java8-support#library-desugaring).
This project uses `coreLibraryDesugaring` to support newer Java 8 APIs that are not available on API
levels 25 and below. Specifically the Kotlin `kotlinx.datetime` API which depends on
Java's `java.time`.
This allows use of `kotlinx.datetime.LocalDate` without having to wrap it
in `@RequiresAPI(Build.VERSION_CODES.O)` and also backports the fix to API level 21.
More on Desugaring using Android Gradle Plugin can be
found [here](https://developer.android.com/studio/write/java8-support).
Instructions on how to set up and add `coreLibraryDesugaring` to your project can be
found [here](https://developer.android.com/studio/write/java8-support#library-desugaring).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion build-logic/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Feb 11 12:19:01 EAT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-rc-2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
buildscript {
dependencies {
classpath("com.google.dagger:hilt-android-gradle-plugin:2.45")
classpath("com.google.gms:google-services:4.3.14")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.2")
classpath("com.google.gms:google-services:4.3.15")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.5")
classpath("com.google.firebase:perf-plugin:1.4.2")
}
}
plugins {
id("com.android.application") version "7.4.1" apply false
id("com.android.library") version "7.4.1" apply false
id("org.jetbrains.kotlin.android") version "1.8.0" apply false
id("com.google.devtools.ksp") version "1.8.0-1.0.9" apply true
id("com.android.application") version "8.0.2" apply false
id("com.android.library") version "8.0.2" apply false
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
id("com.google.devtools.ksp") version "1.8.20-1.0.11" apply true
kotlin("plugin.serialization") version "1.6.21"
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
id("io.gitlab.arturbosch.detekt") version "1.18.0-RC2"
Expand Down
2 changes: 1 addition & 1 deletion chai/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.0"
kotlinCompilerExtensionVersion = "1.4.6"
}
}

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
compose = "1.4.0-beta01"
composecompiler = "1.3.1"
composecompiler = "1.4.6"
coroutines = "1.6.4"
desugar_jdk_libs = "2.0.3"
espresso = "3.5.1"
gradleplugin = "7.4.1"
gradleplugin = "8.0.2"
hilt = "2.45"
kotlin = "1.8.0"
kotlin = "1.8.20"
lifecycle = "2.5.1"
room = "2.5.0"
ktor = "2.2.2"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Feb 11 12:19:01 EAT 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-rc-2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file added java_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.4.0"
kotlinCompilerExtensionVersion = "1.4.6"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ fun HomeScreen(
HomeHeaderSection()
HomeBannerSection(homeViewState)
HomeSpacer()
if (homeViewState.isSessionsSectionVisible){
if (homeViewState.isSessionsSectionVisible) {
HomeSessionSection(
sessions = homeViewState.sessions,
onSessionClick = onSessionClicked,
onViewAllSessionClicked = navigateToSessionScreen
)
HomeSpacer()
}
if (homeViewState.isSpeakersSectionVisible){
if (homeViewState.isSpeakersSectionVisible) {
HomeSpeakersSection(
speakers = homeViewState.speakers,
navigateToSpeakers = navigateToSpeakers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ class SessionsViewModel @Inject constructor(
}
if (it.sessionTypes.isNotEmpty()) {
val items = it.sessionTypes.joinToString(
separator, prefix, postfix
separator,
prefix,
postfix
) { value -> "'${value.lowercase()}'" }
if (stringBuilder.isNotEmpty()) stringBuilder.append(" AND ")
stringBuilder.append("LOWER (sessionFormat) IN $items")
Expand All @@ -218,7 +220,9 @@ class SessionsViewModel @Inject constructor(
}
val where = if (stringBuilder.isNotEmpty()) {
"WHERE $stringBuilder"
} else stringBuilder
} else {
stringBuilder
}
return "SELECT * FROM sessions $where".also { Timber.i("QUERY = $it") }
}

Expand Down