Add timetable widget (#84)
This commit is contained in:

committed by
Mikołaj Pich

parent
6927ac0e4f
commit
6fcf09e2b7
75
app/src/main/res/layout/timetable_widget.xml
Normal file
75
app/src/main/res/layout/timetable_widget.xml
Normal file
@ -0,0 +1,75 @@
|
||||
<?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="match_parent"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/widget_bar_height"
|
||||
android:background="@color/colorPrimary">
|
||||
|
||||
<Button
|
||||
android:id="@+id/timetable_widget_toggle"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:backgroundTint="@color/colorPrimaryDark"
|
||||
android:text="@string/widget_timetable_today"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_toEndOf="@id/timetable_widget_title"
|
||||
android:layout_toRightOf="@id/timetable_widget_title"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/widget_bar_height"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toLeftOf="@id/timetable_widget_toggle"
|
||||
android:layout_toStartOf="@id/timetable_widget_toggle"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/timetable_text"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="20sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/timetable_widget_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/widget_bar_height" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_empty"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/widget_timetable_no_lesson"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="20sp" />
|
||||
</FrameLayout>
|
67
app/src/main/res/layout/timetable_widget_item.xml
Normal file
67
app/src/main/res/layout/timetable_widget_item.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/timetable_widget_item_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="45dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_item_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/second_text_color"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_item_subject"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="25dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toEndOf="@id/timetable_widget_item_time"
|
||||
android:layout_toRightOf="@id/timetable_widget_item_time"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/second_text_color"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_item_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/timetable_widget_item_subject"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="25dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_toEndOf="@id/timetable_widget_item_time"
|
||||
android:layout_toRightOf="@id/timetable_widget_item_time"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/colorPrimaryDark"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timetable_widget_item_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/timetable_widget_item_time"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/second_text_color"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
Reference in New Issue
Block a user