mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-17 18:41:37 +01:00
Mise en place new look sur la vue de detail
This commit is contained in:
parent
19a9850f37
commit
0e84ec6ab6
7 changed files with 148 additions and 12 deletions
10
app/src/main/res/drawable/gradient_bg.xml
Normal file
10
app/src/main/res/drawable/gradient_bg.xml
Normal 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>
|
10
app/src/main/res/drawable/gradient_bg_hover.xml
Normal file
10
app/src/main/res/drawable/gradient_bg_hover.xml
Normal 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>
|
7
app/src/main/res/drawable/list_selector.xml
Normal file
7
app/src/main/res/drawable/list_selector.xml
Normal 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>
|
|
@ -21,7 +21,7 @@
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
app:contentScrim="?attr/colorPrimary"
|
app:contentScrim="?attr/colorPrimary"
|
||||||
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
app:layout_scrollFlags="scroll|exitUntilCollapsed"
|
||||||
app:toolbarId="@+id/toolbar">
|
app:toolbarId="@+id/toolbar"/>
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/detail_toolbar"
|
android:id="@+id/detail_toolbar"
|
||||||
|
@ -30,8 +30,6 @@
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||||
|
|
||||||
</android.support.design.widget.CollapsingToolbarLayout>
|
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v4.widget.NestedScrollView
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
@ -40,6 +38,7 @@
|
||||||
android:layout_height="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.support.design.widget.FloatingActionButton
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -50,4 +49,5 @@
|
||||||
app:layout_anchor="@+id/medicament_detail_container"
|
app:layout_anchor="@+id/medicament_detail_container"
|
||||||
app:layout_anchorGravity="top|end" />
|
app:layout_anchorGravity="top|end" />
|
||||||
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|
26
app/src/main/res/layout/info_cell.xml
Normal file
26
app/src/main/res/layout/info_cell.xml
Normal 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>
|
|
@ -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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/medicament_detail"
|
android:layout_width="wrap_content"
|
||||||
style="?android:attr/textAppearanceLarge"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:orientation="vertical"
|
||||||
android:layout_height="match_parent"
|
tools:context="net.foucry.pilldroid.MedicamentDetailFragment">
|
||||||
android:padding="16dp"
|
|
||||||
android:textIsSelectable="true"
|
<include
|
||||||
tools:context="net.foucry.pilldroid.MedicamentDetailFragment" />
|
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>
|
30
app/src/main/res/layout/value_input.xml
Normal file
30
app/src/main/res/layout/value_input.xml
Normal 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>
|
Loading…
Reference in a new issue