Skip to content

Commit

Permalink
First Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ebdulrehmandemya committed Jul 5, 2019
1 parent d93065f commit dac9cc6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MainActivity : AppCompatActivity(), OnManageListener, onDeleteItemListener
setContentView(R.layout.activity_main)
setSupportActionBar(toolbar)

fab.setOnClickListener { view ->
fab.setOnClickListener { _ ->
dlv.addItem(createRandomItem(), 0)
dlv.scrollToPosition(0)
}
Expand Down
11 changes: 7 additions & 4 deletions linearview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ android {
compileSdkVersion 29
buildToolsVersion "29.0.0"


defaultConfig {
minSdkVersion 15
targetSdkVersion 29
versionCode 5
versionName "LAUNCH-12"
versionCode 6
versionName "LAUNCH-13"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -23,6 +22,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility = '1.8'
sourceCompatibility = '1.8'
}

}

Expand All @@ -34,7 +37,7 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.core:core-ktx:1.0.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ internal class ItemAdapter(val dlv: LinearView) : RecyclerView.Adapter<ItemAdapt
notifyDataSetChanged()
}

@JvmOverloads
fun add(item: Item, index: Int? = null) {
addAll(listOf(item), index)
}

@JvmOverloads
fun addAll(items: Collection<Item>, index: Int? = null) {
val pos: Int = if (index != null && index >= 0) index else this.items.size
this.items.addAll(pos, items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ class LinearView : FrameLayout {

fun recyclerView() = rv

@JvmOverloads
fun addItem(item: Item, index: Int? = null) {
addItems(listOf(item), index)
}

@JvmOverloads
fun addItems(items: Collection<Item>, index: Int? = null) {
if (isLoading) hideLoading()
ia.addAll(items, index)
Expand Down

0 comments on commit dac9cc6

Please sign in to comment.