Skip to content

Commit

Permalink
new builds
Browse files Browse the repository at this point in the history
  • Loading branch information
thedroiddiv committed Jul 13, 2022
1 parent adac1c1 commit 84206fc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added app/.DS_Store
Binary file not shown.
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
minSdk 24
targetSdk 31
versionCode 7
versionName "1.0.7"
versionName "1.0.8"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -63,10 +63,10 @@ dependencies {
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"

// Compose dependencies
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0"
implementation "androidx.navigation:navigation-compose:2.4.0-SNAPSHOT"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.0"
implementation "androidx.navigation:navigation-compose:2.5.0"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.hilt:hilt-navigation-compose:1.0.0-beta01"
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"

def accompanist_version = '0.20.2'
implementation "com.google.accompanist:accompanist-navigation-animation:$accompanist_version"
Expand All @@ -77,8 +77,8 @@ dependencies {
implementation "com.google.accompanist:accompanist-insets:$accompanist_version"

// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2'

//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.38.1"
Expand All @@ -87,11 +87,11 @@ dependencies {
kapt "androidx.hilt:hilt-compiler:1.0.0"

// Room
implementation "androidx.room:room-runtime:2.3.0"
kapt "androidx.room:room-compiler:2.3.0"
implementation "androidx.room:room-runtime:2.4.2"
kapt "androidx.room:room-compiler:2.4.2"

// Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:2.3.0"
implementation "androidx.room:room-ktx:2.4.2"

// Coil
implementation "io.coil-kt:coil-compose:1.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.dxn.wallpaperx.common.helpers

import android.content.Context
import androidx.annotation.StringRes
import com.dxn.wallpaperx.R
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
import javax.inject.Singleton
Expand All @@ -13,4 +14,6 @@ class ResourcesProvider @Inject constructor(
fun getString(@StringRes stringResId: Int): String {
return context.getString(stringResId)
}

val unsplashApiKey get() = context.getString(R.string.unsplash_api_key)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.dxn.wallpaperx.data.remote.unsplash

import com.dxn.wallpaperx.R
import com.dxn.wallpaperx.common.helpers.ResourcesProvider
import com.dxn.wallpaperx.data.remote.RemoteRepository
import com.dxn.wallpaperx.data.remote.unsplash.models.collection.CollectionDto
Expand All @@ -13,14 +12,11 @@ class UnsplashRepository(
private val resourcesProvider: ResourcesProvider
) : RemoteRepository {

private val apikey = resourcesProvider.getString(R.string.unsplash_api_key)


override suspend fun getWallpapers(page: Int, query: String): List<Wallpaper> {
return unsplashApi.getImages(
query = query,
page = page,
apikey = resourcesProvider.getString(R.string.unsplash_api_key)
apikey = resourcesProvider.unsplashApiKey
).results.map { imageDtoToWallpaper(it) }
}

Expand All @@ -29,13 +25,13 @@ class UnsplashRepository(
}

override suspend fun getCollections(page: Int): List<Collection> =
unsplashApi.getCollection(page, apikey = apikey).map { collectionDtoToCollection(it) }
unsplashApi.getCollection(page, apikey = resourcesProvider.unsplashApiKey).map { collectionDtoToCollection(it) }

override suspend fun getWallpapersByCollection(
collectionId: String,
page: Int
): List<Wallpaper> =
unsplashApi.getPhotosByCollection(collectionId, page, apikey = apikey)
unsplashApi.getPhotosByCollection(collectionId, page, apikey = resourcesProvider.unsplashApiKey)
.map { imageDtoToWallpaper(it) }
}

Expand Down
Binary file added assets/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Sat Oct 23 22:59:00 IST 2021
sdk.dir=/home/divyansh/Android/Sdk
#Wed Jul 13 19:59:53 IST 2022
sdk.dir=/Users/divyansh/Library/Android/sdk

0 comments on commit 84206fc

Please sign in to comment.