Feat: Basic starter to add Widget support.

This commit is contained in:
HeCodes2Much
2024-05-22 16:43:09 +01:00
parent 364fe2bb7c
commit a3c4e6f0af
16 changed files with 382 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/draw_background"
tools:context=".ui.widgetmanager.WidgetManagerFragment">
<FrameLayout
android:id="@+id/widget_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:longClickable="true"
android:orientation="vertical"
android:padding="16dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/widget_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"/>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/widget_frame"
android:padding="8dp"/>

View File

@@ -0,0 +1,29 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<Button
android:id="@+id/button_open_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Open App"
android:textColor="?attr/colorPrimary"
android:backgroundTint="?attr/colorAccent"
app:backgroundTint="?attr/colorAccent"
app:rippleColor="?attr/colorAccent" />
<Button
android:id="@+id/button_remove_widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Remove Widget"
android:textColor="?attr/colorPrimary"
android:backgroundTint="?attr/colorAccent"
app:backgroundTint="?attr/colorAccent"
app:rippleColor="?attr/colorAccent" />
</LinearLayout>