| author | Da Risk <da_risk@geekorum.com> |
| Mon, 15 Sep 2025 14:00:07 -0400 | |
| changeset 1370 | 13e39ef920a8 |
| parent 1174 | 731f6ee517b6 |
| permissions | -rw-r--r-- |
| 195 | 1 |
/* |
2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
|
3 |
* |
|
| 1370 | 4 |
* Copyright (C) 2017-2025 by Frederic-Charles Barthelery. |
| 195 | 5 |
* |
6 |
* This file is part of Geekttrss. |
|
7 |
* |
|
8 |
* Geekttrss is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* Geekttrss is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with Geekttrss. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
|
194
fc7c3f9fb77c
Add ManageFeaturesFragment to test uninstall of feature modules
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
21 |
package com.geekorum.ttrss.settings |
|
fc7c3f9fb77c
Add ManageFeaturesFragment to test uninstall of feature modules
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
22 |
|
|
694
bbd0496c4b16
di: SettingsModule provides application preferences
Da Risk <da_risk@geekorum.com>
parents:
693
diff
changeset
|
23 |
import android.app.Application |
|
bbd0496c4b16
di: SettingsModule provides application preferences
Da Risk <da_risk@geekorum.com>
parents:
693
diff
changeset
|
24 |
import android.content.SharedPreferences |
|
693
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
25 |
import androidx.fragment.app.Fragment |
|
694
bbd0496c4b16
di: SettingsModule provides application preferences
Da Risk <da_risk@geekorum.com>
parents:
693
diff
changeset
|
26 |
import androidx.preference.PreferenceManager |
|
693
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
27 |
import com.geekorum.geekdroid.dagger.FragmentKey |
|
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
28 |
import dagger.Binds |
|
194
fc7c3f9fb77c
Add ManageFeaturesFragment to test uninstall of feature modules
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
29 |
import dagger.Module |
|
694
bbd0496c4b16
di: SettingsModule provides application preferences
Da Risk <da_risk@geekorum.com>
parents:
693
diff
changeset
|
30 |
import dagger.Provides |
| 733 | 31 |
import dagger.hilt.InstallIn |
32 |
import dagger.hilt.android.components.ActivityComponent |
|
| 769 | 33 |
import dagger.hilt.components.SingletonComponent |
|
693
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
34 |
import dagger.multibindings.IntoMap |
|
194
fc7c3f9fb77c
Add ManageFeaturesFragment to test uninstall of feature modules
Da Risk <da_risk@geekorum.com>
parents:
diff
changeset
|
35 |
|
| 733 | 36 |
@Module |
37 |
@InstallIn(ActivityComponent::class) |
|
| 221 | 38 |
abstract class SettingsModule {
|
39 |
||
|
693
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
40 |
@Binds |
|
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
41 |
@IntoMap |
|
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
42 |
@FragmentKey(SettingsActivity.SettingsFragment::class) |
|
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
43 |
abstract fun bindSettingsFragment(settingsFragment: SettingsActivity.SettingsFragment): Fragment |
|
cdc81caa38e8
SettingsActivity: add preference for in app browser engine
Da Risk <da_risk@geekorum.com>
parents:
611
diff
changeset
|
44 |
|
| 733 | 45 |
} |
|
694
bbd0496c4b16
di: SettingsModule provides application preferences
Da Risk <da_risk@geekorum.com>
parents:
693
diff
changeset
|
46 |
|
| 733 | 47 |
@Module |
| 769 | 48 |
@InstallIn(SingletonComponent::class) |
| 733 | 49 |
object ApplicationPreferencesModule {
|
|
694
bbd0496c4b16
di: SettingsModule provides application preferences
Da Risk <da_risk@geekorum.com>
parents:
693
diff
changeset
|
50 |
|
| 733 | 51 |
@Provides |
52 |
fun providesApplicationPreferences(application: Application): SharedPreferences = |
|
53 |
PreferenceManager.getDefaultSharedPreferences(application) |
|
| 221 | 54 |
} |