Added more styles regarding homescreen

This commit is contained in:
Viktor De Pasquale 2019-10-02 18:15:16 +02:00
parent 122e2f7a8e
commit cc8f1adca3
5 changed files with 404 additions and 185 deletions

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data></data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:layout_gravity="center"
tools:paddingEnd="@dimen/l1">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/developer_link"
style="?styleImageNormal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_paypal" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/developer_link_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l_50"
android:textAppearance="?appearanceTextCaptionNormal"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/developer_link"
tools:text="Paypal" />
<androidx.appcompat.widget.AppCompatImageView
style="?styleImageSmall"
android:layout_marginStart="@dimen/l_50"
app:layout_constraintBottom_toBottomOf="@+id/developer_link_name"
app:layout_constraintStart_toEndOf="@+id/developer_link_name"
app:layout_constraintTop_toTopOf="@+id/developer_link_name"
app:srcCompat="@drawable/ic_more"
app:tint="?colorTextTransient" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -46,13 +46,17 @@
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:padding="@dimen/l1"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:orientation="vertical"
android:padding="@dimen/l1"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -217,11 +221,30 @@
android:layout_marginBottom="@dimen/l2"
android:background="?colorSurfaceVariant" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/support_icon"
style="?styleIconNormal"
android:padding="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@null"
tools:src="@tools:sample/avatars" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/support_icon"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -232,23 +255,152 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:textAllCaps="true"
android:textAppearance="?appearanceTextCaptionNormal"
android:textSize="10sp"
android:textStyle="bold"
tools:text="Support us" />
tools:text="\@topjohnwu" />
<androidx.appcompat.widget.AppCompatTextView
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="todo..." />
android:clipToPadding="false"
android:fadingEdgeLength="@dimen/l1"
android:orientation="horizontal"
android:paddingTop="@dimen/l1"
android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_developer" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/l1"
tools:visibility="gone">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/support_icon"
style="?styleIconNormal"
android:padding="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@null"
tools:src="@tools:sample/avatars" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/l1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/support_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/l1">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:fontFamily="sans-serif-black"
android:textAppearance="?appearanceTextCaptionNormal"
android:textStyle="bold"
tools:text="\@diareuse" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:fadingEdgeLength="@dimen/l1"
android:orientation="horizontal"
android:paddingTop="@dimen/l1"
android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:reverseLayout="true"
tools:listitem="@layout/item_developer" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/l1"
android:layout_marginBottom="@dimen/l1"
android:background="?colorSurfaceVariant" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/support_icon"
style="?styleIconNormal"
android:padding="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tint="@null"
tools:src="@tools:sample/avatars" />
<com.google.android.material.card.MaterialCardView
style="?styleCardNormal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/l1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/support_icon"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/l1">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:textAppearance="?appearanceTextCaptionNormal"
android:textStyle="bold"
tools:text="Project links" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:fadingEdgeLength="@dimen/l1"
android:orientation="horizontal"
android:paddingTop="@dimen/l1"
android:requiresFadingEdge="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_developer" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/home_bottom_bar"
android:layout_width="match_parent"

View File

@ -31,6 +31,11 @@
<attr name="styleIconPrimary" format="reference" />
<attr name="styleIconError" format="reference" />
<!--Image-->
<attr name="styleImageBig" format="reference" />
<attr name="styleImageNormal" format="reference" />
<attr name="styleImageSmall" format="reference" />
<!--endregion-->
<!--region Texts-->

View File

@ -39,6 +39,10 @@
<item name="styleIconPrimary">@style/WidgetFoundation.Icon.Primary</item>
<item name="styleIconError">@style/WidgetFoundation.Icon.Error</item>
<item name="styleImageBig">@style/WidgetFoundation.Image.Big</item>
<item name="styleImageNormal">@style/WidgetFoundation.Image</item>
<item name="styleImageSmall">@style/WidgetFoundation.Image.Small</item>
<!--///-->
<item name="appearanceTextDisplayNormal">@style/AppearanceFoundation.Display</>

View File

@ -65,9 +65,23 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
</style>
<style name="WidgetFoundation.Icon">
<style name="WidgetFoundation.Image">
<item name="android:layout_width">32dp</item>
<item name="android:layout_height">32dp</item>
</style>
<style name="WidgetFoundation.Image.Big">
<item name="android:layout_width">48dp</item>
<item name="android:layout_height">48dp</item>
</style>
<style name="WidgetFoundation.Image.Small">
<item name="android:layout_width">24dp</item>
<item name="android:layout_height">24dp</item>
</style>
<style name="WidgetFoundation.Icon" parent="WidgetFoundation.Image.Big">
<item name="android:padding">@dimen/l_75</item>
<item name="android:background">?selectableItemBackgroundBorderless</item>
<item name="tint">?colorTextTransient</item>