Implemented Cards for Canteen
This commit is contained in:
9
app/src/main/res/drawable/arrow_down.xml
Normal file
9
app/src/main/res/drawable/arrow_down.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M7.41,7.84L12,12.42l4.59,-4.58L18,9.25l-6,6 -6,-6z"/>
|
||||
</vector>
|
||||
81
app/src/main/res/layout/expandable_cardview.xml
Normal file
81
app/src/main/res/layout/expandable_cardview.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView android:id="@+id/card"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/default_vertical_padding"
|
||||
android:paddingBottom="@dimen/default_vertical_padding"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<LinearLayout
|
||||
android:id="@+id/viewContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_card_height"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/default_card_height"
|
||||
android:id="@+id/header"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<!--<ImageButton
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/FUTheme.itemTitle"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:maxLines="1"
|
||||
android:maxLength="39"
|
||||
android:layout_toEndOf="@+id/icon"
|
||||
android:layout_toRightOf="@+id/icon" />
|
||||
<!-
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
-->
|
||||
|
||||
<ViewStub
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/headerStub"
|
||||
android:inflatedId="@+id/outerView"
|
||||
android:layout_toLeftOf="@id/arrow"
|
||||
android:layout_toStartOf="@id/arrow"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/arrow_down"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ViewStub
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/viewStub"
|
||||
android:inflatedId="@+id/innerView"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
17
app/src/main/res/layout/list_canteen_header.xml
Normal file
17
app/src/main/res/layout/list_canteen_header.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/FUTheme.itemTitle" />
|
||||
<TextView
|
||||
android:id="@+id/sub_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
style="@style/FUTheme.itemValue" />
|
||||
</RelativeLayout>
|
||||
@@ -1,51 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView
|
||||
<de.sebse.fuplanner.tools.ui.cardview.ExpandableCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/profile"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dip"
|
||||
android:layout_margin="5dip">
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:typeface="sans"
|
||||
tools:text="Test this new stuff!" />
|
||||
app:title="Passengers"
|
||||
app:outer_view="@layout/list_canteen_header"
|
||||
app:inner_view="@layout/list_all_show_more"
|
||||
app:expandOnClick="true"
|
||||
app:animationDuration="300"
|
||||
app:startExpanded="false" />
|
||||
<!--
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sub_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_marginTop="5dip"
|
||||
android:textColor="#343434"
|
||||
android:textSize="12sp"
|
||||
tools:text="Peter Bauer" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sub_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBaseline="@id/sub_left"
|
||||
android:layout_alignBottom="@id/sub_left"
|
||||
android:textColor="#343434"
|
||||
android:textSize="12sp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
tools:text="20.03.18 18:42 Uhr" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/top_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBaseline="@id/title"
|
||||
android:layout_alignBottom="@id/title"
|
||||
android:textColor="#343434"
|
||||
android:textSize="12sp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
tools:text="Raum 105"
|
||||
tools:ignore="RelativeOverlap" />
|
||||
</android.support.v7.widget.CardView>
|
||||
app:icon="@drawable/ic_event"
|
||||
-->
|
||||
@@ -62,4 +62,13 @@
|
||||
<attr name="dropListenerEnabled" format="boolean" />
|
||||
<attr name="defaultEventColor" format="color" />
|
||||
</declare-styleable>
|
||||
<declare-styleable name="ExpandableCardView">
|
||||
<attr name="title" format="string"/>
|
||||
<attr name="icon" format="reference"/>
|
||||
<attr name="outer_view" format="reference"/>
|
||||
<attr name="inner_view" format="reference"/>
|
||||
<attr name="expandOnClick" format="boolean"/>
|
||||
<attr name="animationDuration" format="integer"/>
|
||||
<attr name="startExpanded" format="boolean"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
|
||||
@@ -5,4 +5,8 @@
|
||||
<dimen name="nav_header_vertical_spacing">16dp</dimen>
|
||||
<dimen name="nav_header_height">170dp</dimen>
|
||||
<dimen name="text_margin">16dp</dimen>
|
||||
|
||||
|
||||
<dimen name="default_card_height">50dp</dimen>
|
||||
<dimen name="default_vertical_padding">10dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -20,4 +20,14 @@
|
||||
<item name="colorAccent">@color/colorFUBlue</item>
|
||||
</style>
|
||||
|
||||
<style name="FUTheme.itemTitle">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">@android:color/primary_text_light</item>
|
||||
</style>
|
||||
<style name="FUTheme.itemValue">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">#343434</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user