Skip to content

Feature/dependencies updates #85

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .github/workflows/Android-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- name: Checkout current repository in macos' file system
uses: actions/checkout@v2
- name: Setup JDK 11
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle

Expand All @@ -42,10 +42,10 @@ jobs:
- build-and-test
steps:
- uses: actions/checkout@v2
- name: Setup JDK 11
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle

Expand Down
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

10 changes: 10 additions & 0 deletions .idea/deploymentTargetDropDown.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/gradle.xml

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

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

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

3 changes: 1 addition & 2 deletions .idea/misc.xml

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

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
![GitHub forks](https://img.shields.io/github/forks/avidraghav/MyNotes?style=social)
![Twitter Follow](https://img.shields.io/twitter/follow/avidRaghav?label=Follow&style=social)

[![Hactoberfest 2022](https://img.shields.io/badge/-HACKTOBERFEST--ACCEPTED-brightgreen)](https://hacktoberfest.com/participation/)
[![Hacktoberfest 2022](https://img.shields.io/badge/-HACKTOBERFEST--ACCEPTED-brightgreen)](https://hacktoberfest.com/participation/)
[![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23515-blue)](https://androidweekly.net/issues/issue-515)
[![Contributions Highly Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/avidraghav/MyNotes/issues)
[![Availble issues to contribute](https://img.shields.io/github/issues/avidRaghav/MyNotes?style=social)](https://github.com/avidraghav/MyNotes/issues)
[![Available issues to contribute](https://img.shields.io/github/issues/avidRaghav/MyNotes?style=social)](https://github.com/avidraghav/MyNotes/issues)



Expand All @@ -31,8 +31,8 @@ I highly recommend to start with Manual Dependency injection method and then mov
- [Flow](https://kotlinlang.org/docs/reference/coroutines/flow.html) - In the simplest of ways consider this as a pipe through which the data flows in the app, by using flow
a developer doesn't need to refresh variables which contain data.
- [LiveData](https://developer.android.com/topic/libraries/architecture/livedata) - Used to observe the data on the UI layer
- [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) - To Store UI-related data that isnt destroyed on UI changes.
- [RecylerView](https://developer.android.com/guide/topics/ui/layout/recyclerview) - To Display data in a list format.
- [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) - To Store UI-related data that isn't destroyed on UI changes.
- [RecyclerView](https://developer.android.com/guide/topics/ui/layout/recyclerview) - To Display data in a list format.
- [Hilt](https://developer.android.com/training/dependency-injection/hilt-android) - For Dependency Injection
- [Datastore](https://developer.android.com/topic/libraries/architecture/datastore) - For Storing Data

Expand All @@ -49,15 +49,15 @@ I highly recommend to start with Manual Dependency injection method and then mov

<img width="658" alt="Screenshot 2022-01-18 at 1 31 48 PM" src="https://user-images.githubusercontent.com/49483235/149895306-79dd64bb-7629-42f3-97dd-1796f4a65b40.png">

## 🦸‍♂️ Contribtors
## 🦸‍♂️ Contributors

<a href="https://github.com/avidraghav/MyNotes/graphs/contributors">
<img src="https://contrib.rocks/image?repo=avidraghav/MyNotes" />
</a>

Made with [contrib.rocks](https://contrib.rocks).

# This project is made for educational purposes so don't be shy of asking any questions about any concept from the app or about android developement.
# This project is made for educational purposes so don't be shy of asking any questions about any concept from the app or about android development.
Do open <a href ="https://github.com/avidraghav/MVVM-TodoApp/issues" target="_blank">issues</a>
and raise PRs to I'll try my best to assist you. If this project helps you then do leave a 🌟 :smiley:

Expand Down
55 changes: 27 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ plugins {
id 'com.android.application'
id 'kotlin-android'
id "androidx.navigation.safeargs.kotlin"
id 'kotlin-kapt'
id 'kotlin-parcelize'
// hilt plugin
id 'dagger.hilt.android.plugin'
id 'dagger.hilt.android.plugin' // hilt plugin
id 'kotlin-kapt'
}

android {
Expand Down Expand Up @@ -39,11 +38,11 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}
buildFeatures{
viewBinding true
Expand All @@ -58,42 +57,42 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation "androidx.activity:activity-ktx:1.6.0"
implementation "androidx.fragment:fragment-ktx:1.5.3"
implementation "androidx.activity:activity-ktx:1.7.2"
implementation "androidx.fragment:fragment-ktx:1.6.0"

def lottieVersion = "3.4.0"
implementation "com.airbnb.android:lottie:$lottieVersion"

//Room
implementation "androidx.room:room-runtime:2.4.3"
kapt "androidx.room:room-compiler:2.4.3"
implementation("androidx.room:room-ktx:2.4.3")
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation("androidx.room:room-ktx:$room_version")

// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

// Coroutine Lifecycle Scopes
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"

//Navigation Components
implementation "androidx.navigation:navigation-fragment-ktx:2.5.2"
implementation "androidx.navigation:navigation-ui-ktx:2.5.2"
implementation "androidx.navigation:navigation-fragment-ktx:2.6.0"
implementation "androidx.navigation:navigation-ui-ktx:2.6.0"

//Dagger-Hilt Dependencies
implementation 'com.google.dagger:hilt-android:2.42'
kapt 'com.google.dagger:hilt-android-compiler:2.42'
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"

//room-testing
androidTestImplementation("androidx.room:room-testing:2.4.3")
androidTestImplementation("androidx.room:room-testing:$room_version")

//Library for making assertions in Test Cases
androidTestImplementation "com.google.truth:truth:1.1.3"
Expand All @@ -115,10 +114,10 @@ dependencies {
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"

// AndroidX
androidTestImplementation "androidx.test:core-ktx:1.4.0"
testImplementation "androidx.arch.core:core-testing:2.1.0"
androidTestImplementation "androidx.test.ext:junit-ktx:1.1.3"
testImplementation "androidx.test.ext:junit-ktx:1.1.3"
androidTestImplementation "androidx.test:core-ktx:1.5.0"
testImplementation "androidx.arch.core:core-testing:2.2.0"
androidTestImplementation "androidx.test.ext:junit-ktx:1.1.5"
testImplementation "androidx.test.ext:junit-ktx:1.1.5"
androidTestImplementation 'org.robolectric:robolectric:4.6'
testImplementation 'org.robolectric:robolectric:4.6'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object MigrationUtil {
migrationTestHelper: MigrationTestHelper,
databaseClass: Class<TasksDatabase>,
databaseName: String,
vararg migrations: Migration?
vararg migrations: Migration
): RoomDatabase {
val roomDatabase: RoomDatabase = Room.databaseBuilder(
ApplicationProvider.getApplicationContext(),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/raghav/mynotes/db/TasksDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.raghav.mynotes.db
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.OnConflictStrategy.Companion.REPLACE
import androidx.room.Query
import com.raghav.mynotes.models.TaskEntity
import kotlinx.coroutines.flow.Flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ fun <T> LiveData<T>.getOrAwaitValueTest(
var data: T? = null
val latch = CountDownLatch(1)
val observer = object : Observer<T> {
override fun onChanged(o: T?) {
data = o
override fun onChanged(value: T) {
data = value
latch.countDown()
[email protected](this)
}
Expand Down
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.8.20'
ext.hilt_version = '2.46.1'
ext.room_version = '2.5.1'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.2"
// hilt-android-gradle-plugin
classpath "com.google.dagger:hilt-android-gradle-plugin:2.42"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"


// NOTE: Do not place your application dependencies here; they belong
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
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 @@
#Thu Jan 06 16:04:56 IST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME