Skip to content

Commit b95b27a

Browse files
committed
Library version updated and compile issue fixed
1 parent fb24c25 commit b95b27a

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

app/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ android {
3030

3131
dependencies {
3232
implementation fileTree(dir: 'libs', include: ['*.jar'])
33-
implementation 'androidx.appcompat:appcompat:1.1.0'
34-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
35-
testImplementation 'junit:junit:4.13'
36-
androidTestImplementation 'androidx.test:runner:1.2.0'
37-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
38-
implementation "androidx.core:core-ktx:1.3.0"
33+
implementation 'androidx.appcompat:appcompat:1.6.0'
34+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
35+
testImplementation 'junit:junit:4.13.2'
36+
androidTestImplementation 'androidx.test:runner:1.5.2'
37+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
38+
implementation "androidx.core:core-ktx:1.9.0"
3939
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
4040

4141
// material design
42-
implementation 'com.google.android.material:material:1.2.0-alpha06'
42+
implementation 'com.google.android.material:material:1.6.0'
4343

4444
// network call related libraries
45-
implementation 'com.squareup.retrofit2:retrofit:2.7.2' // REST API calling library
46-
implementation 'com.squareup.retrofit2:converter-gson:2.7.2' // JSON parsing library
47-
implementation('com.github.ihsanbal:LoggingInterceptor:3.0.0') { // HTTP pretty log printing library
45+
implementation 'com.squareup.retrofit2:retrofit:2.9.0' // REST API calling library
46+
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' // JSON parsing library
47+
implementation('com.github.ihsanbal:LoggingInterceptor:3.1.0') { // HTTP pretty log printing library
4848
exclude group: 'org.json', module: 'json'
4949
}
5050

5151
// glide image loading library
52-
implementation 'com.github.bumptech.glide:glide:4.11.0'
52+
implementation 'com.github.bumptech.glide:glide:4.13.2'
5353
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
5454
}
5555

app/src/main/java/com/hellohasan/weatherforecast/network/QueryParameterAddInterceptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class QueryParameterAddInterceptor : Interceptor {
88

99
override fun intercept(chain: Interceptor.Chain): Response {
1010

11-
val url = chain.request().url().newBuilder()
11+
val url = chain.request().url.newBuilder()
1212
.addQueryParameter("appid", BuildConfig.APP_ID)
1313
.build()
1414

app/src/main/java/com/hellohasan/weatherforecast/network/RetrofitClient.kt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import okhttp3.OkHttpClient
88
import okhttp3.internal.platform.Platform
99
import retrofit2.Retrofit
1010
import retrofit2.converter.gson.GsonConverterFactory
11-
import java.util.concurrent.Executors
1211

1312
object RetrofitClient {
1413

@@ -22,26 +21,26 @@ object RetrofitClient {
2221
if (retrofit == null) {
2322

2423
val httpClient = OkHttpClient.Builder()
25-
.addInterceptor(QueryParameterAddInterceptor())
24+
.addInterceptor(QueryParameterAddInterceptor())
2625

2726
// for pretty log of HTTP request-response
2827
httpClient.addInterceptor(
29-
LoggingInterceptor.Builder()
30-
.loggable(BuildConfig.DEBUG)
31-
.setLevel(Level.BASIC)
32-
.log(Platform.INFO)
33-
.request("LOG")
34-
.response("LOG")
35-
.executor(Executors.newSingleThreadExecutor())
36-
.build())
28+
LoggingInterceptor.Builder()
29+
.setLevel(Level.BASIC)
30+
.setLevel(Level.BASIC)
31+
.log(Platform.INFO)
32+
.request("LOG")
33+
.response("LOG")
34+
.build()
35+
)
3736

3837
val client = httpClient.build()
3938

4039
retrofit = Retrofit.Builder()
41-
.baseUrl(BuildConfig.BASE_URL)
42-
.addConverterFactory(GsonConverterFactory.create(gson))
43-
.client(client)
44-
.build()
40+
.baseUrl(BuildConfig.BASE_URL)
41+
.addConverterFactory(GsonConverterFactory.create(gson))
42+
.client(client)
43+
.build()
4544
}
4645
}
4746

0 commit comments

Comments
 (0)