parent
d91e9ad06f
commit
931b1ea7d9
@ -0,0 +1,20 @@ |
|||||||
|
package com.keylesspalace.tusky.util |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import android.content.Intent |
||||||
|
import android.net.Uri |
||||||
|
import com.keylesspalace.tusky.R |
||||||
|
|
||||||
|
object RickRoll { |
||||||
|
fun shouldRickRoll(context: Context, domain: String) = |
||||||
|
context.resources.getStringArray(R.array.rick_roll_domains).contains(domain) |
||||||
|
|
||||||
|
fun rickRoll(context: Context) { |
||||||
|
val uri = Uri.parse(context.getString(R.string.rick_roll_url)) |
||||||
|
val intent = Intent(Intent.ACTION_VIEW, uri).apply { |
||||||
|
addCategory(Intent.CATEGORY_BROWSABLE) |
||||||
|
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) |
||||||
|
} |
||||||
|
context.startActivity(intent) |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue