|
|
|
@ -3,6 +3,7 @@ package io.legado.app.utils |
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
|
|
import android.content.* |
|
|
|
|
import android.content.pm.PackageManager |
|
|
|
|
import android.content.res.ColorStateList |
|
|
|
|
import android.content.res.Configuration |
|
|
|
|
import android.graphics.Bitmap |
|
|
|
@ -178,4 +179,16 @@ fun Context.openUrl(uri: Uri) { |
|
|
|
|
toast(e.localizedMessage ?: "open url error") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val Context.channel: String |
|
|
|
|
get() { |
|
|
|
|
try { |
|
|
|
|
val pm = packageManager |
|
|
|
|
val appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA); |
|
|
|
|
return appInfo.metaData.getString("channel") ?: "" |
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
return "" |
|
|
|
|
} |
|
|
|
|