Add current song

This commit is contained in:
Tommaso Berlose
2020-05-08 15:10:19 +02:00
parent d86d2cadd4
commit 654ec3fe66
64 changed files with 623 additions and 22 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,5v8.55c-0.94,-0.54 -2.1,-0.75 -3.33,-0.32 -1.34,0.48 -2.37,1.67 -2.61,3.07 -0.46,2.74 1.86,5.08 4.59,4.65 1.96,-0.31 3.35,-2.11 3.35,-4.1V7h2c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2h-2c-1.1,0 -2,0.9 -2,2z"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M14,6L4,6c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h10c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1zM14,10L4,10c-0.55,0 -1,0.45 -1,1s0.45,1 1,1h10c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1zM4,16h6c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1L4,14c-0.55,0 -1,0.45 -1,1s0.45,1 1,1zM19,6c-1.1,0 -2,0.9 -2,2v6.18c-0.31,-0.11 -0.65,-0.18 -1,-0.18 -1.84,0 -3.28,1.64 -2.95,3.54 0.21,1.21 1.2,2.2 2.41,2.41 1.9,0.33 3.54,-1.11 3.54,-2.95L19,8h2c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1h-2z"/>
</vector>

View File

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel" />
<variable
name="isMusicVisible"
type="Boolean" />
</data>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView"
android:scrollbarThumbVertical="@color/colorPrimary"
android:background="@color/colorPrimaryDark">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_show_music"
android:orientation="horizontal">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:src="@drawable/round_music_note"
android:tint="@color/colorPrimaryText"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_show_music_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/show_music_label"
android:text="@string/settings_show_music_enabled_subtitle"
style="@style/AnotherWidget.Settings.Subtitle"/>
<com.google.android.material.button.MaterialButton
android:layout_width="wrap_content"
android:layout_height="36dp"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:letterSpacing="0"
android:textAllCaps="false"
android:clickable="true"
android:layout_marginStart="-8dp"
android:layout_marginBottom="-8dp"
android:paddingBottom="0dp"
android:paddingTop="0dp"
android:focusable="true"
android:visibility="gone"
android:id="@+id/notification_permission_alert"
android:textColor="@color/errorColorText"
android:text="@string/action_grant_permission"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/weather_settings"
android:alpha="@{isMusicVisible ? 1f : 0.2f, default=1}"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_music_info_format"
android:orientation="horizontal">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:src="@drawable/round_queue_music"
android:tint="@color/colorPrimaryText"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_song_info_format_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/label_music_info_format"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</layout>

View File

@ -102,6 +102,36 @@
android:layout_gravity="center_vertical"
android:id="@+id/action_next"
android:src="@drawable/round_chevron_right" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:visibility="gone"
android:id="@+id/special_weather">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:id="@+id/divider3"
android:text="@string/divider"
android:includeFontPadding="false"
style="@style/AnotherWidget.Subtitle"/>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="@+id/special_weather_icon"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Date.Big"
android:maxLines="1"
android:includeFontPadding="false"
android:id="@+id/special_temp"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"

View File

@ -129,6 +129,10 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:id="@+id/action_next_rect" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/special_weather_rect" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"

View File

@ -208,4 +208,10 @@
<string name="next_alarm_warning">The next alarm clock seems to be wrong.\nIt has been set by %s.</string>
<string name="settings_title">Settings</string>
<string name="settings_clock_text_color_title">Clock text color</string>
<string name="settings_music_title">Music</string>
<string name="settings_show_music_title">Show current playing song</string>
<string name="settings_show_music_enabled_subtitle">Playing song info visible</string>
<string name="settings_show_music_disabled_subtitle">Playing song info hidden</string>
<string name="settings_song_info_format_title">Song info format</string>
<string name="settings_request_notification_access">We need the notification access permission to check the current playing song.</string>
</resources>

View File

@ -188,4 +188,10 @@
<string name="next_alarm_warning">The next alarm clock seems to be wrong.\nIt has been set by %s.</string>
<string name="settings_title">Settings</string>
<string name="settings_clock_text_color_title">Clock text color</string>
<string name="settings_music_title">Music</string>
<string name="settings_show_music_title">Show current playing song</string>
<string name="settings_show_music_enabled_subtitle">Playing song info visible</string>
<string name="settings_show_music_disabled_subtitle">Playing song info hidden</string>
<string name="settings_song_info_format_title">Song info format</string>
<string name="settings_request_notification_access">We need the notification access permission to check the current playing song.</string>
</resources>

View File

@ -187,4 +187,10 @@
<string name="next_alarm_warning">La sveglia sembra impostata male.\nÈ stata impostata dall\'app %s.</string>
<string name="settings_title">Impostazioni</string>
<string name="settings_clock_text_color_title">Colore orologio</string>
<string name="settings_music_title">Musica</string>
<string name="settings_show_music_title">Mostra brano in riproduzione</string>
<string name="settings_show_music_enabled_subtitle">Visibile</string>
<string name="settings_show_music_disabled_subtitle">Non visibile</string>
<string name="settings_song_info_format_title">Formato informazioni brano</string>
<string name="settings_request_notification_access">Concedi all\'app il permesso di monitorare le notifiche, è necessario per poter mostrare il brano in riproduzione.</string>
</resources>

View File

@ -199,4 +199,10 @@
<string name="next_alarm_warning">The next alarm clock seems to be wrong.\nIt has been set by %s.</string>
<string name="settings_title">Settings</string>
<string name="settings_clock_text_color_title">Clock text color</string>
<string name="settings_music_title">Music</string>
<string name="settings_show_music_title">Show current playing song</string>
<string name="settings_show_music_enabled_subtitle">Playing song info visible</string>
<string name="settings_show_music_disabled_subtitle">Playing song info hidden</string>
<string name="settings_song_info_format_title">Song info format</string>
<string name="settings_request_notification_access">We need the notification access permission to check the current playing song.</string>
</resources>