Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
florina-muntenescu authored and nickbutcher committed Mar 12, 2019
1 parent f8f0f75 commit cef5859
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/io/plaidapp/ui/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ class HomeViewModel(
val feed: LiveData<FeedUiModel>
get() = _feed

private val onDataLoadedCallback: OnDataLoadedCallback<List<PlaidItem>> =
object : OnDataLoadedCallback<List<PlaidItem>> {
private val onDataLoadedCallback = object : OnDataLoadedCallback<List<PlaidItem>> {
override fun onDataLoaded(data: List<PlaidItem>) {
val oldItems = _feed.value?.items.orEmpty()
updateFeedData(oldItems, data)
Expand Down Expand Up @@ -100,6 +99,7 @@ class HomeViewModel(
}

// TODO - find a better solution
// https://github.com/nickbutcher/plaid/issues/654
var columns = 2

init {
Expand Down
22 changes: 11 additions & 11 deletions app/src/test/java/io/plaidapp/TestData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ val designerNewsSource = Source.DesignerNewsSearchSource(
true
)
val designerNewsSourceUiModel = SourceUiModel(
designerNewsSource.key,
designerNewsSource.name,
designerNewsSource.active,
designerNewsSource.iconRes,
designerNewsSource.isSwipeDismissable,
{},
{}
key = designerNewsSource.key,
name = designerNewsSource.name,
active = designerNewsSource.active,
iconRes = designerNewsSource.iconRes,
isSwipeDismissable = designerNewsSource.isSwipeDismissable,
onSourceClicked = {},
onSourceDismissed = {}
)
val dribbbleSource = Source.DribbbleSearchSource("dribbble", true)

Expand Down Expand Up @@ -66,8 +66,8 @@ val shot = Shot(
description = "",
images = Images(),
user = player
).also {
it.dataSource = dribbbleSource.key
).apply {
dataSource = dribbbleSource.key
}

const val userId = 5L
Expand All @@ -87,6 +87,6 @@ val story = Story(
createdAt = createdDate,
userId = userId,
links = storyLinks
).also {
it.dataSource = designerNewsSource.key
).apply {
dataSource = designerNewsSource.key
}
2 changes: 1 addition & 1 deletion app/src/test/java/io/plaidapp/ui/HomeViewModelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class HomeViewModelTest {

// When adding a Designer News source
homeViewModel.addSources(
designerNewsSource.query,
query = designerNewsSource.query,
isDribbble = false,
isDesignerNews = true
)
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/io/plaidapp/core/data/DataManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.plaidapp.core.designernews.domain.SearchStoriesUseCase;
import io.plaidapp.core.dribbble.data.ShotsRepository;
import io.plaidapp.core.dribbble.data.api.model.Shot;
import io.plaidapp.core.producthunt.data.api.ProductHuntRepository;
import io.plaidapp.core.producthunt.domain.LoadPostsUseCase;
import io.plaidapp.core.ui.filter.FiltersChangedCallback;
import kotlin.Unit;
Expand Down Expand Up @@ -77,7 +76,7 @@ public void setOnDataLoadedCallback(
}

private void onDataLoaded(List<? extends PlaidItem> data) {
if(onDataLoadedCallback != null) {
if (onDataLoadedCallback != null) {
onDataLoadedCallback.onDataLoaded(data);
}
}
Expand Down

0 comments on commit cef5859

Please sign in to comment.