feat: currently airing widget

This commit is contained in:
rebelonion 2024-03-25 21:20:17 -05:00
parent 95cddbd409
commit df23b2f62f
15 changed files with 446 additions and 182 deletions

View file

@ -4,5 +4,5 @@
<gradient
android:angle="270"
android:endColor="@color/grey_20"
android:startColor="#B313DC" />
android:startColor="@color/theme"/>
</shape>

View file

@ -20,8 +20,8 @@
<ImageView
android:id="@+id/logoView"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:foregroundGravity="center_vertical"
@ -31,20 +31,24 @@
<TextView
android:id="@+id/widgetTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="0dp"
android:layout_toEndOf="@+id/logoView"
android:gravity="center_vertical"
android:gravity="center_vertical|start"
android:textAlignment="viewStart"
android:maxLines="1"
android:ellipsize="end"
android:text="@string/currently_airing"
android:textSize="18sp"
android:textSize="20sp"
android:textStyle="bold" />
<ListView
android:id="@+id/widgetListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:layout_below="@id/widgetTitle" />
<TextView
@ -52,6 +56,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:maxLines="1"
android:ellipsize="end"
android:text="@string/no_shows_to_display"
android:textColor="#ffffff"
android:textSize="20sp"

View file

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="16dp">
@ -9,14 +10,103 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:labelFor="@id/appwidget_text"
android:text="@string/configure" />
<EditText
android:id="@+id/appwidget_text"
<Button
android:id="@+id/topBackgroundButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
android:layout_height="64dp"
android:layout_marginStart="-31dp"
android:layout_marginEnd="-31dp"
android:background="@drawable/ui_bg"
android:backgroundTint="?attr/colorSecondary"
android:backgroundTintMode="src_atop"
android:fontFamily="@font/poppins_bold"
android:insetTop="0dp"
android:insetBottom="0dp"
android:paddingStart="31dp"
android:paddingEnd="31dp"
android:text="@string/top_background_color"
android:textAlignment="viewStart"
android:textAllCaps="false"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:icon="@drawable/ic_round_color_picker_24"
app:iconPadding="16dp"
app:iconSize="24dp"
app:iconTint="?attr/colorPrimary" />
<Button
android:id="@+id/bottomBackgroundButton"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginStart="-31dp"
android:layout_marginEnd="-31dp"
android:background="@drawable/ui_bg"
android:backgroundTint="?attr/colorSecondary"
android:backgroundTintMode="src_atop"
android:fontFamily="@font/poppins_bold"
android:insetTop="0dp"
android:insetBottom="0dp"
android:paddingStart="31dp"
android:paddingEnd="31dp"
android:text="@string/bottom_background_color"
android:textAlignment="viewStart"
android:textAllCaps="false"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:icon="@drawable/ic_round_color_picker_24"
app:iconPadding="16dp"
app:iconSize="24dp"
app:iconTint="?attr/colorPrimary" />
<Button
android:id="@+id/titleColorButton"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginStart="-31dp"
android:layout_marginEnd="-31dp"
android:background="@drawable/ui_bg"
android:backgroundTint="?attr/colorSecondary"
android:backgroundTintMode="src_atop"
android:fontFamily="@font/poppins_bold"
android:insetTop="0dp"
android:insetBottom="0dp"
android:paddingStart="31dp"
android:paddingEnd="31dp"
android:text="@string/title_color"
android:textAlignment="viewStart"
android:textAllCaps="false"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:icon="@drawable/ic_round_color_picker_24"
app:iconPadding="16dp"
app:iconSize="24dp"
app:iconTint="?attr/colorPrimary" />
<Button
android:id="@+id/countdownColorButton"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_marginStart="-31dp"
android:layout_marginEnd="-31dp"
android:background="@drawable/ui_bg"
android:backgroundTint="?attr/colorSecondary"
android:backgroundTintMode="src_atop"
android:fontFamily="@font/poppins_bold"
android:insetTop="0dp"
android:insetBottom="0dp"
android:paddingStart="31dp"
android:paddingEnd="31dp"
android:text="@string/countdown_text_color"
android:textAlignment="viewStart"
android:textAllCaps="false"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:icon="@drawable/ic_round_color_picker_24"
app:iconPadding="16dp"
app:iconSize="24dp"
app:iconTint="?attr/colorPrimary" />
<Button
android:id="@+id/add_button"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="8dp">
@ -9,9 +11,10 @@
<ImageView
android:id="@+id/image_show_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/airing_image"
android:src="@drawable/ic_launcher_foreground" />
android:layout_height="wrap_content"
app:shapeAppearanceOverlay="@style/roundedImageView"
android:contentDescription="@string/airing_image"/>
<LinearLayout
android:layout_width="0dp"
@ -25,8 +28,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_bold"
android:text="Placeholder Title"
android:text=""
android:textColor="@color/bg_white"
android:maxLines="3"
android:ellipsize="end"
android:textSize="16sp" />
<TextView
@ -34,8 +39,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins"
android:text="Placeholder Countdown"
android:textColor="@color/grey_60"
android:text=""
android:textColor="@color/bg_white"
android:textSize="14sp" />
</LinearLayout>

View file

@ -19,6 +19,7 @@
<color name="button_icon">#A9FFFFFF</color>
<color name="nav_status">#80FFFFFF</color>
<color name="fav">#ad5edd</color>
<color name="theme">#B313DC</color>
<color name="incognito">#291B65</color>
<color name="filler">#54FF8400</color>
<color name="warning">#FF0000</color>

View file

@ -11,7 +11,7 @@
<string name="discord" translatable="false">https://discord.gg/4HPZ5nAWwM</string>
<string name="github" translatable="false">https://github.com/rebelonion/Dantotsu</string>
<string name="telegram" tools:ignore="Typos" translatable="false">https://t.me/+gzBCQExtLQo1YTNh </string>
<string name="telegram" translatable="false" tools:ignore="Typos">https://t.me/+gzBCQExtLQo1YTNh </string>
<string name="coffee" translatable="false">https://www.buymeacoffee.com/rebelonion</string>
<string name="home">Home</string>
@ -811,4 +811,9 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="donate">donate :)</string>
<string name="do_it">Do it!</string>
<string name="password">Password</string>
<string name="top_background_color">Top background color</string>
<string name="bottom_background_color">Bottom Background Color</string>
<string name="countdown_text_color">Countdown Text Color</string>
<string name="title_color">Title Color</string>
<string name="placeholder">Placeholder</string>
</resources>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/app_widget_description"
android:configure="ani.dantotsu.widgets.CurrentlyAiringWidgetConfigureActivity"
android:initialKeyguardLayout="@layout/currently_airing_widget"
android:initialLayout="@layout/currently_airing_widget"
android:minWidth="160dp"
@ -8,7 +9,5 @@
android:previewImage="@drawable/example_appwidget_preview"
android:previewLayout="@layout/currently_airing_widget"
android:resizeMode="horizontal|vertical"
android:targetCellWidth="1"
android:targetCellHeight="1"
android:updatePeriodMillis="86400000"
android:widgetCategory="home_screen"></appwidget-provider>
android:updatePeriodMillis="3600000"
android:widgetCategory="home_screen"/>

View file

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/app_widget_description"
android:configure="ani.dantotsu.widgets.CurrentlyAiringWidgetConfigureActivity"
android:initialKeyguardLayout="@layout/currently_airing_widget"
android:initialLayout="@layout/currently_airing_widget"
android:minWidth="160dp"
android:minHeight="160dp"
android:previewImage="@drawable/example_appwidget_preview"
android:resizeMode="horizontal|vertical"
android:updatePeriodMillis="86400000"
android:widgetCategory="home_screen"></appwidget-provider>
android:updatePeriodMillis="3600000"
android:widgetCategory="home_screen"/>