Skip to content

Commit

Permalink
Merge pull request #151 from natura-cosmeticos/brand-selector
Browse files Browse the repository at this point in the history
[DSY-1440] Brand selector
  • Loading branch information
mlcsouza authored Sep 14, 2020
2 parents 859d5df + 6ea2717 commit 797975c
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 35 deletions.
4 changes: 3 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BrandSelectorActivity"/>
<activity
android:name=".BrandSelectorActivity"
android:theme="@style/SplashTheme"/>
<activity android:name=".MainActivity" />
<activity
android:name=".tokens.ElevationActivity"
Expand Down
8 changes: 8 additions & 0 deletions sample/src/main/res/drawable/aesop_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="128dp"
android:height="41dp"
android:viewportWidth="128"
android:viewportHeight="41">
<path
android:pathData="M0,0h128v40.615h-128z"/>
</vector>
9 changes: 9 additions & 0 deletions sample/src/main/res/drawable/black_gradient.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="linear"
android:centerX="70%"
android:startColor="#FF000000"
android:centerColor="#FF000000"
android:endColor="#00000000"
android:angle="90"/>
</shape>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white"/>
<corners android:radius="?borderRadiusLarge"/>
</shape>
21 changes: 21 additions & 0 deletions sample/src/main/res/drawable/logo_aesop.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="120dp"
android:height="41dp"
android:viewportWidth="120"
android:viewportHeight="41">
<path
android:pathData="M7.464,18.365C5.856,21.908 4.551,25.581 3.563,29.345C3.001,29.202 2.425,29.12 1.845,29.099C1.224,29.124 0.605,29.206 -0.001,29.345C3.729,21.218 9.933,7.545 12.907,0C13.254,0.069 13.605,0.11 13.958,0.123C14.271,0.126 14.583,0.084 14.885,0C18.109,8.81 27.373,29.183 27.461,29.345C26.645,29.184 25.816,29.102 24.985,29.099C24.085,29.105 23.187,29.187 22.301,29.345C21.173,25.582 19.757,21.911 18.066,18.365H7.464ZM12.706,5.87L8.299,16.27H17.232L12.706,5.87Z"
android:fillColor="#000000"/>
<path
android:pathData="M34.209,19.162C34.209,20.336 34.209,22.724 35.339,24.648C35.918,25.684 36.773,26.538 37.81,27.116C38.847,27.694 40.023,27.973 41.209,27.92C42.515,27.956 43.809,27.664 44.974,27.073C46.139,26.481 47.137,25.608 47.879,24.532L48.384,24.648C48.206,25.475 48.107,26.317 48.086,27.163C46.244,28.928 43.684,29.895 40.288,29.895C33.915,29.895 30.016,25.87 30.016,19.409C30.016,13.624 33.202,8.763 40.082,8.763C49.428,8.763 49.3,16.898 49.263,19.163L34.209,19.162ZM45.069,17.397C45.069,16.014 45.069,10.436 40.039,10.436C36.39,10.436 34.628,13.206 34.25,17.397H45.069Z"
android:fillColor="#000000"/>
<path
android:pathData="M65.23,13.623C65.137,13.118 64.944,12.636 64.664,12.205C64.384,11.774 64.021,11.402 63.597,11.112C62.78,10.609 61.832,10.36 60.873,10.398C58.316,10.398 56.975,11.739 56.975,13.54C56.975,15.972 59.451,16.854 60.914,17.232C64.646,18.196 67.669,18.996 67.669,23.188C67.669,26.374 65.443,29.935 59.615,29.935C57.422,29.959 55.268,29.349 53.414,28.178C53.887,27.108 54.211,25.978 54.377,24.82L54.877,24.697C55.27,25.865 56.076,26.85 57.144,27.466C58.072,28.005 59.13,28.279 60.203,28.26C62.386,28.26 64.437,27.213 64.437,24.823C64.437,22.432 63.012,21.97 58.613,20.548C56.807,19.958 53.83,18.658 53.83,14.97C53.83,12.585 55.299,8.727 61.087,8.727C63.02,8.693 64.927,9.168 66.618,10.104C66.165,11.23 65.883,12.418 65.78,13.627L65.23,13.623Z"
android:fillColor="#000000"/>
<path
android:pathData="M93.533,19.075C93.533,25.742 88.921,29.934 82.555,29.934C78.104,29.934 71.9,27.919 71.9,19.322C71.9,12.787 76.259,8.723 82.555,8.723C90.513,8.723 93.533,13.964 93.533,19.075ZM76.175,19.202C76.175,25.03 78.733,28.256 82.59,28.256C86.617,28.256 89.258,24.777 89.258,19.242C89.258,15.972 88.251,10.397 82.796,10.397C76.174,10.396 76.174,17.94 76.174,19.202H76.175Z"
android:fillColor="#000000"/>
<path
android:pathData="M109.591,29.976C105.646,29.976 103.429,27.8 102.756,26.08C102.756,32.657 102.714,36.48 102.967,40.33C102.255,40.144 101.519,40.061 100.783,40.084C100.022,40.061 99.261,40.144 98.522,40.33C98.857,34.883 98.982,29.392 98.982,23.94C98.982,20.125 98.901,14.967 98.771,8.889C99.445,9.047 100.135,9.129 100.827,9.135C101.519,9.125 102.207,9.043 102.881,8.889C102.714,11.193 102.714,11.82 102.714,12.704C103.408,11.436 104.443,10.387 105.702,9.675C106.96,8.964 108.393,8.619 109.838,8.68C114.031,8.68 119.151,11.739 119.151,19.203C119.151,25.824 115.08,29.976 109.591,29.976ZM104.392,12.956C103.552,14.002 102.669,15.514 102.669,19.664C102.669,23.352 103.506,24.739 104.392,25.782C104.922,26.445 105.599,26.976 106.37,27.334C107.14,27.691 107.983,27.864 108.832,27.84C114.829,27.84 114.829,20.755 114.829,19.41C114.829,13.078 111.809,10.781 109.087,10.781C108.188,10.744 107.293,10.923 106.477,11.301C105.66,11.679 104.946,12.247 104.392,12.956Z"
android:fillColor="#000000"/>
</vector>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/nature_background" />
<item android:drawable="@drawable/black_gradient" />
</layer-list>
148 changes: 117 additions & 31 deletions sample/src/main/res/layout/activity_brand_selector.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:fillViewport="true"
android:layout_width="match_parent"
Expand All @@ -8,43 +9,128 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background"
android:orientation="vertical">
android:background="@drawable/nature_background_with_full_overlay"
android:orientation="vertical"
android:padding="?spacingSmall">

<Button
android:id="@+id/avonThemeButton"
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Avon"
android:drawableRight="@drawable/ds_ic_outlined_navigation_arrowleft"
android:textAlignment="textStart"
android:layout_gravity="start"
android:padding="16dp"
android:background="@color/surface"
android:textColor="@color/highEmphasis" />

<Button
android:id="@+id/naturaThemeButton"
android:text="NATDS - ANDROID"
android:layout_marginTop="?spacingXLarge"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
android:textAppearance="?textAppearanceHeadline6"
android:textColor="#FAFAFA"
android:textAlignment="center" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Natura"
android:drawableRight="@drawable/ds_ic_outlined_navigation_arrowleft"
android:textAlignment="textStart"
android:layout_gravity="start"
android:padding="16dp"
android:background="@color/surface"
android:textColor="@color/highEmphasis" />

<Button
android:id="@+id/tbsThemeButton"
android:text="version 2.4.1"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
android:textColor="#FAFAFA"
android:textAppearance="?textAppearanceCaption"
android:textAlignment="center" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="The Body Shop"
android:drawableRight="@drawable/ds_ic_outlined_navigation_arrowleft"
android:textAlignment="textStart"
android:layout_gravity="start"
android:padding="16dp"
android:background="@color/surface"
android:textColor="@color/highEmphasis" />
android:text="Select a brand:"
android:layout_marginTop="?spacingSemi"
android:layout_marginBottom="?spacingSmall"
android:textColor="#FAFAFA"
android:textAppearance="?textAppearanceBody1" />

<androidx.cardview.widget.CardView
android:id="@+id/themeAesopButton"
android:layout_width="match_parent"
android:layout_height="?sizeLargeX"
android:background="@color/white"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
app:cardCornerRadius="?borderRadiusMedium"
android:orientation="horizontal" >

<ImageView
android:layout_width="?sizeHugeX"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/logo_aesop"
android:alpha="?opacity03"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/avonThemeButton"
android:layout_width="match_parent"
android:layout_height="?sizeLargeX"
android:background="@color/white"
app:cardCornerRadius="?borderRadiusMedium"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
android:orientation="horizontal" >

<ImageView
android:id="@+id/imageView"
android:layout_width="?sizeHugeX"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/avon_horizontal" />
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/naturaThemeButton"
android:layout_width="match_parent"
android:layout_height="?sizeLargeX"
android:background="@color/white"
app:cardCornerRadius="?borderRadiusMedium"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
android:orientation="horizontal" >

<ImageView
android:layout_width="?sizeHugeX"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/natura_horizontal"
android:tint="@color/black"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/themeNaturaCoButton"
android:layout_width="match_parent"
android:layout_height="?sizeLargeX"
android:background="@color/white"
app:cardCornerRadius="?borderRadiusMedium"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
android:orientation="horizontal" >

<ImageView
android:id="@+id/naturaCoLogoTheme"
android:layout_width="?sizeHugeX"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/logo_natura_co"
android:tint="@color/black"
android:alpha="?opacity03"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/tbsThemeButton"
android:layout_width="match_parent"
android:layout_height="?sizeLargeX"
android:background="@color/white"
app:cardCornerRadius="?borderRadiusMedium"
android:layout_marginBottom="?spacingSmall"
android:gravity="center"
android:orientation="horizontal" >

<ImageView
android:layout_width="?sizeHugeX"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/tbs_horizontal"
android:tint="@color/black"/>
</androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/activity_splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:id="@+id/naturaCoLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="65dp"
android:layout_marginBottom="?spacingXLarge"
android:src="@drawable/logo_natura_co"
app:layout_constraintBottom_toTopOf="@+id/title"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
6 changes: 4 additions & 2 deletions sample/src/main/res/values/style.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_full_background</item>
<style name="SplashTheme" parent="Theme.DsBaseLight">
<item name="android:windowBackground">@drawable/nature_background_with_overlay</item>
<item name="android:windowFullscreen">true</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>

0 comments on commit 797975c

Please sign in to comment.