Skip to content

Commit

Permalink
some optimisation and migrate to kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
GOVINDDIXIT committed Nov 15, 2020
1 parent 534bbb8 commit 507f983
Show file tree
Hide file tree
Showing 57 changed files with 1,088 additions and 1,683 deletions.
13 changes: 8 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
Expand Down Expand Up @@ -100,10 +103,10 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

//shimmer effect

implementation 'com.facebook.shimmer:shimmer:0.5.0'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
// navigations
def navigationVersion = "2.3.0"
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
}
34 changes: 0 additions & 34 deletions app/src/main/java/govind/iiitl/app/BloggerAPI.java

This file was deleted.

30 changes: 30 additions & 0 deletions app/src/main/java/govind/iiitl/app/BloggerAPI.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package govind.iiitl.app

import govind.iiitl.app.models.PostList
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.GET

internal object BloggerAPI {
private const val key = "AIzaSyBpfJGq4L8xoKsue_jhXHtWLYlvwcMoREs"
private const val url = "https://www.googleapis.com/blogger/v3/blogs/5429117628766351084/posts/"
private var postService: PostService? = null
@JvmStatic
val service: PostService?
get() {
if (postService == null) {
val retrofit = Retrofit.Builder()
.baseUrl(url)
.addConverterFactory(GsonConverterFactory.create())
.build()
postService = retrofit.create(PostService::class.java)
}
return postService
}

interface PostService {
@get:GET("?key=$key")
val postList: Call<PostList?>?
}
}
212 changes: 0 additions & 212 deletions app/src/main/java/govind/iiitl/app/MainActivity.java

This file was deleted.

Loading

0 comments on commit 507f983

Please sign in to comment.