Skip to content

Commit

Permalink
Minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jcerdenia committed Nov 22, 2020
1 parent 98ec402 commit 67f883d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MainActivity : AppCompatActivity(),
val feedId = intent?.getStringExtra(EXTRA_FEED_ID)
?: NiceFeedPreferences.getLastViewedFeedId(this)
val entryId = intent?.getStringExtra(EXTRA_ENTRY_ID)
val mainFragment = EntryListFragment.newInstance(feedId, entryId)
val mainFragment = EntryListFragment.newInstance(feedId, entryId, entryId != null)
loadFragments(mainFragment, FeedListFragment.newInstance())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class ManageFeedsFragment: VisibleFragment(),

setOnChangeListener(object : SpeedDialView.OnChangeListener {
override fun onToggleChanged(isOpen: Boolean) { } // Blank on purpose

override fun onMainActionSelected(): Boolean {
resetSelection()
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ class SettingsFragment: VisibleFragment(), AboutFragment.Callback {
}
}

override fun onNothingSelected(parent: AdapterView<*>?) {
// Do nothing
}
override fun onNothingSelected(parent: AdapterView<*>?) { } // Do nothing
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ class EntryListViewModel: ViewModel(), UpdateManager.UpdateReceiver {
}

fun submitQuery(query: String) {
this.query = query
this.query = query.trim()
sourceEntriesLiveData.value?.let { source ->
val filteredEntries = filterEntries(source, filter)
entriesLiveData.value = if (query.isNotEmpty()) {
queryEntries(filteredEntries, query)
entriesLiveData.value = if (this.query.isNotEmpty()) {
queryEntries(filteredEntries, this.query)
} else filteredEntries
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ManageFeedsViewModel: ViewModel() {
}

private fun setObservableFeeds(feeds: List<FeedManageable>) {
val feedsQueried = queryFeeds(feeds, query)
val feedsQueried = queryFeeds(feeds, query.toLowerCase(Locale.ROOT))
feedsManageableLiveData.value = sortFeeds(feedsQueried, order)
}

Expand All @@ -65,7 +65,7 @@ class ManageFeedsViewModel: ViewModel() {
}

fun submitQuery(query: String) {
this.query = query.toLowerCase(Locale.ROOT).trim()
this.query = query.trim()
sourceFeedsLiveData.value?.let { setObservableFeeds(it) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class SearchFeedsViewModel: FeedAddingViewModel() {
}

fun performSearch(query: String) {
mutableQuery.value = query
mutableQuery.value = query.trim()
}
}

0 comments on commit 67f883d

Please sign in to comment.