Vector assets (plus icon and umbrella icon) and layout components added in order to create the first page :)

This commit is contained in:
BGbaderguet 2020-11-07 17:59:05 +01:00
parent 9fd97503d9
commit 2733f4def2
8 changed files with 71 additions and 48 deletions

View File

@ -1,5 +0,0 @@
<vector android:height="24dp" android:tint="#D22E12"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>
</vector>

View File

@ -1,5 +1,5 @@
<vector android:height="24dp" android:tint="#D2D2D2" <vector android:height="400dp" android:tint="#9CB6B5B5"
android:viewportHeight="24" android:viewportWidth="24" android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:width="400dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M14.5,6.92L13,5.77V3.88V3.4c0,-0.26 0.22,-0.48 0.5,-0.48c0.28,0 0.5,0.21 0.5,0.48V4h2V3.4C16,2.07 14.88,1 13.5,1C12.12,1 11,2.07 11,3.4v0.48v1.89L9.5,6.92L6,6.07l5.05,15.25C11.2,21.77 11.6,22 12,22s0.8,-0.23 0.95,-0.69L18,6.07L14.5,6.92zM13.28,8.5l0.76,0.58l0.92,-0.23L13,14.8V8.29L13.28,8.5zM9.96,9.09l0.76,-0.58L11,8.29v6.51L9.03,8.86L9.96,9.09z"/> <path android:fillColor="#A1A0A0" android:pathData="M14.5,6.92L13,5.77V3.88V3.4c0,-0.26 0.22,-0.48 0.5,-0.48c0.28,0 0.5,0.21 0.5,0.48V4h2V3.4C16,2.07 14.88,1 13.5,1C12.12,1 11,2.07 11,3.4v0.48v1.89L9.5,6.92L6,6.07l5.05,15.25C11.2,21.77 11.6,22 12,22s0.8,-0.23 0.95,-0.69L18,6.07L14.5,6.92zM13.28,8.5l0.76,0.58l0.92,-0.23L13,14.8V8.29L13.28,8.5zM9.96,9.09l0.76,-0.58L11,8.29v6.51L9.03,8.86L9.96,9.09z"/>
</vector> </vector>

View File

@ -1,48 +1,53 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".MainActivity"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="#F60707" android:theme="@style/Theme.MyWeather.AppBarOverlay">
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:title="MyWeather"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="-2dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <androidx.appcompat.widget.Toolbar
android:id="@+id/floatingActionButton4" android:id="@+id/toolbar"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="?attr/actionBarSize"
android:clickable="true" android:background="?attr/colorPrimary"
app:backgroundTint="#FB0C0C" app:title="MyWeather"
app:rippleColor="#EC0A0A" app:popupTheme="@style/Theme.MyWeather.PopupOverlay" />
app:srcCompat="@drawable/ic_baseline_add_circle_24"
tools:layout_editor_absoluteX="330dp" </com.google.android.material.appbar.AppBarLayout>
tools:layout_editor_absoluteY="632dp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="530dp"
app:srcCompat="@drawable/ic_baseline_umbrella_24" />
<TextView <TextView
android:id="@+id/textView" android:id="@+id/textView"
android:layout_width="233dp" android:layout_width="match_parent"
android:layout_height="51dp" android:layout_height="51dp"
android:textSize="20sp"
android:gravity="center"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:text="Please click on the 'Add' button in order to add a city" android:text="Please click on the 'Add' button in order to add a city"
tools:layout_editor_absoluteX="89dp" tools:layout_editor_absoluteX="89dp"
tools:layout_editor_absoluteY="566dp" /> tools:layout_editor_absoluteY="566dp" />
<ImageView <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/imageView" android:id="@+id/fab"
android:layout_width="320dp" android:layout_width="wrap_content"
android:layout_height="552dp" android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_baseline_umbrella_24" android:layout_gravity="bottom|end"
tools:layout_editor_absoluteX="45dp" android:layout_margin="@dimen/fab_margin"
tools:layout_editor_absoluteY="89dp" /> app:backgroundTint="#FF0202"
app:rippleColor="#FFFFFF"
app:srcCompat="@android:drawable/ic_input_add" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -4,11 +4,11 @@
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item> <item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item> <item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item> <item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. --> <!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item> <item name="colorSecondary">@color/red</item>
<item name="colorSecondaryVariant">@color/teal_200</item> <item name="colorSecondaryVariant">@color/red</item>
<item name="colorOnSecondary">@color/black</item> <item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. --> <!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->

View File

@ -7,4 +7,5 @@
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="red">#FB1100</color>
</resources> </resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="fab_margin" />
</resources>

View File

@ -1,3 +1,12 @@
<resources> <resources>
<string name="app_name">My Weather</string> <string name="app_name">My Weather</string>
<string name="action_settings">Settings</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="hello_first_fragment">Hello first fragment</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
</resources> </resources>

View File

@ -2,15 +2,24 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Theme.MyWeather" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.MyWeather" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item> <item name="colorPrimary">@color/red</item>
<item name="colorPrimaryVariant">@color/purple_700</item> <item name="colorPrimaryVariant">@color/red</item>
<item name="colorOnPrimary">@color/white</item> <item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. --> <!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item> <item name="colorSecondary">@color/red</item>
<item name="colorSecondaryVariant">@color/teal_700</item> <item name="colorSecondaryVariant">@color/red</item>
<item name="colorOnSecondary">@color/black</item> <item name="colorOnSecondary">@color/white</item>
<!-- Status bar color. --> <!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
<style name="Theme.MyWeather.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.MyWeather.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.MyWeather.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources> </resources>