Skip to content

Commit

Permalink
Merge pull request #1 from bmarty/master
Browse files Browse the repository at this point in the history
Upgrade the dependencies and do some cleanup
BillCarsonFr authored Mar 11, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 52ecd76 + 4d8b103 commit fc197ce
Showing 15 changed files with 59 additions and 56 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -17,14 +17,14 @@ Add this in your root build.gradle at the end of repositories:
````

````
implementation 'com.github.BillCarsonFr:JsonViewer:0.3'
implementation 'com.github.BillCarsonFr:JsonViewer:0.6'
````

This library depends on epoxy
````
implementation("com.airbnb.android:epoxy:$epoxy_version")
kapt "com.airbnb.android:epoxy-processor:$epoxy_version"
implementation 'com.airbnb.android:mvrx:1.3.0'
implementation 'com.airbnb.android:mvrx:1.5.1'
````


34 changes: 20 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

//TO ADD IN YOUR PROJECT
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
compileSdkVersion 30

defaultConfig {
applicationId "org.billcarsonfr.jsonviewerexample"
minSdkVersion 19
targetSdkVersion 29
targetSdkVersion 30
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.multidex:multidex:2.0.1'


@@ -42,11 +48,11 @@ dependencies {
implementation("com.airbnb.android:epoxy:$epoxy_version")
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
kapt "com.airbnb.android:epoxy-processor:$epoxy_version"
implementation 'com.airbnb.android:mvrx:1.3.0'
implementation 'com.airbnb.android:mvrx:1.5.1'
// ============

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation project(path: ':jsonviewer')
}
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.50'
ext.epoxy_version = '3.9.0'
ext.kotlin_version = '1.4.31'
ext.epoxy_version = '4.4.2'
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.jakewharton:butterknife-gradle-plugin:10.1.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
}

}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Feb 08 10:40:46 CET 2020
#Thu Mar 11 11:49:45 CET 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
37 changes: 21 additions & 16 deletions jsonviewer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.jakewharton.butterknife'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

compileSdkVersion 30

defaultConfig {
minSdkVersion 19
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"

@@ -26,27 +24,34 @@ android {
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'

// Epoxy dependency
implementation("com.airbnb.android:epoxy:$epoxy_version")
implementation "com.airbnb.android:epoxy:$epoxy_version"
kapt "com.airbnb.android:epoxy-processor:$epoxy_version"
implementation 'com.airbnb.android:mvrx:1.3.0'
implementation 'com.airbnb.android:mvrx:1.5.1'
// Span utils
implementation 'me.gujun.android:span:1.7'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'com.google.android.material:material:1.4.0-alpha01'

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2"

testImplementation 'org.json:json:20190722'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
3 changes: 1 addition & 2 deletions jsonviewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.billcarsonfr.jsonviewer" />
<manifest package="org.billcarsonfr.jsonviewer" />
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import com.airbnb.mvrx.BaseMvRxFragment
import com.airbnb.mvrx.MvRx
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class JSonViewerFragmentArgs(
@@ -24,13 +24,13 @@ data class JSonViewerFragmentArgs(

class JSonViewerFragment : BaseMvRxFragment() {

val viewModel: JSonViewerViewModel by fragmentViewModel(JSonViewerViewModel::class)
private val viewModel: JSonViewerViewModel by fragmentViewModel(JSonViewerViewModel::class)

val epoxyController by lazy {
private val epoxyController by lazy {
JSonViewerEpoxyController(requireContext())
}

lateinit var recyclerView: EpoxyRecyclerView
private lateinit var recyclerView: EpoxyRecyclerView

override fun onCreateView(
inflater: LayoutInflater,
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@ class JSonViewerArray(key: String?, index: Int?, jObject: JSONArray) :
var items = ArrayList<JSonViewerModel>()

override fun addChild(model: JSonViewerModel) {
val index = items.size
items.add(model)
}
}
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import android.content.Context
import android.os.Parcelable
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class JSonViewerStyleProvider(
Original file line number Diff line number Diff line change
@@ -50,6 +50,5 @@ class JSonViewerViewModel(initialState: JSonViewerState) :
}

}

}
}
Original file line number Diff line number Diff line change
@@ -76,5 +76,4 @@ abstract class ValueItem : EpoxyModelWithHolder<ValueItem.Holder>() {
}
}
}

}
3 changes: 1 addition & 2 deletions jsonviewer/src/main/res/layout/fragment_jv_recycler_view.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
android:fillViewport="true"
android:orientation="vertical">

<com.airbnb.epoxy.EpoxyRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
<com.airbnb.epoxy.EpoxyRecyclerView
android:id="@+id/jvRecyclerView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -15,5 +15,4 @@
tools:itemCount="5"
tools:listitem="@layout/item_jv_base_value" />


</HorizontalScrollView>
Original file line number Diff line number Diff line change
@@ -9,4 +9,3 @@
android:scrollbars="vertical"
tools:itemCount="5"
tools:listitem="@layout/item_jv_base_value" />

7 changes: 2 additions & 5 deletions jsonviewer/src/main/res/menu/jv_menu_item.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:id="@+id/copy_value"
android:title="@string/copy_value"
tools:visible="true" />

android:title="@string/copy_value" />

</menu>
1 change: 1 addition & 0 deletions jsonviewer/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="key_color">#FF006700</color>
<color name="string_color">#FF040091</color>
<color name="bool_color">#FF980000</color>

0 comments on commit fc197ce

Please sign in to comment.