mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-24 04:20:07 +01:00
use rounded corners at the widget background
This commit is contained in:
parent
b48e3432df
commit
ae0ac64278
@ -57,7 +57,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.26.8'
|
implementation 'com.simplemobiletools:commons:5.26.9'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
||||||
|
|
||||||
kapt 'androidx.room:room-compiler:2.2.5'
|
kapt 'androidx.room:room-compiler:2.2.5'
|
||||||
|
@ -78,12 +78,7 @@ class WidgetConfigureActivity : SimpleActivity() {
|
|||||||
mTextColor = extras?.getInt(CUSTOMIZED_WIDGET_TEXT_COLOR) ?: config.widgetTextColor
|
mTextColor = extras?.getInt(CUSTOMIZED_WIDGET_TEXT_COLOR) ?: config.widgetTextColor
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mBgColor == 1) {
|
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
|
||||||
mBgColor = Color.BLACK
|
|
||||||
mBgAlpha = .2f
|
|
||||||
} else {
|
|
||||||
mBgAlpha = Color.alpha(mBgColor) / 255f
|
|
||||||
}
|
|
||||||
|
|
||||||
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
|
||||||
config_bg_seekbar.apply {
|
config_bg_seekbar.apply {
|
||||||
|
@ -7,8 +7,8 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.widget.RemoteViews
|
import android.widget.RemoteViews
|
||||||
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
import com.simplemobiletools.commons.extensions.getLaunchIntent
|
import com.simplemobiletools.commons.extensions.getLaunchIntent
|
||||||
import com.simplemobiletools.commons.extensions.setBackgroundColor
|
|
||||||
import com.simplemobiletools.commons.helpers.WIDGET_TEXT_COLOR
|
import com.simplemobiletools.commons.helpers.WIDGET_TEXT_COLOR
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.notes.pro.R
|
import com.simplemobiletools.notes.pro.R
|
||||||
@ -31,7 +31,7 @@ class MyWidgetProvider : AppWidgetProvider() {
|
|||||||
for (widgetId in appWidgetIds) {
|
for (widgetId in appWidgetIds) {
|
||||||
val widget = context.widgetsDB.getWidgetWithWidgetId(widgetId) ?: continue
|
val widget = context.widgetsDB.getWidgetWithWidgetId(widgetId) ?: continue
|
||||||
val views = RemoteViews(context.packageName, R.layout.widget)
|
val views = RemoteViews(context.packageName, R.layout.widget)
|
||||||
views.setBackgroundColor(R.id.notes_widget_holder, widget.widgetBgColor)
|
views.applyColorFilter(R.id.notes_widget_background, widget.widgetBgColor)
|
||||||
setupAppOpenIntent(context, views, R.id.notes_widget_holder, widget)
|
setupAppOpenIntent(context, views, R.id.notes_widget_holder, widget)
|
||||||
|
|
||||||
Intent(context, WidgetService::class.java).apply {
|
Intent(context, WidgetService::class.java).apply {
|
||||||
@ -60,4 +60,4 @@ class MyWidgetProvider : AppWidgetProvider() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/notes_widget_holder"
|
android:id="@+id/notes_widget_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/notes_widget_background"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/notes_widget_listview"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:src="@drawable/widget_round_background" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/notes_widget_listview"
|
android:id="@+id/notes_widget_listview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:divider="@null"/>
|
android:divider="@null" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/widget_text_holder"
|
android:id="@+id/widget_text_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@ -12,7 +11,7 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
android:padding="@dimen/small_margin"
|
android:padding="@dimen/small_margin"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/widget_text_center"
|
android:id="@+id/widget_text_center"
|
||||||
@ -21,7 +20,7 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:padding="@dimen/small_margin"
|
android:padding="@dimen/small_margin"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/widget_text_right"
|
android:id="@+id/widget_text_right"
|
||||||
@ -30,6 +29,6 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:padding="@dimen/small_margin"
|
android:padding="@dimen/small_margin"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user