Skip to content

Commit 2c6acc7

Browse files
committed
fix: spotless
1 parent 1141ed2 commit 2c6acc7

File tree

7 files changed

+78
-8
lines changed

7 files changed

+78
-8
lines changed

app/src/main/java/io/github/shinhyo/brba/app/di/CoroutinesModule.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2022 shinhyo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package io.github.shinhyo.brba.app.di
217

318
import dagger.Module
@@ -29,4 +44,4 @@ internal object CoroutinesModule {
2944
@MainImmediateDispatcher
3045
@Provides
3146
fun providesMainImmediateDispatcher(): CoroutineDispatcher = Dispatchers.Main.immediate
32-
}
47+
}

data/src/main/java/io/github/shinhyo/brba/data/repository/CharactersRepositoryImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ open class CharactersRepositoryImpl @Inject constructor(
6666
.map { Result.Success(it) }
6767
}
6868

69-
7069
override fun getFavoriteList(isAsc: Boolean): Flow<List<Character>> =
7170
db.characterDao().getFavorite(isAsc = isAsc)
7271
.map { it.map { i -> i.toCharacter() } }

domain/src/main/java/io/github/shinhyo/brba/domain/di/CoroutinesQualifiers.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2022 shinhyo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package io.github.shinhyo.brba.domain.di
217

318
import javax.inject.Qualifier

domain/src/main/java/io/github/shinhyo/brba/domain/result/Result.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2022 shinhyo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package io.github.shinhyo.brba.domain.result
217

318
import io.github.shinhyo.brba.domain.result.Result.Success
@@ -42,4 +57,4 @@ inline fun <R, T> Flow<Result<T>>.mapTransform(crossinline transform: (T) -> R):
4257
is Result.Success -> Result.Success(transform(it.data))
4358
is Result.Error -> Result.Error(it.exception)
4459
}
45-
}
60+
}

domain/src/main/java/io/github/shinhyo/brba/domain/usecase/FlowUseCase.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2022 shinhyo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package io.github.shinhyo.brba.domain.usecase
217

318
import io.github.shinhyo.brba.domain.result.Result
@@ -16,6 +31,5 @@ abstract class FlowUseCase<in P, R>(private val coroutineDispatcher: CoroutineDi
1631
.catch { e -> emit(Result.Error(Exception(e))) }
1732
.flowOn(coroutineDispatcher)
1833

19-
2034
protected abstract fun execute(parameters: P): Flow<Result<R>>
2135
}

domain/src/main/java/io/github/shinhyo/brba/domain/usecase/GetCharacterListUseCase.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2022 shinhyo
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package io.github.shinhyo.brba.domain.usecase
217

318
import io.github.shinhyo.brba.domain.di.IoDispatcher
@@ -15,5 +30,4 @@ class GetCharacterListUseCase @Inject constructor(
1530

1631
override fun execute(parameters: Unit): Flow<Result<List<Character>>> =
1732
charactersRepository.getCharacterList()
18-
19-
}
33+
}

presentation/src/main/java/io/github/shinhyo/brba/presentation/ui/list/ListViewModel.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import io.github.shinhyo.brba.presentation.ui.BaseFavoriteViewModel
2727
import kotlinx.coroutines.flow.*
2828
import javax.inject.Inject
2929

30-
3130
data class ListUiState(
3231
val isLoading: Boolean = false,
3332
@StringRes val errorMessages: Int? = null,
@@ -44,7 +43,6 @@ class ListViewModel
4443
private val _uiState = MutableStateFlow(ListUiState())
4544
val uiState = _uiState.asStateFlow()
4645

47-
4846
init {
4947
getCharacterList()
5048
}

0 commit comments

Comments
 (0)