1
0
Fork 0

Fix ktlint MaxLineLength issues.

master
Sebastian Kaspari 2019-08-30 15:50:02 +02:00 committed by Jeff Boek
parent 38d97fda8b
commit ba05d21657
5 changed files with 33 additions and 9 deletions

View File

@ -50,8 +50,8 @@ sealed class QuickActionSheetAction : BrowserFragmentAction() {
/** /**
* Reducers for [BrowserFragmentStore]. * Reducers for [BrowserFragmentStore].
* *
* A top level reducer that receives the current [BrowserFragmentState] and an [Action] and then delegates to the proper child * A top level reducer that receives the current [BrowserFragmentState] and an [Action] and then
* * delegates to the proper child
*/ */
private fun browserStateReducer( private fun browserStateReducer(
state: BrowserFragmentState, state: BrowserFragmentState,

View File

@ -36,7 +36,10 @@ data class ExceptionsFragmentState(val items: List<ExceptionsItem>) : State
/** /**
* The ExceptionsState Reducer. * The ExceptionsState Reducer.
*/ */
private fun exceptionsStateReducer(state: ExceptionsFragmentState, action: ExceptionsFragmentAction): ExceptionsFragmentState { private fun exceptionsStateReducer(
state: ExceptionsFragmentState,
action: ExceptionsFragmentAction
): ExceptionsFragmentState {
return when (action) { return when (action) {
is ExceptionsFragmentAction.Change -> state.copy(items = action.list) is ExceptionsFragmentAction.Change -> state.copy(items = action.list)
} }

View File

@ -45,13 +45,20 @@ sealed class BookmarkFragmentAction : Action {
* @param action the action to perform * @param action the action to perform
* @return the new bookmarks state * @return the new bookmarks state
*/ */
private fun bookmarkFragmentStateReducer(state: BookmarkFragmentState, action: BookmarkFragmentAction): BookmarkFragmentState { private fun bookmarkFragmentStateReducer(
state: BookmarkFragmentState,
action: BookmarkFragmentAction
): BookmarkFragmentState {
return when (action) { return when (action) {
is BookmarkFragmentAction.Change -> { is BookmarkFragmentAction.Change -> {
val items = state.mode.selectedItems.filter { it in action.tree } val items = state.mode.selectedItems.filter { it in action.tree }
state.copy( state.copy(
tree = action.tree, tree = action.tree,
mode = if (items.isEmpty()) BookmarkFragmentState.Mode.Normal else BookmarkFragmentState.Mode.Selecting(items.toSet()) mode = if (items.isEmpty()) {
BookmarkFragmentState.Mode.Normal
} else {
BookmarkFragmentState.Mode.Selecting(items.toSet())
}
) )
} }
is BookmarkFragmentAction.Select -> is BookmarkFragmentAction.Select ->
@ -59,7 +66,11 @@ private fun bookmarkFragmentStateReducer(state: BookmarkFragmentState, action: B
is BookmarkFragmentAction.Deselect -> { is BookmarkFragmentAction.Deselect -> {
val items = state.mode.selectedItems - action.item val items = state.mode.selectedItems - action.item
state.copy( state.copy(
mode = if (items.isEmpty()) BookmarkFragmentState.Mode.Normal else BookmarkFragmentState.Mode.Selecting(items) mode = if (items.isEmpty()) {
BookmarkFragmentState.Mode.Normal
} else {
BookmarkFragmentState.Mode.Selecting(items)
}
) )
} }
BookmarkFragmentAction.DeselectAll -> BookmarkFragmentAction.DeselectAll ->

View File

@ -52,14 +52,21 @@ data class HistoryFragmentState(val items: List<HistoryItem>, val mode: Mode) :
/** /**
* The HistoryState Reducer. * The HistoryState Reducer.
*/ */
private fun historyStateReducer(state: HistoryFragmentState, action: HistoryFragmentAction): HistoryFragmentState { private fun historyStateReducer(
state: HistoryFragmentState,
action: HistoryFragmentAction
): HistoryFragmentState {
return when (action) { return when (action) {
is HistoryFragmentAction.AddItemForRemoval -> is HistoryFragmentAction.AddItemForRemoval ->
state.copy(mode = HistoryFragmentState.Mode.Editing(state.mode.selectedItems + action.item)) state.copy(mode = HistoryFragmentState.Mode.Editing(state.mode.selectedItems + action.item))
is HistoryFragmentAction.RemoveItemForRemoval -> { is HistoryFragmentAction.RemoveItemForRemoval -> {
val selected = state.mode.selectedItems - action.item val selected = state.mode.selectedItems - action.item
state.copy( state.copy(
mode = if (selected.isEmpty()) HistoryFragmentState.Mode.Normal else HistoryFragmentState.Mode.Editing(selected) mode = if (selected.isEmpty()) {
HistoryFragmentState.Mode.Normal
} else {
HistoryFragmentState.Mode.Editing(selected)
}
) )
} }
is HistoryFragmentAction.ExitEditMode -> state.copy(mode = HistoryFragmentState.Mode.Normal) is HistoryFragmentAction.ExitEditMode -> state.copy(mode = HistoryFragmentState.Mode.Normal)

View File

@ -44,7 +44,10 @@ sealed class AccountSettingsFragmentAction : Action {
/** /**
* The SearchState Reducer. * The SearchState Reducer.
*/ */
private fun accountStateReducer(state: AccountSettingsFragmentState, action: AccountSettingsFragmentAction): AccountSettingsFragmentState { private fun accountStateReducer(
state: AccountSettingsFragmentState,
action: AccountSettingsFragmentAction
): AccountSettingsFragmentState {
return when (action) { return when (action) {
is AccountSettingsFragmentAction.SyncFailed -> state.copy(lastSyncedDate = LastSyncTime.Failed(action.time)) is AccountSettingsFragmentAction.SyncFailed -> state.copy(lastSyncedDate = LastSyncTime.Failed(action.time))
is AccountSettingsFragmentAction.SyncEnded -> state.copy(lastSyncedDate = LastSyncTime.Success(action.time)) is AccountSettingsFragmentAction.SyncEnded -> state.copy(lastSyncedDate = LastSyncTime.Success(action.time))