File tree Expand file tree Collapse file tree
app/src/main/kotlin/de/binarynoise/captiveportalautologin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,6 +223,12 @@ class MainFragment : AutoCleanupPreferenceFragment() {
223223 fragment = LogsFragment ::class .qualifiedName
224224 }
225225
226+ if (BuildConfig .DEBUG ) {
227+ addPreference(Preference (ctx)) {
228+ title = " Debug Activities"
229+ fragment = DebugShortcutsFragment ::class .qualifiedName
230+ }
231+ }
226232 setIconSpaceReservedRecursively(false )
227233 }
228234 }
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import android.annotation.SuppressLint
44import android.app.Application
55import android.content.Context
66import android.content.Intent
7+ import android.util.TypedValue
8+ import androidx.annotation.AttrRes
9+ import androidx.annotation.ColorInt
710
811@SuppressLint(" PrivateApi" )
912internal var applicationContext: Application =
@@ -21,3 +24,13 @@ inline fun Context.startActivity(setup: Intent.() -> Unit = {}) {
2124inline fun <reified T > Context.startService (setup : Intent .() -> Unit = {}) {
2225 startService(Intent (this , T ::class .java).apply (setup))
2326}
27+
28+ @ColorInt
29+ fun Context.getColorFromAttr (
30+ @AttrRes attrColor : Int ,
31+ typedValue : TypedValue = TypedValue (),
32+ resolveRefs : Boolean = true,
33+ ): Int {
34+ check(theme.resolveAttribute(attrColor, typedValue, resolveRefs))
35+ return typedValue.data
36+ }
You can’t perform that action at this time.
0 commit comments