moved URLs to a Companion Object
This commit is contained in:
parent
e008bb6c73
commit
50859d7de0
|
@ -17,42 +17,42 @@ class LinkAdapter(
|
|||
|
||||
private val instagram = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_instagram),
|
||||
"https://instagram.com/vanced.youtube"
|
||||
INSTAGRAM
|
||||
)
|
||||
|
||||
private val youtube = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_youtube),
|
||||
"https://youtube.com/c/YouTubeVanced"
|
||||
YOUTUBE
|
||||
)
|
||||
|
||||
private val github = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_github),
|
||||
"https://github.com/YTVanced/VancedManager"
|
||||
GITHUB
|
||||
)
|
||||
|
||||
private val website = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_website),
|
||||
"https://vancedapp.com"
|
||||
WEBSITE
|
||||
)
|
||||
|
||||
private val telegram = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_telegram),
|
||||
"https://t.me/joinchat/AAAAAEHf-pi4jH1SDlAL4w"
|
||||
TELEGRAM
|
||||
)
|
||||
|
||||
private val twitter = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_twitter),
|
||||
"https://twitter.com/YTVanced"
|
||||
TWITTER
|
||||
)
|
||||
|
||||
private val discord = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_discord),
|
||||
"https://discord.gg/WCGNdRruzb"
|
||||
DISCORD
|
||||
)
|
||||
|
||||
private val reddit = LinkModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_reddit),
|
||||
"https://www.reddit.com/r/Vanced/"
|
||||
REDDIT
|
||||
)
|
||||
|
||||
val links = arrayOf(instagram, youtube, github, website, telegram, twitter, discord, reddit)
|
||||
|
@ -80,4 +80,15 @@ class LinkAdapter(
|
|||
|
||||
override fun getItemCount(): Int = links.size
|
||||
|
||||
companion object {
|
||||
const val INSTAGRAM = "https://instagram.com/vanced.youtube"
|
||||
const val YOUTUBE = "https://youtube.com/c/YouTubeVanced"
|
||||
const val GITHUB = "https://github.com/YTVanced/VancedManager"
|
||||
const val WEBSITE = "https://vancedapp.com"
|
||||
const val TELEGRAM = "https://t.me/joinchat/AAAAAEHf-pi4jH1SDlAL4w"
|
||||
const val TWITTER = "https://twitter.com/YTVanced"
|
||||
const val DISCORD = "https://discord.gg/WCGNdRruzb"
|
||||
const val REDDIT = "https://www.reddit.com/r/Vanced/"
|
||||
}
|
||||
|
||||
}
|
|
@ -19,13 +19,13 @@ class SponsorAdapter(
|
|||
private val brave = SponsorModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_brave),
|
||||
"Brave",
|
||||
"https://vancedapp.com/brave"
|
||||
BRAVE
|
||||
)
|
||||
|
||||
private val adguard = SponsorModel(
|
||||
AppCompatResources.getDrawable(context, R.drawable.ic_adguard),
|
||||
"AdGuard",
|
||||
"https://adguard.com/?aid=31141&source=manager"
|
||||
ADGUARD
|
||||
)
|
||||
|
||||
val sponsors = arrayListOf(brave, adguard)
|
||||
|
@ -76,4 +76,9 @@ class SponsorAdapter(
|
|||
// })
|
||||
// }
|
||||
|
||||
companion object {
|
||||
const val BRAVE = "https://vancedapp.com/brave"
|
||||
const val ADGUARD = "https://adguard.com/?aid=31141&source=manager"
|
||||
}
|
||||
|
||||
}
|
|
@ -11,6 +11,11 @@ import androidx.preference.PreferenceManager.getDefaultSharedPreferences
|
|||
import com.crowdin.platform.Crowdin
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.adapter.LinkAdapter.Companion.DISCORD
|
||||
import com.vanced.manager.adapter.LinkAdapter.Companion.REDDIT
|
||||
import com.vanced.manager.adapter.LinkAdapter.Companion.TELEGRAM
|
||||
import com.vanced.manager.adapter.LinkAdapter.Companion.TWITTER
|
||||
import com.vanced.manager.adapter.SponsorAdapter.Companion.BRAVE
|
||||
import com.vanced.manager.model.DataModel
|
||||
import com.vanced.manager.ui.dialogs.AppDownloadDialog
|
||||
import com.vanced.manager.ui.dialogs.InstallationFilesDetectedDialog
|
||||
|
@ -59,12 +64,11 @@ open class HomeViewModel(private val activity: FragmentActivity): ViewModel() {
|
|||
fun openUrl(url: String) {
|
||||
val color: Int =
|
||||
when (url) {
|
||||
"https://discord.gg/TUVd7rd" -> R.color.Discord
|
||||
"https://t.me/joinchat/AAAAAEHf-pi4jH1SDlAL4w" -> R.color.Telegram
|
||||
"https://twitter.com/YTVanced" -> R.color.Twitter
|
||||
"https://reddit.com/r/vanced" -> R.color.Reddit
|
||||
"https://vanced.activity" -> R.color.Vanced
|
||||
"https://brave.com/van874" -> R.color.Brave
|
||||
DISCORD -> R.color.Discord
|
||||
TELEGRAM -> R.color.Telegram
|
||||
TWITTER -> R.color.Twitter
|
||||
REDDIT -> R.color.Reddit
|
||||
BRAVE -> R.color.Brave
|
||||
else -> R.color.Vanced
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue