-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from armancodv/config
config
- Loading branch information
Showing
40 changed files
with
255 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.armanco.integral | ||
|
||
import android.content.Context | ||
import androidx.lifecycle.MutableLiveData | ||
import androidx.lifecycle.ViewModel | ||
import com.armanco.integral.utils.extensions.configAds | ||
import com.armanco.integral.utils.facade.EventFacade | ||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class MainViewModel @Inject constructor( | ||
private val eventFacade: EventFacade, | ||
val remoteConfig: FirebaseRemoteConfig, | ||
): ViewModel() { | ||
var configAds = MutableLiveData(remoteConfig.configAds) | ||
|
||
fun initEvents(context: Context) { | ||
eventFacade.init(context) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/armanco/integral/models/ConfigAds.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.armanco.integral.models | ||
|
||
data class ConfigAds ( | ||
val bannerId: String? = null, | ||
val interstitialId: String? = null | ||
) { | ||
companion object { | ||
const val KEY = "ads" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/armanco/integral/models/ConfigLinks.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.armanco.integral.models | ||
|
||
data class ConfigLinks ( | ||
val proPackageName: String? = null, | ||
val reportBug: String? = null, | ||
val contribute: String? = null, | ||
val privacy: String? = null, | ||
val terms: String? = null, | ||
) { | ||
companion object { | ||
const val KEY = "links" | ||
const val PRO_PACKAGE_NAME_DEFAULT = "com.armanco.integral_pro" | ||
const val REPORT_BUG_DEFAULT = "https://github.com/armancodv/integral/issues" | ||
const val CONTRIBUTE_DEFAULT = "https://github.com/armancodv/integral" | ||
const val PRIVACY_DEFAULT = "https://github.com/armancodv/integral/blob/master/privacy/PRIVACY-POLICY.md" | ||
const val TERMS_DEFAULT = "https://github.com/armancodv/integral/blob/master/privacy/TERMS-AND-CONDITIONS.md" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/armanco/integral/utils/extensions/FirebaseRemoteConfig_extensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.armanco.integral.utils.extensions | ||
|
||
import com.armanco.integral.models.ConfigAds | ||
import com.armanco.integral.models.ConfigLinks | ||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig | ||
import com.google.gson.Gson | ||
|
||
val FirebaseRemoteConfig.configLinks: ConfigLinks? | ||
get() { | ||
return Gson().fromJson(getString(ConfigLinks.KEY), ConfigLinks::class.java) | ||
} | ||
|
||
val FirebaseRemoteConfig.configAds: ConfigAds? | ||
get() { | ||
return Gson().fromJson(getString(ConfigAds.KEY), ConfigAds::class.java) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#FFFFFF" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="@android:color/white" android:pathData="M12,1L3,5v6c0,5.55 3.84,10.74 9,12c5.16,-1.26 9,-6.45 9,-12V5L12,1L12,1zM11,7h2v2h-2V7zM11,11h2v6h-2V11z"/> | ||
</vector> |
Oops, something went wrong.