From 42c28dce70144ce4f5526ecb6064ec886a360d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Mon, 25 Apr 2022 12:12:14 +0200 Subject: [PATCH] ThemeModule: convert to Kotlin and fix copyright MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- .../com/nextcloud/client/di/ThemeModule.java | 132 ------------------ .../com/nextcloud/client/di/ThemeModule.kt | 131 +++++++++++++++++ 2 files changed, 131 insertions(+), 132 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/client/di/ThemeModule.java create mode 100644 app/src/main/java/com/nextcloud/client/di/ThemeModule.kt diff --git a/app/src/main/java/com/nextcloud/client/di/ThemeModule.java b/app/src/main/java/com/nextcloud/client/di/ThemeModule.java deleted file mode 100644 index 0dfa8da506..0000000000 --- a/app/src/main/java/com/nextcloud/client/di/ThemeModule.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Nextcloud Android client application - * - * @author Chris Narkiewicz - * Copyright (C) 2019 Chris Narkiewicz - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.nextcloud.client.di; - -import android.content.Context; - -import com.owncloud.android.utils.theme.ThemeAvatarUtils; -import com.owncloud.android.utils.theme.ThemeBarUtils; -import com.owncloud.android.utils.theme.ThemeButtonUtils; -import com.owncloud.android.utils.theme.ThemeCheckableUtils; -import com.owncloud.android.utils.theme.ThemeColorUtils; -import com.owncloud.android.utils.theme.ThemeDrawableUtils; -import com.owncloud.android.utils.theme.ThemeFabUtils; -import com.owncloud.android.utils.theme.ThemeLayoutUtils; -import com.owncloud.android.utils.theme.ThemeMenuUtils; -import com.owncloud.android.utils.theme.ThemeSnackbarUtils; -import com.owncloud.android.utils.theme.ThemeTextInputUtils; -import com.owncloud.android.utils.theme.ThemeTextUtils; -import com.owncloud.android.utils.theme.ThemeToolbarUtils; -import com.owncloud.android.utils.theme.ThemeUtils; - -import javax.inject.Singleton; - -import dagger.Module; -import dagger.Provides; - -@Module -class ThemeModule { - @Provides - @Singleton - ThemeColorUtils themeColorUtils() { - return new ThemeColorUtils(); - } - - @Provides - @Singleton - ThemeFabUtils themeFabUtils(ThemeColorUtils themeColorUtils, ThemeDrawableUtils themeDrawableUtils) { - return new ThemeFabUtils(themeColorUtils, themeDrawableUtils); - } - - @Provides - @Singleton - ThemeLayoutUtils themeLayoutUtils(ThemeColorUtils themeColorUtils) { - return new ThemeLayoutUtils(themeColorUtils); - } - - @Provides - @Singleton - ThemeToolbarUtils themeToolbarUtils(ThemeColorUtils themeColorUtils, - ThemeDrawableUtils themeDrawableUtils, - ThemeTextInputUtils themeTextInputUtils) { - return new ThemeToolbarUtils(themeColorUtils, themeDrawableUtils, themeTextInputUtils); - } - - @Provides - @Singleton - ThemeDrawableUtils themeDrawableUtils(Context context) { - return new ThemeDrawableUtils(context); - } - - @Provides - @Singleton - ThemeUtils themeUtils() { - return new ThemeUtils(); - } - - @Provides - @Singleton - ThemeMenuUtils themeMenuUtils() { - return new ThemeMenuUtils(); - } - - @Provides - @Singleton - ThemeSnackbarUtils themeSnackbarUtils() { - return new ThemeSnackbarUtils(); - } - - @Provides - @Singleton - ThemeTextUtils themeTextUtils() { - return new ThemeTextUtils(); - } - - @Provides - @Singleton - ThemeButtonUtils themeButtonUtils() { - return new ThemeButtonUtils(); - } - - @Provides - @Singleton - ThemeBarUtils themeBarUtils() { - return new ThemeBarUtils(); - } - - @Provides - @Singleton - ThemeTextInputUtils themeTextInputUtils() { - return new ThemeTextInputUtils(); - } - - @Provides - @Singleton - ThemeCheckableUtils themeCheckableUtils() { - return new ThemeCheckableUtils(); - } - - @Provides - @Singleton - ThemeAvatarUtils themeAvatarUtils() { - return new ThemeAvatarUtils(); - } -} diff --git a/app/src/main/java/com/nextcloud/client/di/ThemeModule.kt b/app/src/main/java/com/nextcloud/client/di/ThemeModule.kt new file mode 100644 index 0000000000..ac703dc5dc --- /dev/null +++ b/app/src/main/java/com/nextcloud/client/di/ThemeModule.kt @@ -0,0 +1,131 @@ +/* + * Nextcloud Android client application + * + * @author Tobias Kaminsky + * Copyright (C) 2022 Tobias Kaminsky + * Copyright (C) 2022 Nextcloud GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.client.di + +import android.content.Context +import javax.inject.Singleton +import com.owncloud.android.utils.theme.ThemeColorUtils +import com.owncloud.android.utils.theme.ThemeDrawableUtils +import com.owncloud.android.utils.theme.ThemeFabUtils +import com.owncloud.android.utils.theme.ThemeLayoutUtils +import com.owncloud.android.utils.theme.ThemeTextInputUtils +import com.owncloud.android.utils.theme.ThemeToolbarUtils +import com.owncloud.android.utils.theme.ThemeMenuUtils +import com.owncloud.android.utils.theme.ThemeSnackbarUtils +import com.owncloud.android.utils.theme.ThemeTextUtils +import com.owncloud.android.utils.theme.ThemeButtonUtils +import com.owncloud.android.utils.theme.ThemeBarUtils +import com.owncloud.android.utils.theme.ThemeCheckableUtils +import com.owncloud.android.utils.theme.ThemeAvatarUtils +import com.owncloud.android.utils.theme.ThemeUtils +import dagger.Module +import dagger.Provides + +@Module +internal class ThemeModule { + @Provides + @Singleton + fun themeColorUtils(): ThemeColorUtils { + return ThemeColorUtils() + } + + @Provides + @Singleton + fun themeFabUtils(themeColorUtils: ThemeColorUtils?, themeDrawableUtils: ThemeDrawableUtils?): ThemeFabUtils { + return ThemeFabUtils(themeColorUtils, themeDrawableUtils) + } + + @Provides + @Singleton + fun themeLayoutUtils(themeColorUtils: ThemeColorUtils?): ThemeLayoutUtils { + return ThemeLayoutUtils(themeColorUtils) + } + + @Provides + @Singleton + fun themeToolbarUtils( + themeColorUtils: ThemeColorUtils?, + themeDrawableUtils: ThemeDrawableUtils?, + themeTextInputUtils: ThemeTextInputUtils? + ): ThemeToolbarUtils { + return ThemeToolbarUtils(themeColorUtils, themeDrawableUtils, themeTextInputUtils) + } + + @Provides + @Singleton + fun themeDrawableUtils(context: Context?): ThemeDrawableUtils { + return ThemeDrawableUtils(context) + } + + @Provides + @Singleton + fun themeUtils(): ThemeUtils { + return ThemeUtils() + } + + @Provides + @Singleton + fun themeMenuUtils(): ThemeMenuUtils { + return ThemeMenuUtils() + } + + @Provides + @Singleton + fun themeSnackbarUtils(): ThemeSnackbarUtils { + return ThemeSnackbarUtils() + } + + @Provides + @Singleton + fun themeTextUtils(): ThemeTextUtils { + return ThemeTextUtils() + } + + @Provides + @Singleton + fun themeButtonUtils(): ThemeButtonUtils { + return ThemeButtonUtils() + } + + @Provides + @Singleton + fun themeBarUtils(): ThemeBarUtils { + return ThemeBarUtils() + } + + @Provides + @Singleton + fun themeTextInputUtils(): ThemeTextInputUtils { + return ThemeTextInputUtils() + } + + @Provides + @Singleton + fun themeCheckableUtils(): ThemeCheckableUtils { + return ThemeCheckableUtils() + } + + @Provides + @Singleton + fun themeAvatarUtils(): ThemeAvatarUtils { + return ThemeAvatarUtils() + } +}