Mise en place new look sur la vue de detail

This commit is contained in:
Jacques Foucry 2016-05-20 17:47:37 +02:00
parent 19a9850f37
commit 0e84ec6ab6
7 changed files with 148 additions and 12 deletions

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- Gradient Bg for listrow -->
<gradient
android:startColor="#f1f1f2"
android:centerColor="#e7e7e8"
android:endColor="#cfcfcf"
android:angle="270" />
</shape>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- Gradient BgColor for listrow Selected -->
<gradient
android:startColor="#18d7e5"
android:centerColor="#16cedb"
android:endColor="#09adb9"
android:angle="270" />
</shape>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Selector style for listrow -->
<item android:state_pressed="false" android:state_selected="false" android:drawable="@drawable/gradient_bg" />
<item android:state_pressed="true" android:drawable="@drawable/gradient_bg_hover" />
<item android:state_pressed="false" android:state_selected="true" android:drawable="@drawable/gradient_bg_hover" />
</selector>

View file

@ -21,7 +21,7 @@
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@+id/toolbar">
app:toolbarId="@+id/toolbar"/>
<android.support.v7.widget.Toolbar
android:id="@+id/detail_toolbar"
@ -30,15 +30,14 @@
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/medicament_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
@ -50,4 +49,5 @@
app:layout_anchor="@+id/medicament_detail_container"
app:layout_anchorGravity="top|end" />
</android.support.design.widget.CoordinatorLayout>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/valeur"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Valeur"
android:textSize="16dp"
android:textColor="#040404"
android:textStyle="bold"
android:paddingLeft="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Label"
android:layout_below="@+id/valeur"
android:layout_alignParentLeft="true"
android:textStyle="italic"
android:textColor="#57C1DE"
android:background="@android:color/transparent"
android:id="@+id/label"
android:paddingLeft="10sp" />
</RelativeLayout>

View file

@ -1,9 +1,62 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
<!--<TextView xmlns:android="http://schemas.android.com/apk/res/android"-->
<!--xmlns:tools="http://schemas.android.com/tools"-->
<!--android:id="@+id/medicament_detail"-->
<!--style="?android:attr/textAppearanceLarge"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:padding="16dp"-->
<!--android:textIsSelectable="true"-->
<!--android:text="rput"-->
<!--tools:context="net.foucry.pilldroid.MedicamentDetailFragment" />-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/medicament_detail"
style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:textIsSelectable="true"
tools:context="net.foucry.pilldroid.MedicamentDetailFragment" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context="net.foucry.pilldroid.MedicamentDetailFragment">
<include
android:id="@+id/name_cell"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5sp"
layout="@layout/info_cell" />
<include
android:id="@+id/presentation_cell"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/info_cell"
android:layout_marginTop="5sp" />
<include
android:id="@+id/administration_cell"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/info_cell"
android:layout_marginTop="5sp" />
<include
android:id="@+id/stock_cell"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/value_input"
android:layout_marginTop="30sp" />
<include
android:id="@+id/warning_cell"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/value_input"
android:layout_marginTop="15sp" />
<include
android:id="@+id/alert_cell"
layout="@layout/value_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5sp" />
</LinearLayout>

View file

@ -0,0 +1,30 @@
<?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="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Medium Text"
android:id="@+id/libelle"
android:background="@drawable/list_selector"
android:textStyle="bold"
android:textColor="#040404"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/valeur"
android:layout_alignBottom="@+id/valeur" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/valeur"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:textAlignment="gravity"
android:text="0" />
</RelativeLayout>