Added "Circle" widget
This commit is contained in:
parent
b2e1ab2128
commit
e778e50073
19 changed files with 307 additions and 19 deletions
|
@ -0,0 +1,216 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2020 Hemanth Savarla.
|
||||||
|
*
|
||||||
|
* Licensed under the GNU General Public License v3
|
||||||
|
*
|
||||||
|
* This is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package code.name.monkey.retromusic.appwidgets
|
||||||
|
|
||||||
|
import android.app.PendingIntent
|
||||||
|
import android.content.ComponentName
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.widget.RemoteViews
|
||||||
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
|
import code.name.monkey.appthemehelper.util.VersionUtils
|
||||||
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.activities.MainActivity
|
||||||
|
import code.name.monkey.retromusic.appwidgets.base.BaseAppWidget
|
||||||
|
import code.name.monkey.retromusic.glide.GlideApp
|
||||||
|
import code.name.monkey.retromusic.glide.RetroGlideExtension
|
||||||
|
import code.name.monkey.retromusic.glide.palette.BitmapPaletteWrapper
|
||||||
|
import code.name.monkey.retromusic.service.MusicService
|
||||||
|
import code.name.monkey.retromusic.service.MusicService.ACTION_TOGGLE_PAUSE
|
||||||
|
import code.name.monkey.retromusic.service.MusicService.TOGGLE_FAVORITE
|
||||||
|
import code.name.monkey.retromusic.util.ImageUtil
|
||||||
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
|
import code.name.monkey.retromusic.util.RetroUtil
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
|
||||||
|
import com.bumptech.glide.request.RequestOptions
|
||||||
|
import com.bumptech.glide.request.target.SimpleTarget
|
||||||
|
import com.bumptech.glide.request.target.Target
|
||||||
|
import com.bumptech.glide.request.transition.Transition
|
||||||
|
|
||||||
|
class AppWidgetCircle : BaseAppWidget() {
|
||||||
|
private var target: Target<BitmapPaletteWrapper>? = null // for cancellation
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize given widgets to default state, where we launch Music on default click and hide
|
||||||
|
* actions if service not running.
|
||||||
|
*/
|
||||||
|
override fun defaultAppWidget(context: Context, appWidgetIds: IntArray) {
|
||||||
|
val appWidgetView = RemoteViews(context.packageName, R.layout.app_widget_circle)
|
||||||
|
|
||||||
|
appWidgetView.setImageViewResource(R.id.image, R.drawable.default_audio_art)
|
||||||
|
val secondaryColor = MaterialValueHelper.getSecondaryTextColor(context, true)
|
||||||
|
appWidgetView.setImageViewBitmap(
|
||||||
|
R.id.button_toggle_play_pause, createBitmap(
|
||||||
|
RetroUtil.getTintedVectorDrawable(
|
||||||
|
context,
|
||||||
|
R.drawable.ic_play_arrow,
|
||||||
|
secondaryColor
|
||||||
|
), 1f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
linkButtons(context, appWidgetView)
|
||||||
|
pushUpdate(context, appWidgetIds, appWidgetView)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update all active widget instances by pushing changes
|
||||||
|
*/
|
||||||
|
override fun performUpdate(service: MusicService, appWidgetIds: IntArray?) {
|
||||||
|
val appWidgetView = RemoteViews(service.packageName, R.layout.app_widget_circle)
|
||||||
|
|
||||||
|
val isPlaying = service.isPlaying
|
||||||
|
val song = service.currentSong
|
||||||
|
|
||||||
|
// Set correct drawable for pause state
|
||||||
|
val playPauseRes =
|
||||||
|
if (isPlaying) R.drawable.ic_pause else R.drawable.ic_play_arrow
|
||||||
|
appWidgetView.setImageViewBitmap(
|
||||||
|
R.id.button_toggle_play_pause, createBitmap(
|
||||||
|
RetroUtil.getTintedVectorDrawable(
|
||||||
|
service,
|
||||||
|
playPauseRes,
|
||||||
|
MaterialValueHelper.getSecondaryTextColor(service, true)
|
||||||
|
), 1f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
val isFavorite = true
|
||||||
|
val favoriteRes =
|
||||||
|
if (isFavorite) R.drawable.ic_favorite else R.drawable.ic_favorite_border
|
||||||
|
appWidgetView.setImageViewBitmap(
|
||||||
|
R.id.button_toggle_favorite, createBitmap(
|
||||||
|
RetroUtil.getTintedVectorDrawable(
|
||||||
|
service,
|
||||||
|
favoriteRes,
|
||||||
|
MaterialValueHelper.getSecondaryTextColor(service, true)
|
||||||
|
), 1f
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// Link actions buttons to intents
|
||||||
|
linkButtons(service, appWidgetView)
|
||||||
|
|
||||||
|
if (imageSize == 0) {
|
||||||
|
val p = RetroUtil.getScreenSize(service)
|
||||||
|
imageSize = p.x.coerceAtMost(p.y)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load the album cover async and push the update on completion
|
||||||
|
service.runOnUiThread {
|
||||||
|
if (target != null) {
|
||||||
|
Glide.with(service).clear(target)
|
||||||
|
}
|
||||||
|
target = GlideApp.with(service).asBitmapPalette().songCoverOptions(song)
|
||||||
|
.load(RetroGlideExtension.getSongModel(song))
|
||||||
|
.apply(
|
||||||
|
RequestOptions().transform(RoundedCorners(imageSize / 2))
|
||||||
|
)
|
||||||
|
.into(object : SimpleTarget<BitmapPaletteWrapper>(imageSize, imageSize) {
|
||||||
|
override fun onResourceReady(
|
||||||
|
resource: BitmapPaletteWrapper,
|
||||||
|
transition: Transition<in BitmapPaletteWrapper>?
|
||||||
|
) {
|
||||||
|
val palette = resource.palette
|
||||||
|
update(
|
||||||
|
resource.bitmap, palette.getVibrantColor(
|
||||||
|
palette.getMutedColor(
|
||||||
|
MaterialValueHelper.getSecondaryTextColor(
|
||||||
|
service, true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onLoadFailed(errorDrawable: Drawable?) {
|
||||||
|
super.onLoadFailed(errorDrawable)
|
||||||
|
update(null, MaterialValueHelper.getSecondaryTextColor(service, true))
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun update(bitmap: Bitmap?, color: Int) {
|
||||||
|
// Set correct drawable for pause state
|
||||||
|
appWidgetView.setImageViewBitmap(
|
||||||
|
R.id.button_toggle_play_pause, ImageUtil.createBitmap(
|
||||||
|
ImageUtil.getTintedVectorDrawable(
|
||||||
|
service, playPauseRes, color
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
// Set favorite button drawables
|
||||||
|
appWidgetView.setImageViewBitmap(
|
||||||
|
R.id.button_toggle_favorite, ImageUtil.createBitmap(
|
||||||
|
ImageUtil.getTintedVectorDrawable(
|
||||||
|
service, favoriteRes, color
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
appWidgetView.setImageViewBitmap(R.id.image, bitmap)
|
||||||
|
|
||||||
|
pushUpdate(service, appWidgetIds, appWidgetView)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Link up various button actions using [PendingIntent].
|
||||||
|
*/
|
||||||
|
private fun linkButtons(context: Context, views: RemoteViews) {
|
||||||
|
val action = Intent(context, MainActivity::class.java)
|
||||||
|
.putExtra(
|
||||||
|
MainActivity.EXPAND_PANEL,
|
||||||
|
PreferenceUtil.isExpandPanel
|
||||||
|
)
|
||||||
|
|
||||||
|
val serviceName = ComponentName(context, MusicService::class.java)
|
||||||
|
|
||||||
|
// Home
|
||||||
|
action.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||||
|
var pendingIntent =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
context, 0, action, if (VersionUtils.hasMarshmallow())
|
||||||
|
PendingIntent.FLAG_IMMUTABLE
|
||||||
|
else 0
|
||||||
|
)
|
||||||
|
views.setOnClickPendingIntent(R.id.image, pendingIntent)
|
||||||
|
// Favorite track
|
||||||
|
pendingIntent = buildPendingIntent(context, TOGGLE_FAVORITE, serviceName)
|
||||||
|
views.setOnClickPendingIntent(R.id.button_toggle_favorite, pendingIntent)
|
||||||
|
|
||||||
|
// Play and pause
|
||||||
|
pendingIntent = buildPendingIntent(context, ACTION_TOGGLE_PAUSE, serviceName)
|
||||||
|
views.setOnClickPendingIntent(R.id.button_toggle_play_pause, pendingIntent)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
const val NAME = "app_widget_circle"
|
||||||
|
|
||||||
|
private var mInstance: AppWidgetCircle? = null
|
||||||
|
private var imageSize = 0
|
||||||
|
|
||||||
|
val instance: AppWidgetCircle
|
||||||
|
@Synchronized get() {
|
||||||
|
if (mInstance == null) {
|
||||||
|
mInstance = AppWidgetCircle()
|
||||||
|
}
|
||||||
|
return mInstance!!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -83,6 +83,7 @@ import code.name.monkey.retromusic.R;
|
||||||
import code.name.monkey.retromusic.activities.LockScreenActivity;
|
import code.name.monkey.retromusic.activities.LockScreenActivity;
|
||||||
import code.name.monkey.retromusic.appwidgets.AppWidgetBig;
|
import code.name.monkey.retromusic.appwidgets.AppWidgetBig;
|
||||||
import code.name.monkey.retromusic.appwidgets.AppWidgetCard;
|
import code.name.monkey.retromusic.appwidgets.AppWidgetCard;
|
||||||
|
import code.name.monkey.retromusic.appwidgets.AppWidgetCircle;
|
||||||
import code.name.monkey.retromusic.appwidgets.AppWidgetClassic;
|
import code.name.monkey.retromusic.appwidgets.AppWidgetClassic;
|
||||||
import code.name.monkey.retromusic.appwidgets.AppWidgetMD3;
|
import code.name.monkey.retromusic.appwidgets.AppWidgetMD3;
|
||||||
import code.name.monkey.retromusic.appwidgets.AppWidgetSmall;
|
import code.name.monkey.retromusic.appwidgets.AppWidgetSmall;
|
||||||
|
@ -205,6 +206,8 @@ public class MusicService extends MediaBrowserServiceCompat
|
||||||
|
|
||||||
private final AppWidgetMD3 appWidgetMd3 = AppWidgetMD3.Companion.getInstance();
|
private final AppWidgetMD3 appWidgetMd3 = AppWidgetMD3.Companion.getInstance();
|
||||||
|
|
||||||
|
private final AppWidgetCircle appWidgetCircle = AppWidgetCircle.Companion.getInstance();
|
||||||
|
|
||||||
private final BroadcastReceiver widgetIntentReceiver =
|
private final BroadcastReceiver widgetIntentReceiver =
|
||||||
new BroadcastReceiver() {
|
new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -237,6 +240,10 @@ public class MusicService extends MediaBrowserServiceCompat
|
||||||
appWidgetMd3.performUpdate(MusicService.this, ids);
|
appWidgetMd3.performUpdate(MusicService.this, ids);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case AppWidgetCircle.NAME: {
|
||||||
|
appWidgetCircle.performUpdate(MusicService.this, ids);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1619,6 +1626,7 @@ public class MusicService extends MediaBrowserServiceCompat
|
||||||
appWidgetCard.notifyChange(this, what);
|
appWidgetCard.notifyChange(this, what);
|
||||||
appWidgetText.notifyChange(this, what);
|
appWidgetText.notifyChange(this, what);
|
||||||
appWidgetMd3.notifyChange(this, what);
|
appWidgetMd3.notifyChange(this, what);
|
||||||
|
appWidgetCircle.notifyChange(this, what);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCustomAction(PlaybackStateCompat.Builder stateBuilder) {
|
private void setCustomAction(PlaybackStateCompat.Builder stateBuilder) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ appWidgetRadius attribute value
|
||||||
-->
|
-->
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
|
|
||||||
<corners android:radius="16dp" />
|
<corners android:radius="16dp" />
|
||||||
<solid android:color="?android:attr/colorBackground" />
|
<solid android:color="?android:attr/colorBackground" />
|
||||||
</shape>
|
</shape>
|
5
app/src/main/res/drawable/circle_widget_background.xml
Normal file
5
app/src/main/res/drawable/circle_widget_background.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
<solid android:color="@color/widget_md3_button_bg_color" />
|
||||||
|
</shape>
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<solid android:color="?colorSurface"/>
|
<solid android:color="?colorSurface"/>
|
||||||
<corners android:radius="28dp" />
|
<corners android:radius="28dp" />
|
||||||
</shape>
|
</shape>
|
5
app/src/main/res/drawable/widget_button_background.xml
Normal file
5
app/src/main/res/drawable/widget_button_background.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/widget_md3_button_bg_color"/>
|
||||||
|
<corners android:radius="16dp" />
|
||||||
|
</shape>
|
43
app/src/main/res/layout/app_widget_circle.xml
Normal file
43
app/src/main/res/layout/app_widget_circle.xml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/Theme.Material3.DynamicColors.DayNight">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/default_audio_art"
|
||||||
|
tools:src="@tools:sample/backgrounds/scenic[0]" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/button_toggle_favorite"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@+id/image"
|
||||||
|
android:layout_alignEnd="@+id/image"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:background="@drawable/circle_widget_background"
|
||||||
|
android:clickable="false"
|
||||||
|
android:padding="14dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@drawable/ic_favorite_border" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/button_toggle_play_pause"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignStart="@+id/image"
|
||||||
|
android:layout_alignBottom="@+id/image"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:background="@drawable/widget_button_background"
|
||||||
|
android:clickable="false"
|
||||||
|
android:padding="18dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@drawable/ic_play_arrow" />
|
||||||
|
</RelativeLayout>
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="widget_md3_bg_color">@android:color/system_accent1_800</color>
|
<color name="widget_md3_bg_color">@android:color/system_accent1_600</color>
|
||||||
</resources>
|
</resources>
|
|
@ -1,4 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="widget_md3_bg_color">@android:color/system_accent1_50</color>
|
<color name="widget_md3_bg_color">@android:color/system_accent1_50</color>
|
||||||
|
<color name="widget_circle_button_color">@android:color/system_accent1_900</color>
|
||||||
|
<color name="widget_md3_button_bg_color">@android:color/system_accent1_50</color>
|
||||||
</resources>
|
</resources>
|
|
@ -36,4 +36,6 @@
|
||||||
|
|
||||||
<color name="bottomSheetColor">#FFFFFF</color>
|
<color name="bottomSheetColor">#FFFFFF</color>
|
||||||
<color name="widget_md3_bg_color">@color/lighterColorSurface</color>
|
<color name="widget_md3_bg_color">@color/lighterColorSurface</color>
|
||||||
|
<color name="widget_circle_button_color">@color/md_indigo_A400</color>
|
||||||
|
<color name="widget_md3_button_bg_color">@color/lighterColorSurface</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -42,6 +42,11 @@
|
||||||
<dimen name="app_widget_md3_height">90dp</dimen>
|
<dimen name="app_widget_md3_height">90dp</dimen>
|
||||||
<dimen name="app_widget_md3_image_size">70dp</dimen>
|
<dimen name="app_widget_md3_image_size">70dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="app_widget_circle_min_width">180dp</dimen>
|
||||||
|
<dimen name="app_widget_circle_min_height">100dp</dimen>
|
||||||
|
<dimen name="app_widget_circle_max_width">250dp</dimen>
|
||||||
|
<dimen name="app_widget_circle_max_height">250dp</dimen>
|
||||||
|
|
||||||
<dimen name="icon_notification_dimen">32dp</dimen>
|
<dimen name="icon_notification_dimen">32dp</dimen>
|
||||||
<dimen name="toolbar_margin_horizontal">8dp</dimen>
|
<dimen name="toolbar_margin_horizontal">8dp</dimen>
|
||||||
<dimen name="toolbar_height">48dp</dimen>
|
<dimen name="toolbar_height">48dp</dimen>
|
||||||
|
|
|
@ -76,6 +76,7 @@
|
||||||
<string name="app_widget_classic_name">Classic</string>
|
<string name="app_widget_classic_name">Classic</string>
|
||||||
<string name="app_widget_md3_name">MD3</string>
|
<string name="app_widget_md3_name">MD3</string>
|
||||||
<string name="app_widget_small_name">Small</string>
|
<string name="app_widget_small_name">Small</string>
|
||||||
|
<string name="app_widget_circle_name">@string/circle</string>
|
||||||
<string name="app_widget_text_name">Minimal Text</string>
|
<string name="app_widget_text_name">Minimal Text</string>
|
||||||
<string name="artist">Artist</string>
|
<string name="artist">Artist</string>
|
||||||
<string name="artists">Artists</string>
|
<string name="artists">Artists</string>
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:initialLayout="@layout/app_widget_big"
|
android:initialLayout="@layout/app_widget_big"
|
||||||
android:minWidth="@dimen/app_widget_big_min_width"
|
android:minWidth="@dimen/app_widget_big_min_width"
|
||||||
android:minHeight="@dimen/app_widget_big_min_height"
|
android:minHeight="@dimen/app_widget_big_min_height"
|
||||||
android:previewImage="@drawable/widget_big_info"
|
android:previewImage="@drawable/widget_big_info"
|
||||||
android:resizeMode="horizontal|vertical"
|
android:resizeMode="horizontal|vertical"
|
||||||
android:updatePeriodMillis="0"
|
android:updatePeriodMillis="0"
|
||||||
android:widgetCategory="keyguard|home_screen"
|
android:widgetCategory="keyguard|home_screen" />
|
||||||
tools:ignore="UnusedAttribute" />
|
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:initialLayout="@layout/app_widget_card"
|
android:initialLayout="@layout/app_widget_card"
|
||||||
android:minWidth="@dimen/app_widget_card_min_width"
|
android:minWidth="@dimen/app_widget_card_min_width"
|
||||||
android:minHeight="@dimen/app_widget_small_min_height"
|
android:minHeight="@dimen/app_widget_small_min_height"
|
||||||
android:previewImage="@drawable/widget_card_info"
|
android:previewImage="@drawable/widget_card_info"
|
||||||
android:resizeMode="horizontal|vertical"
|
android:resizeMode="horizontal|vertical"
|
||||||
android:updatePeriodMillis="0"
|
android:updatePeriodMillis="0"
|
||||||
android:widgetCategory="keyguard|home_screen"
|
android:widgetCategory="keyguard|home_screen" />
|
||||||
tools:ignore="UnusedAttribute" />
|
|
14
app/src/main/res/xml/app_widget_circle_info.xml
Normal file
14
app/src/main/res/xml/app_widget_circle_info.xml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:initialLayout="@layout/app_widget_circle"
|
||||||
|
android:minResizeWidth="@dimen/app_widget_circle_min_width"
|
||||||
|
android:minResizeHeight="@dimen/app_widget_circle_min_height"
|
||||||
|
android:minWidth="@dimen/app_widget_circle_min_width"
|
||||||
|
android:minHeight="@dimen/app_widget_circle_min_height"
|
||||||
|
android:maxResizeHeight="@dimen/app_widget_circle_max_height"
|
||||||
|
android:maxResizeWidth="@dimen/app_widget_circle_max_width"
|
||||||
|
android:resizeMode="horizontal|vertical"
|
||||||
|
android:updatePeriodMillis="0"
|
||||||
|
android:widgetCategory="keyguard|home_screen"
|
||||||
|
tools:ignore="UnusedAttribute" />
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:initialLayout="@layout/app_widget_classic"
|
android:initialLayout="@layout/app_widget_classic"
|
||||||
android:minWidth="@dimen/app_widget_classic_min_width"
|
android:minWidth="@dimen/app_widget_classic_min_width"
|
||||||
android:minHeight="@dimen/app_widget_classic_min_height"
|
android:minHeight="@dimen/app_widget_classic_min_height"
|
||||||
android:previewImage="@drawable/widget_classic"
|
android:previewImage="@drawable/widget_classic"
|
||||||
android:resizeMode="horizontal|vertical"
|
android:resizeMode="horizontal|vertical"
|
||||||
android:updatePeriodMillis="0"
|
android:updatePeriodMillis="0"
|
||||||
android:widgetCategory="keyguard|home_screen"
|
android:widgetCategory="keyguard|home_screen" />
|
||||||
tools:ignore="UnusedAttribute" />
|
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:initialLayout="@layout/app_widget_classic"
|
android:initialLayout="@layout/app_widget_classic"
|
||||||
android:minWidth="@dimen/app_widget_classic_min_width"
|
android:minWidth="@dimen/app_widget_classic_min_width"
|
||||||
android:minHeight="@dimen/app_widget_classic_min_height"
|
android:minHeight="@dimen/app_widget_classic_min_height"
|
||||||
android:previewImage="@drawable/widget_classic"
|
android:previewImage="@drawable/widget_classic"
|
||||||
android:resizeMode="horizontal|vertical"
|
android:resizeMode="horizontal|vertical"
|
||||||
android:updatePeriodMillis="0"
|
android:updatePeriodMillis="0"
|
||||||
android:widgetCategory="keyguard|home_screen"
|
android:widgetCategory="keyguard|home_screen" />
|
||||||
tools:ignore="UnusedAttribute" />
|
|
|
@ -1,11 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:initialLayout="@layout/app_widget_small"
|
android:initialLayout="@layout/app_widget_small"
|
||||||
android:minWidth="@dimen/app_widget_small_min_width"
|
android:minWidth="@dimen/app_widget_small_min_width"
|
||||||
android:minHeight="@dimen/app_widget_small_min_height"
|
android:minHeight="@dimen/app_widget_small_min_height"
|
||||||
android:previewImage="@drawable/widget_small"
|
android:previewImage="@drawable/widget_small"
|
||||||
android:resizeMode="horizontal|vertical"
|
android:resizeMode="horizontal|vertical"
|
||||||
android:updatePeriodMillis="0"
|
android:updatePeriodMillis="0"
|
||||||
android:widgetCategory="keyguard|home_screen"
|
android:widgetCategory="keyguard|home_screen" />
|
||||||
tools:ignore="UnusedAttribute" />
|
|
|
@ -26,7 +26,6 @@ dependencies {
|
||||||
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
implementation "androidx.appcompat:appcompat:$appcompat_version"
|
||||||
implementation "com.google.android.material:material:$mdc_version"
|
implementation "com.google.android.material:material:$mdc_version"
|
||||||
implementation "androidx.preference:preference-ktx:$preference_version"
|
implementation "androidx.preference:preference-ktx:$preference_version"
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
|
||||||
|
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue