forked from firka/student-legacy
widget impl
This commit is contained in:
parent
48fa36c928
commit
af3ab5ec65
@ -18,6 +18,34 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<meta-data android:name="flutterEmbedding" android:value="2" />
|
||||
|
||||
<receiver android:name=".widget_timetable.WidgetTimetable"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_LEFT" />
|
||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_RIGHT" />
|
||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_TODAY" />
|
||||
<action android:name="list_widget.ACTION_WIDGET_CLICK_NAV_REFRESH" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/home_widget_test_info" />
|
||||
</receiver>
|
||||
|
||||
<service android:name=".widget_timetable.WidgetTimetableService"
|
||||
android:permission="android.permission.BIND_REMOTEVIEWS" />
|
||||
|
||||
<receiver android:name="es.antonborri.home_widget.HomeWidgetBackgroundReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="es.antonborri.home_widget.action.BACKGROUND" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service android:name="es.antonborri.home_widget.HomeWidgetBackgroundService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE" android:exported="true" />
|
||||
</application>
|
||||
|
||||
<!-- Permissions -->
|
||||
|
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M20,6l-11,11l-5,-5"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M15,18l-6,-6l6,-6"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M9,18l6,-6l-6,-6"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,2.69l5.66,5.66a8,8 0,1 1,-11.31 0z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M12,2l7,19l-7,-4l-7,4l7,-19z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -0,0 +1,27 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M23,4l0,6l-6,0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M1,20l0,-6l6,0"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M3.51,9a9,9 0,0 1,14.85 -3.36L23,10M1,14l4.64,4.36A9,9 0,0 0,20.49 15"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#ff141516"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Background for widgets to make the rounded corners based on the
|
||||
appWidgetRadius attribute value
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="?attr/appWidgetRadius" />
|
||||
<solid android:color="?android:attr/colorBackground" />
|
||||
</shape>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Background for views inside widgets to make the rounded corners based on the
|
||||
appWidgetInnerRadius attribute value
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="?attr/appWidgetInnerRadius" />
|
||||
<solid android:color="?android:attr/colorAccent" />
|
||||
</shape>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/white"/>
|
||||
<stroke android:width="1dp" android:color="#D8E0E1" />
|
||||
<corners android:radius="10dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#00FFFFFF"/>
|
||||
<corners android:radius="10dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/light_red"/>
|
||||
<corners android:radius="10dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/light_yellow"/>
|
||||
<corners android:radius="10dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/highlight_light"/>
|
||||
<stroke android:width="1dp" android:color="@color/highlight_light" />
|
||||
<corners android:bottomLeftRadius="14dp" android:bottomRightRadius="14dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/highlight"/>
|
||||
<stroke android:width="1dp" android:color="@color/highlight" />
|
||||
<corners android:bottomLeftRadius="14dp" android:bottomRightRadius="14dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/highlight_light"/>
|
||||
<stroke android:width="1dp" android:color="@color/highlight_light" />
|
||||
<corners android:topLeftRadius="14dp" android:topRightRadius="14dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/highlight"/>
|
||||
<stroke android:width="1dp" android:color="@color/highlight" />
|
||||
<corners android:topLeftRadius="14dp" android:topRightRadius="14dp"/>
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"/>
|
||||
</shape>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<!--<gradient
|
||||
android:angle="45"
|
||||
android:endColor="@color/filc"
|
||||
android:startColor="@color/filc" />-->
|
||||
|
||||
<solid android:color="@color/highlight_light"/>
|
||||
|
||||
<corners android:radius="12dp" />
|
||||
<size android:width="2dp"/>
|
||||
<padding
|
||||
android:left="0.5dp"
|
||||
android:right="0.5dp" />
|
||||
|
||||
</shape>
|
BIN
filcnaplo/android/app/src/main/res/font/montserrat_medium.ttf
Normal file
BIN
filcnaplo/android/app/src/main/res/font/montserrat_medium.ttf
Normal file
Binary file not shown.
@ -0,0 +1,26 @@
|
||||
|
||||
<LinearLayout 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:layout_margin="8dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/app_widget_background"
|
||||
android:padding="8dp"
|
||||
android:id="@+id/widget_container">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/widget_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="36sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/widget_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
tools:text="Message" />
|
||||
</LinearLayout>
|
105
filcnaplo/android/app/src/main/res/layout/timetable_item.xml
Normal file
105
filcnaplo/android/app/src/main/res/layout/timetable_item.xml
Normal file
@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/main_lay"
|
||||
android:layout_height="50dp"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:layout_marginTop="2.5dp"
|
||||
android:layout_marginBottom="2.5dp"
|
||||
android:layout_marginLeft="7.5dp"
|
||||
android:layout_marginRight="7.5dp"
|
||||
android:background="@drawable/card_layout_tile">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tt_item_num"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:text="1."
|
||||
android:gravity="center"
|
||||
android:textColor="@color/filc"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tt_item_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:textSize="15.5sp"
|
||||
android:textFontWeight="700"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:layout_marginTop="2.5dp"
|
||||
android:text="Óra neve"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_toLeftOf="@id/tt_item_room"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_toRightOf="@id/tt_item_num"
|
||||
android:textColor="@color/text"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tt_item_name_nodesc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="15.5sp"
|
||||
android:textStyle="bold"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="2.5dp"
|
||||
android:layout_toLeftOf="@id/tt_item_room"
|
||||
android:text="Óra neve"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_toRightOf="@id/tt_item_num"
|
||||
android:textColor="@color/text"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tt_item_desc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:textFontWeight="600"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:text="Óra leírása"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_toRightOf="@id/tt_item_num"
|
||||
android:layout_toLeftOf="@id/tt_item_room"
|
||||
android:layout_below="@id/tt_item_name"
|
||||
android:textColor="@color/text_desc"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tt_item_room"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="14sp"
|
||||
android:textFontWeight="500"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:textStyle="bold"
|
||||
android:text="56."
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:gravity="center"
|
||||
android:layout_toLeftOf="@id/tt_item_time"
|
||||
android:textColor="@color/text_desc"></TextView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tt_item_time"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="14sp"
|
||||
android:textFontWeight="500"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginTop="-2dp"
|
||||
android:text="8:30\n9:10"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentRight="true"
|
||||
android:textColor="@color/white"></TextView>
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,99 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_margin="@dimen/widget_margin">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Empty"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/tt_grid_cont"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="#00000000"
|
||||
android:background="@drawable/card_layout_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/widget_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/bottom_nav"
|
||||
android:layout_marginTop="-8dp"
|
||||
android:background="@drawable/widget_card_bottom_dark"
|
||||
android:divider="#00000000"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:scrollbarFadeDuration="150"
|
||||
android:scrollbarSize="10dp"
|
||||
android:scrollbarThumbVertical="@drawable/widget_scroll_style" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/bottom_nav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:background="@drawable/widget_card_top_dark">
|
||||
<ImageView
|
||||
android:id="@+id/nav_refresh"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_refresh_cw"
|
||||
android:layout_toLeftOf="@id/nav_to_left"
|
||||
android:tint="@color/text_desc"
|
||||
tools:ignore="UseAppTint"
|
||||
android:padding="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/nav_to_left"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_chevron_left"
|
||||
android:layout_toLeftOf="@id/nav_to_right"
|
||||
android:tint="@color/text_desc"
|
||||
tools:ignore="UseAppTint"
|
||||
android:padding="10dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/nav_to_right"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_chevron_right"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:tint="@color/text_desc"
|
||||
tools:ignore="UseAppTint"
|
||||
android:padding="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nav_current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20sp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="Unknown"
|
||||
android:fontFamily="@font/montserrat_medium"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/nav_refresh"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--
|
||||
Having themes.xml for night-v31 because of the priority order of the resource qualifiers.
|
||||
-->
|
||||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
|
||||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
||||
</style>
|
||||
</resources>
|
12
filcnaplo/android/app/src/main/res/values-v21/styles.xml
Normal file
12
filcnaplo/android/app/src/main/res/values-v21/styles.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_background</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_inner_view_background</item>
|
||||
</style>
|
||||
</resources>
|
14
filcnaplo/android/app/src/main/res/values-v31/styles.xml
Normal file
14
filcnaplo/android/app/src/main/res/values-v31/styles.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_background</item>
|
||||
<item name="android:clipToOutline">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||
<item name="android:padding">?attr/appWidgetPadding</item>
|
||||
<item name="android:background">@drawable/app_widget_inner_view_background</item>
|
||||
<item name="android:clipToOutline">true</item>
|
||||
</style>
|
||||
</resources>
|
11
filcnaplo/android/app/src/main/res/values-v31/themes.xml
Normal file
11
filcnaplo/android/app/src/main/res/values-v31/themes.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--
|
||||
Having themes.xml for v31 variant because @android:dimen/system_app_widget_background_radius
|
||||
and @android:dimen/system_app_widget_internal_padding requires API level 31
|
||||
-->
|
||||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||
<item name="appWidgetRadius">@android:dimen/system_app_widget_background_radius</item>
|
||||
<item name="appWidgetInnerRadius">@android:dimen/system_app_widget_inner_radius</item>
|
||||
</style>
|
||||
</resources>
|
7
filcnaplo/android/app/src/main/res/values/attrs.xml
Normal file
7
filcnaplo/android/app/src/main/res/values/attrs.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<resources>
|
||||
<declare-styleable name="AppWidgetAttrs">
|
||||
<attr name="appWidgetPadding" format="dimension" />
|
||||
<attr name="appWidgetInnerRadius" format="dimension" />
|
||||
<attr name="appWidgetRadius" format="dimension" />
|
||||
</declare-styleable>
|
||||
</resources>
|
@ -1,4 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#1F5B50</color>
|
||||
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="light_blue_50">#FFE1F5FE</color>
|
||||
<color name="light_blue_200">#FF81D4FA</color>
|
||||
<color name="light_blue_600">#FF039BE5</color>
|
||||
<color name="light_blue_900">#FF01579B</color>
|
||||
|
||||
<color name="shadow_light">#ffE8E8E8</color>
|
||||
<color name="text_light">#000000</color>
|
||||
<color name="text_desc_light">#B9B9B9</color>
|
||||
<color name="text_desc_dark_light">#B9B9B9</color>
|
||||
<color name="text_miss_light">#888C8F</color>
|
||||
<color name="background_light">#ffF4F9FF</color>
|
||||
<color name="highlight_light">#ffFFFFFF</color>
|
||||
<color name="red_light">#ffFF3B30</color>
|
||||
<color name="light_red_light">#40FF3B30</color>
|
||||
<color name="orange_light">#ffFF9500</color>
|
||||
<color name="yellow_light">#ffFFCC00</color>
|
||||
<color name="light_yellow_light">#40FFD60A</color>
|
||||
<color name="green_light">#ff34C759</color>
|
||||
<color name="filc_light">#ff247665</color>
|
||||
<color name="teal_light">#ff5AC8FA</color>
|
||||
<color name="blue_light">#ff007AFF</color>
|
||||
<color name="indigo_light">#ff5856D6</color>
|
||||
<color name="purple_light">#ffAF52DE</color>
|
||||
<color name="pink_light">#ffFF2D55</color>
|
||||
|
||||
<!-- dark -->
|
||||
|
||||
<color name="shadow">#000</color>
|
||||
<color name="text">#FFFFFFFF</color>
|
||||
<color name="text_desc">#B9B9B9</color>
|
||||
<color name="text_miss">#93979A</color>
|
||||
<color name="text_miss_num">#A1A5A8</color>
|
||||
<color name="background">#ff000000</color>
|
||||
<color name="highlight">#ff141516</color>
|
||||
<color name="red">#ffFF453A</color>
|
||||
<color name="light_red">#40FF453A</color>
|
||||
<color name="orange">#ffFF9F0A</color>
|
||||
<color name="yellow">#ffFFD60A</color>
|
||||
<color name="light_yellow">#40FFD60A</color>
|
||||
<color name="green">#ff32D74B</color>
|
||||
<color name="filc">#ff29826F</color>
|
||||
<color name="teal">#ff64D2FF</color>
|
||||
<color name="blue">#ff0A84FF</color>
|
||||
<color name="indigo">#ff5E5CE6</color>
|
||||
<color name="purple">#ffBF5AF2</color>
|
||||
<color name="pink">#ffFF375F</color>
|
||||
|
||||
<color name="blue_shade300">#FF64B5F6</color>
|
||||
<color name="green_shade300">#FF81C784</color>
|
||||
<color name="lime_shade300">#FFDCE775</color>
|
||||
<color name="yellow_shade300">#FFFFF176</color>
|
||||
<color name="orange_shade300">#FFFF8A65</color>
|
||||
<color name="red_shade300">#FFE57373</color>
|
||||
<color name="pink_shade300">#FFF06292</color>
|
||||
<color name="purple_shade300">#FFBA68C8</color>
|
||||
</resources>
|
10
filcnaplo/android/app/src/main/res/values/dimens.xml
Normal file
10
filcnaplo/android/app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Refer to App Widget Documentation for margin information
|
||||
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
||||
-->
|
||||
<dimen name="widget_margin">0dp</dimen>
|
||||
|
||||
</resources>
|
6
filcnaplo/android/app/src/main/res/values/strings.xml
Normal file
6
filcnaplo/android/app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="appwidget_text">Órarend Widget</string>
|
||||
<string name="add_widget">Add widget</string>
|
||||
<string name="app_widget_description">Mindig lásd, milyen órád lesz, a kezdőképernyőd kényelméből.</string>
|
||||
</resources>
|
@ -16,4 +16,14 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.Container" parent="android:Widget">
|
||||
<item name="android:id">@android:id/background</item>
|
||||
<item name="android:background">?android:attr/colorBackground</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Android.AppWidget.InnerView" parent="android:Widget">
|
||||
<item name="android:background">?android:attr/colorBackground</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||
</style>
|
||||
</resources>
|
16
filcnaplo/android/app/src/main/res/values/themes.xml
Normal file
16
filcnaplo/android/app/src/main/res/values/themes.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<resources>
|
||||
<style name="Theme.Android.AppWidgetContainerParent" parent="@android:style/Theme.DeviceDefault">
|
||||
<!-- Radius of the outer bound of widgets to make the rounded corners -->
|
||||
<item name="appWidgetRadius">16dp</item>
|
||||
<!--
|
||||
Radius of the inner view's bound of widgets to make the rounded corners.
|
||||
It needs to be 8dp or less than the value of appWidgetRadius
|
||||
-->
|
||||
<item name="appWidgetInnerRadius">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Android.AppWidgetContainer" parent="Theme.Android.AppWidgetContainerParent">
|
||||
<!-- Apply padding to avoid the content of the widget colliding with the rounded corners -->
|
||||
<item name="appWidgetPadding">16dp</item>
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,13 @@
|
||||
<?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:initialKeyguardLayout="@layout/widget_timetable"
|
||||
android:initialLayout="@layout/widget_timetable"
|
||||
android:minWidth="250dp"
|
||||
android:minHeight="110dp"
|
||||
android:previewImage="@drawable/timetable_widget_preview"
|
||||
android:resizeMode="horizontal|vertical"
|
||||
android:targetCellWidth="2"
|
||||
android:targetCellHeight="2"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:widgetCategory="home_screen" />
|
@ -1,5 +1,7 @@
|
||||
// ignore_for_file: use_build_context_synchronously
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/status_provider.dart';
|
||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||
@ -69,7 +71,7 @@ Future<void> syncAll(BuildContext context) {
|
||||
|
||||
Future<bool?> updateWidget() async {
|
||||
try {
|
||||
return HomeWidget.updateWidget(name: 'WidgetTimetable.widget_timetable');
|
||||
return HomeWidget.updateWidget(name: 'widget_timetable.WidgetTimetable');
|
||||
} on PlatformException catch (exception) {
|
||||
debugPrint('Error Updating Widget. $exception');
|
||||
}
|
||||
@ -81,6 +83,6 @@ Future<void> syncAll(BuildContext context) {
|
||||
lock = false;
|
||||
|
||||
// Update Widget
|
||||
updateWidget();
|
||||
if (Platform.isAndroid) updateWidget();
|
||||
});
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ const settingsDB = DatabaseStruct("settings", {
|
||||
"x_filc_id": String, "graph_class_avg": int, "presentation_mode": int, "bell_delay": int, "bell_delay_enabled": int,
|
||||
"grade_opening_fun": int, "icon_pack": String, "premium_scopes": String, "premium_token": String, "last_account_id": String,
|
||||
});
|
||||
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
||||
// YOU'VE BEEN WARNED!!!
|
||||
const usersDB = DatabaseStruct("users", {
|
||||
"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int,
|
||||
"nickname": String // premium only
|
||||
@ -60,7 +62,7 @@ Future<Database> initDB(DatabaseProvider database) async {
|
||||
await migrateDB(
|
||||
db,
|
||||
struct: usersDB,
|
||||
defaultValues: {"role": 0},
|
||||
defaultValues: {"role": 0, "nickname": ""},
|
||||
);
|
||||
await migrateDB(db, struct: userDataDB, defaultValues: {
|
||||
"grades": "[]", "timetable": "[]", "exams": "[]", "homework": "[]", "messages": "[]", "notes": "[]", "events": "[]", "absences": "[]",
|
||||
|
Loading…
x
Reference in New Issue
Block a user