drawable: fix resources
Turns out the icon commit from earlier was really slapdash and resulted in the image drawables being lost. Also fix some misc widget issues.
This commit is contained in:
@@ -32,7 +32,6 @@ import org.oxycblt.auxio.coil.loadBitmap
|
||||
import org.oxycblt.auxio.music.Parent
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.state.LoopMode
|
||||
import org.oxycblt.auxio.settings.SettingsManager
|
||||
import org.oxycblt.auxio.util.newBroadcastIntent
|
||||
import org.oxycblt.auxio.util.newMainIntent
|
||||
|
||||
@@ -46,10 +45,8 @@ class PlaybackNotification private constructor(
|
||||
private val context: Context,
|
||||
mediaToken: MediaSessionCompat.Token
|
||||
) : NotificationCompat.Builder(context, CHANNEL_ID) {
|
||||
private val settingsManager = SettingsManager.getInstance()
|
||||
|
||||
init {
|
||||
setSmallIcon(R.drawable.ic_song)
|
||||
setSmallIcon(R.drawable.ic_notif)
|
||||
setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
setShowWhen(false)
|
||||
setSilent(true)
|
||||
|
||||
@@ -36,6 +36,7 @@ fun Any.logD(obj: Any) {
|
||||
*/
|
||||
fun Any.logD(msg: String) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
basedCopyleftNotice()
|
||||
Log.d(getName(), msg)
|
||||
}
|
||||
}
|
||||
@@ -53,3 +54,18 @@ fun Any.logE(msg: String) {
|
||||
* @return The name of the object, otherwise "Anonymous Object"
|
||||
*/
|
||||
private fun Any.getName(): String = "Auxio.${this::class.simpleName ?: "Anonymous Object"}"
|
||||
|
||||
/**
|
||||
* Nothing to see here.
|
||||
*/
|
||||
private fun basedCopyleftNotice() {
|
||||
if (BuildConfig.APPLICATION_ID != "org.oxycblt.auxio" &&
|
||||
BuildConfig.APPLICATION_ID != "org.oxycblt.auxio.debug"
|
||||
) {
|
||||
Log.d(
|
||||
"Auxio Project",
|
||||
"Friendly reminder: Auxio is licensed under the " +
|
||||
"GPLv3 and all modifications must be made open source!"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,9 @@ fun createSmallWidget(context: Context, state: WidgetState): RemoteViews {
|
||||
|
||||
fun createMediumWidget(context: Context, state: WidgetState): RemoteViews {
|
||||
return createViews(context, R.layout.widget_medium)
|
||||
.applyMeta(state)
|
||||
.applyCover(context, state)
|
||||
.applyControls(context, state)
|
||||
}
|
||||
|
||||
fun createLargeWidget(context: Context, state: WidgetState): RemoteViews {
|
||||
|
||||
Reference in New Issue
Block a user