Skip to content

Commit

Permalink
Converted all the "internal" classes, functions, and fields of the ap…
Browse files Browse the repository at this point in the history
…p module to "public".
  • Loading branch information
hojat72elect committed Oct 20, 2024
1 parent ab5a057 commit e99714b
Show file tree
Hide file tree
Showing 221 changed files with 337 additions and 331 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/ca/hojat/gamehub/AppNavigation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import ca.hojat.gamehub.feature_search.presentation.GamesSearch
import ca.hojat.gamehub.feature_search.presentation.GamesSearchRoute

@Composable
internal fun AppNavigation(
fun AppNavigation(
navController: NavHostController,
modifier: Modifier,
) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ca/hojat/gamehub/BottomBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ca.hojat.gamehub.common_ui.theme.GameHubTheme
private const val BOTTOM_BAR_ANIMATION_DURATION = 300

@Composable
internal fun BottomBar(
fun BottomBar(
navController: NavHostController,
currentDestination: Destination,
) {
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/ca/hojat/gamehub/Destination.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import androidx.navigation.NavController
import ca.hojat.gamehub.core.extensions.toCsv
import java.net.URLEncoder

internal val START_DESTINATION = Destination.Discover
val START_DESTINATION = Destination.Discover

internal sealed class Destination(val route: String) {
sealed class Destination(val route: String) {
object Discover : Destination("discover")
object Likes : Destination("likes")
object News : Destination("news")
Expand Down Expand Up @@ -142,7 +142,7 @@ internal sealed class Destination(val route: String) {

}

internal companion object {
companion object {

val Saver = Saver(
save = { it.route },
Expand All @@ -168,7 +168,7 @@ internal sealed class Destination(val route: String) {

@Stable
@Composable
internal fun NavController.currentDestinationAsState(): State<Destination> {
fun NavController.currentDestinationAsState(): State<Destination> {
val selectedDestination = rememberSaveable(stateSaver = Destination.Saver) {
mutableStateOf(START_DESTINATION)
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ca/hojat/gamehub/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.google.accompanist.navigation.animation.rememberAnimatedNavController

@Preview
@Composable
internal fun MainScreen() {
fun MainScreen() {
val navController = rememberAnimatedNavController()
val currentScreen by navController.currentDestinationAsState()

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ca/hojat/gamehub/NavigationUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ca.hojat.gamehub

import androidx.navigation.NavDestination

internal fun NavDestination.requireRoute(): String {
fun NavDestination.requireRoute(): String {
return checkNotNull(route) {
"The route is not set for this destination."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
internal object CommonsModule {
object CommonsModule {

@Provides
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface UserAgentProvider {
}

@BindType
internal class UserAgentProviderImpl @Inject constructor(
class UserAgentProviderImpl @Inject constructor(
@ApplicationContext private val context: Context,
private val stringProvider: StringProvider
) : UserAgentProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum class ApiImageType(val rawType: String) {
SCREEN_TINY("screen_tiny"),
ORIGINAL("original");

internal companion object {
companion object {

fun String.asImageType(): ApiImageType {
return values().find { it.rawType == this } ?: UNKNOWN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ enum class ApiAgeRatingCategory(val rawValue: Int) {
ESRB(rawValue = 1),
PEGI(rawValue = 2);

internal companion object {
companion object {

fun Int.asAgeRatingCategory(): ApiAgeRatingCategory {
return values().find { it.rawValue == this } ?: UNKNOWN
}
}
}

internal object AgeRatingCategorySerializer : KSerializer<ApiAgeRatingCategory> {
object AgeRatingCategorySerializer : KSerializer<ApiAgeRatingCategory> {

override val descriptor = PrimitiveSerialDescriptor(
checkNotNull(AgeRatingCategorySerializer::class.qualifiedName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ enum class ApiAgeRatingType(val rawValue: Int) {
M(rawValue = 11),
AO(rawValue = 12);

internal companion object {
companion object {

fun Int.asAgeRatingType(): ApiAgeRatingType {
return values().find { it.rawValue == this } ?: UNKNOWN
}
}
}

internal object AgeRatingTypeSerializer : KSerializer<ApiAgeRatingType> {
object AgeRatingTypeSerializer : KSerializer<ApiAgeRatingType> {

override val descriptor = PrimitiveSerialDescriptor(
checkNotNull(AgeRatingTypeSerializer::class.qualifiedName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ enum class ApiCategory(val rawValue: Int) {
EPISODE(rawValue = 6),
SEASON(rawValue = 7);

internal companion object {
companion object {

fun Int.asCategory(): ApiCategory {
return values().find { it.rawValue == this } ?: UNKNOWN
}
}
}

internal object CategorySerializer : KSerializer<ApiCategory> {
object CategorySerializer : KSerializer<ApiCategory> {

override val descriptor = PrimitiveSerialDescriptor(
checkNotNull(CategorySerializer::class.qualifiedName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ enum class ApiReleaseDateCategory(val rawValue: Int) {

TBD(rawValue = 7);

internal companion object {
companion object {

fun Int.asReleaseDateCategory(): ApiReleaseDateCategory {
return values().find { it.rawValue == this } ?: UNKNOWN
}
}
}

internal object ReleaseDateCategorySerializer : KSerializer<ApiReleaseDateCategory> {
object ReleaseDateCategorySerializer : KSerializer<ApiReleaseDateCategory> {

override val descriptor = PrimitiveSerialDescriptor(
checkNotNull(ReleaseDateCategorySerializer::class.qualifiedName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ enum class ApiWebsiteCategory(val rawValue: Int) {
GOG(rawValue = 17),
DISCORD(rawValue = 18);

internal companion object {
companion object {

fun Int.asWebsiteCategory(): ApiWebsiteCategory {
return values().find { it.rawValue == this } ?: UNKNOWN
}
}
}

internal object WebsiteCategorySerializer : KSerializer<ApiWebsiteCategory> {
object WebsiteCategorySerializer : KSerializer<ApiWebsiteCategory> {

override val descriptor = PrimitiveSerialDescriptor(
checkNotNull(WebsiteCategorySerializer::class.qualifiedName),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/ca/hojat/gamehub/core/di/CoreModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlinx.serialization.json.Json

@Module
@InstallIn(SingletonComponent::class)
internal object CoreModule {
object CoreModule {

@Provides
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface DispatcherProvider {
}

@Singleton
internal class DispatcherProviderImpl @Inject constructor() : DispatcherProvider {
class DispatcherProviderImpl @Inject constructor() : DispatcherProvider {
override val main: CoroutineDispatcher = Dispatchers.Main
override val io: CoroutineDispatcher = Dispatchers.IO
override val computation: CoroutineDispatcher = Dispatchers.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dagger.hilt.components.SingletonComponent

@Module
@InstallIn(SingletonComponent::class)
internal interface CoreModule {
interface CoreModule {

@Binds
fun bindDispatcherProvider(binding: DispatcherProviderImpl): DispatcherProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface GamesRefreshingThrottlerKeyProvider {
}

@Singleton
internal class GamesRefreshingThrottlerKeyProviderImpl @Inject constructor() :
class GamesRefreshingThrottlerKeyProviderImpl @Inject constructor() :
GamesRefreshingThrottlerKeyProvider {

override fun providePopularGamesKey(pagination: Pagination): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dagger.hilt.components.SingletonComponent

@Module
@InstallIn(SingletonComponent::class)
internal interface CoreModule {
interface CoreModule {

@Binds
fun bindGamesRefreshingThrottlerKeyProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import dagger.hilt.components.SingletonComponent

@Module
@InstallIn(SingletonComponent::class)
internal interface UseCasesModule {
interface UseCasesModule {

@Binds
fun bindObserveComingSoonGamesUseCase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface Downloader {
}

@BindType
internal class DownloaderImpl @Inject constructor(
class DownloaderImpl @Inject constructor(
@ApplicationContext private val context: Context,
) : Downloader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ca.hojat.gamehub.core.domain.entities.Image
import com.paulrybitskyi.hiltbinder.BindType
import javax.inject.Inject

enum class IgdbImageSize(internal val rawSize: String) {
enum class IgdbImageSize(val rawSize: String) {
SMALL_COVER("cover_small"), BIG_COVER("cover_big"),

MEDIUM_SCREENSHOT("screenshot_med"), BIG_SCREENSHOT("screenshot_big"), HUGE_SCREENSHOT("screenshot_huge"),
Expand All @@ -16,7 +16,7 @@ enum class IgdbImageSize(internal val rawSize: String) {
HD("720p"), FULL_HD("1080p")
}

enum class IgdbImageExtension(internal val rawExtension: String) {
enum class IgdbImageExtension(val rawExtension: String) {
JPG("jpg"), PNG("png")
}

Expand All @@ -42,7 +42,7 @@ fun IgdbImageUrlFactory.createUrls(
}

@BindType
internal class IgdbImageUrlFactoryImpl @Inject constructor() : IgdbImageUrlFactory {
class IgdbImageUrlFactoryImpl @Inject constructor() : IgdbImageUrlFactory {

private companion object {
private const val IMAGE_URL_TEMPLATE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ImageViewerGameUrlFactory {
}

@BindType
internal class ImageViewerGameUrlFactoryImpl @Inject constructor(
class ImageViewerGameUrlFactoryImpl @Inject constructor(
private val igdbImageUrlFactory: IgdbImageUrlFactory
) : ImageViewerGameUrlFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ca.hojat.gamehub.core.domain.entities.Video
import com.paulrybitskyi.hiltbinder.BindType
import javax.inject.Inject

enum class YoutubeThumbnailSize(internal val rawSize: String) {
enum class YoutubeThumbnailSize(val rawSize: String) {
DEFAULT("default"), // 120x90
MEDIUM("mqdefault"), // 320x180
HIGH("hqdefault"), // 480x360
Expand All @@ -18,7 +18,7 @@ interface YoutubeMediaUrlFactory {
}

@BindType
internal class YoutubeMediaUrlFactoryImpl @Inject constructor() : YoutubeMediaUrlFactory {
class YoutubeMediaUrlFactoryImpl @Inject constructor() : YoutubeMediaUrlFactory {

private companion object {
private const val THUMBNAIL_URL_TEMPLATE = "https://img.youtube.com/vi/%s/%s.jpg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface GameCategoryFormatter {
}

@BindType
internal class GameCategoryFormatterImpl @Inject constructor(
class GameCategoryFormatterImpl @Inject constructor(
private val stringProvider: StringProvider
) : GameCategoryFormatter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface GameRatingFormatter {
}

@BindType
internal class GameRatingFormatterImpl @Inject constructor(
class GameRatingFormatterImpl @Inject constructor(
private val stringProvider: StringProvider
) : GameRatingFormatter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface GameReleaseDateFormatter {
}

@BindType
internal class GameReleaseDateFormatterImpl @Inject constructor(
class GameReleaseDateFormatterImpl @Inject constructor(
private val stringProvider: StringProvider,
private val relativeDateFormatter: RelativeDateFormatter
) : GameReleaseDateFormatter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface RelativeDateFormatter {
}

@BindType
internal class RelativeDateFormatterImpl @Inject constructor(
class RelativeDateFormatterImpl @Inject constructor(
private val timeProvider: TimeProvider, private val stringProvider: StringProvider
) : RelativeDateFormatter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ErrorMapper {
}

@BindType
internal class ErrorMapperImpl @Inject constructor(
class ErrorMapperImpl @Inject constructor(
private val stringProvider: StringProvider
) : ErrorMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface CustomTabsProvider {

@Singleton
@BindType
internal class CustomTabsProviderImpl @Inject constructor(
class CustomTabsProviderImpl @Inject constructor(
@ApplicationContext private val context: Context
) : CustomTabsProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface NetworkStateProvider {
}

@BindType
internal class NetworkStateProviderImpl @Inject constructor(
class NetworkStateProviderImpl @Inject constructor(
@ApplicationContext private val context: Context
) : NetworkStateProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface StringProvider {
}

@BindType
internal class StringProviderImpl @Inject constructor(
class StringProviderImpl @Inject constructor(
@ApplicationContext private val context: Context
) : StringProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface TimeFormatProvider {
}

@BindType
internal class TimeFormatProviderImpl @Inject constructor(
class TimeFormatProviderImpl @Inject constructor(
@ApplicationContext private val context: Context
) : TimeFormatProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface TimeProvider {
}

@BindType
internal class TimeProviderImpl @Inject constructor() : TimeProvider {
class TimeProviderImpl @Inject constructor() : TimeProvider {

override fun getCurrentDateTime(): LocalDateTime {
return LocalDateTime.now()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface TimestampProvider {
}

@BindType
internal class TimestampProviderImpl @Inject constructor() : TimestampProvider {
class TimestampProviderImpl @Inject constructor() : TimestampProvider {

override fun getUnixTimestamp(timeUnit: TimeUnit): Long {
return timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
Expand Down
Loading

0 comments on commit e99714b

Please sign in to comment.