Skip to content

Commit

Permalink
some renameing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Martinovic committed Jan 2, 2019
1 parent 077eeed commit 47062fa
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RecyclerView Demo
# JackItemAnimator


## License

```
Copyright 2017 Ivan Martinovic
Copyright 2018 Ivan Martinovic
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".RvdApplication"
android:name=".SampleApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand All @@ -20,8 +20,7 @@
</intent-filter>
</activity>
<activity
android:name=".taxilist.presentation.TaxiListActivity"
android:label="@string/recycler_view_demo_full_label" />
android:name=".taxilist.presentation.TaxiListActivity" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

fullDemoButton.setOnClickListener {
taxiListButton.setOnClickListener {
startActivity(TaxiListActivity.createIntent(this))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.app.Application
import com.squareup.leakcanary.LeakCanary
import timber.log.Timber

class RvdApplication : Application() {
class SampleApplication : Application() {

lateinit var rvdApplicationComponent: RvdApplicationComponent
lateinit var sampleApplicationComponent: SampleApplicationComponent

override fun onCreate() {
super.onCreate()
Expand All @@ -20,8 +20,8 @@ class RvdApplication : Application() {
}
LeakCanary.install(this)

rvdApplicationComponent = DaggerRvdApplicationComponent.builder()
sampleApplicationComponent = DaggerSampleApplicationComponent.builder()
.build()
rvdApplicationComponent.inject(this)
sampleApplicationComponent.inject(this)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import javax.inject.Singleton

@Singleton
@Component(
modules = [(RvdApplicationModule::class)]
modules = [(SampleApplicationModule::class)]
)
interface RvdApplicationComponent {
interface SampleApplicationComponent {

fun inject(rvdApplication: RvdApplication)
fun inject(sampleApplication: SampleApplication)

fun newTaxiListComponent(taxiListModule: TaxiListModule): TaxiListComponent
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ import dagger.Provides
import javax.inject.Singleton

@Module
class RvdApplicationModule(private val rvdApplication: RvdApplication) {
class SampleApplicationModule(
private val sampleApplication: SampleApplication
) {

@Provides
@Singleton
fun rvdApplication(): RvdApplication {
return rvdApplication
fun sampleApplication(): SampleApplication {
return sampleApplication
}

@Provides
@Singleton
fun context(): Context {
return rvdApplication
return sampleApplication
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.johnnym.jackitemanimator.sample.common

import android.app.Activity
import com.johnnym.jackitemanimator.sample.RvdApplication
import com.johnnym.jackitemanimator.sample.SampleApplication

val Activity.rvdApplication: RvdApplication
get() = application as RvdApplication
val Activity.sampleApplication: SampleApplication
get() = application as SampleApplication
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import com.johnnym.jackitemanimator.sample.R
import com.johnnym.jackitemanimator.sample.common.rvdApplication
import com.johnnym.jackitemanimator.sample.common.sampleApplication
import com.johnnym.jackitemanimator.sample.taxilist.TaxiListModule
import com.johnnym.jackitemanimator.sample.taxilist.domain.TaxiStatusFilter
import com.johnnym.jackitemanimator.sample.taxilist.presentation.taxilist.CustomJackItemAnimator
Expand Down Expand Up @@ -101,7 +101,7 @@ class TaxiListActivity : AppCompatActivity(),
}
itemAnimatorSpinner.setSelection(1)

rvdApplication.rvdApplicationComponent
sampleApplication.sampleApplicationComponent
.newTaxiListComponent(TaxiListModule(
this,
initialTaxiStatusFilter,
Expand Down
7 changes: 4 additions & 3 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
tools:context=".MainActivity">

<Button
android:id="@+id/fullDemoButton"
android:layout_width="@dimen/main_demo_button_width"
android:id="@+id/taxiListButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/recycler_view_demo_full_label"
android:layout_margin="16dp"
android:text="@string/taxi_list_label"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
Expand Down
2 changes: 0 additions & 2 deletions sample/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<dimen name="main_demo_button_width">240dp</dimen>

<dimen name="taxi_list_item_decoration_spacing">6dp</dimen>

</resources>
5 changes: 2 additions & 3 deletions sample/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<resources>

<!-- Main demo screen -->
<string name="app_name">RecyclerView Demo</string>
<string name="recycler_view_demo_full_label">RecyclerView Full Demo</string>
<string name="app_name">JackItemAnimator</string>
<string name="taxi_list_label">Taxi List</string>

<!-- Taxi list screen -->
<string name="sort_menu_item">Sort</string>
Expand Down

0 comments on commit 47062fa

Please sign in to comment.