Skip to content

Commit

Permalink
Merge branch 'develop' into feature/view-search
Browse files Browse the repository at this point in the history
  • Loading branch information
yeseoRyu authored Dec 26, 2024
2 parents cf349c2 + eae3337 commit b36fdd3
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {
implementation(libs.timber)



implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
Expand All @@ -74,11 +75,11 @@ kapt {
correctErrorTypes = true
useBuildCache = false
showProcessorStats = true

arguments {
arg("dagger.hilt.android.internal.disableAndroidSuperclassValidation", "true")
}
}
hilt {
enableAggregatingTask = false
}

14 changes: 12 additions & 2 deletions app/src/main/java/com/flab/deepsleep/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@ class MainActivity : AppCompatActivity() {
enableEdgeToEdge()
setContentView(R.layout.activity_main)

val textView: TextView = findViewById(R.id.textView)
textView.text = testString

ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
val imageView: ImageView = findViewById(R.id.testImageView)

photoViewModel.getARandomPhoto(1)
photoViewModel.randomphotoUrl.observe(this, Observer {
val imageUrl = it

Glide.with(this)
.load(imageUrl)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(imageView)
})

val imageView: ImageView = findViewById(R.id.testImageView)
val editText: EditText = findViewById(R.id.editText)
Expand All @@ -58,4 +67,5 @@ class MainActivity : AppCompatActivity() {
})

}

}
4 changes: 1 addition & 3 deletions app/src/main/java/com/flab/deepsleep/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import timber.log.Timber.*


@HiltAndroidApp
<<<<<<< HEAD
class MainApplication: Application(){

override fun onCreate() {
Expand All @@ -19,7 +18,6 @@ class MainApplication: Application(){
}
}
}
=======

class MainApplication: Application()

>>>>>>> 398d5faf609e2a127856abd79995f15b5c86853c
20 changes: 20 additions & 0 deletions app/src/main/java/com/flab/deepsleep/data/entity/photo/Exif.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.flab.deepsleep.data.entity.photo

import com.google.gson.annotations.SerializedName

data class Exif(
@SerializedName("aperture")
val aperture: String?,
@SerializedName("exposure_time")
val exposureTime: String?,
@SerializedName("focal_length")
val focalLength: String?,
@SerializedName("iso")
val iso: Int?,
@SerializedName("make")
val make: String?,
@SerializedName("model")
val model: String?,
@SerializedName("name")
val name: String?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.flab.deepsleep.data.entity.photo

import com.google.gson.annotations.SerializedName

data class RandomPhoto(
@SerializedName("blur_hash")
val blurHash: String?,
@SerializedName("color")
val color: String?,
@SerializedName("created_at")
val createdAt: String?,
@SerializedName("description")
val description: String?,
@SerializedName("downloads")
val downloads: Int?,
@SerializedName("height")
val height: Int?,
@SerializedName("id")
val id: String?,
@SerializedName("liked_by_user")
val likedByUser: Boolean?,
@SerializedName("likes")
val likes: Int?,
@SerializedName("public_domain")
val publicDomain: Boolean?,
@SerializedName("updated_at")
val updatedAt: String?,
@SerializedName("width")
val width: Int?,
@SerializedName("exif")
val exif: Exif?,
@SerializedName("urls")
val urls: Urls?,
@SerializedName("user")
val user: User?
)
16 changes: 16 additions & 0 deletions app/src/main/java/com/flab/deepsleep/data/entity/photo/Urls.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.flab.deepsleep.data.entity.photo

import com.google.gson.annotations.SerializedName

data class Urls(
@SerializedName("full")
val full: String?,
@SerializedName("raw")
val raw: String?,
@SerializedName("regular")
val regular: String?,
@SerializedName("small")
val small: String?,
@SerializedName("thumb")
val thumb: String?
)
26 changes: 26 additions & 0 deletions app/src/main/java/com/flab/deepsleep/data/entity/photo/User.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.flab.deepsleep.data.entity.photo

import com.google.gson.annotations.SerializedName

data class User(
@SerializedName("bio")
val bio: String?,
@SerializedName("id")
val id: String?,
@SerializedName("location")
val location: String?,
@SerializedName("name")
val name: String?,
@SerializedName("portfolio_url")
val portfolioUrl: String?,
@SerializedName("total_collections")
val totalCollections: Int?,
@SerializedName("total_likes")
val totalLikes: Int?,
@SerializedName("total_photos")
val totalPhotos: Int?,
@SerializedName("updated_at")
val updatedAt: String?,
@SerializedName("username")
val username: String?
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ class PhotoViewModel @Inject constructor(private val unplashRepositoryImpl: Unpl
}
}

}
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
agp = "8.7.3"
artifactid = "version"
gson = "2.11.0"

hiltAndroidCompiler = "2.51.1"
kotlin = "1.9.24"
coreKtx = "1.15.0"
Expand Down Expand Up @@ -40,6 +39,7 @@ androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "viewmodel" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "runtime" }
androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "livedata" }

androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
Expand All @@ -57,4 +57,3 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }



0 comments on commit b36fdd3

Please sign in to comment.