Feat: Basic starter to add Widget support.
This commit is contained in:
26
app/src/main/res/layout/fragment_widget_manager.xml
Normal file
26
app/src/main/res/layout/fragment_widget_manager.xml
Normal 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>
|
||||
6
app/src/main/res/layout/item_widget.xml
Normal file
6
app/src/main/res/layout/item_widget.xml
Normal 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"/>
|
||||
29
app/src/main/res/layout/widget_options_dialog.xml
Normal file
29
app/src/main/res/layout/widget_options_dialog.xml
Normal 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>
|
||||
Reference in New Issue
Block a user