Last active
May 14, 2023 02:57
-
-
Save falvojr/15088d444d82b0da1e822d4b711f2305 to your computer and use it in GitHub Desktop.
santander-dev-week-bankline-android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources xmlns:tools="http://schemas.android.com/tools"> | |
<!-- Base application theme. --> | |
<!-- https://m3.material.io/libraries/mdc-android/getting-started --> | |
<style name="Theme.Banklineandroid" parent="Theme.Material3.Light"> | |
<!-- https://m3.material.io/libraries/mdc-android/color-theming --> | |
<item name="colorPrimary">@color/primary_600</item> | |
<item name="colorPrimaryContainer">@color/primary_100</item> | |
<item name="colorOnPrimaryContainer">@color/primary_900</item> | |
<item name="colorPrimaryInverse">@color/primary_200</item> | |
</style> | |
<!-- Interesting alternative to Material 3: https://material-foundation.github.io/material-theme-builder --> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources xmlns:tools="http://schemas.android.com/tools"> | |
<!-- Base application theme. --> | |
<!-- https://m3.material.io/libraries/mdc-android/getting-started --> | |
<style name="Theme.Banklineandroid" parent="Theme.Material3.Dark"> | |
<!-- https://m3.material.io/libraries/mdc-android/color-theming --> | |
<item name="colorPrimary">@color/primary_200</item> | |
<item name="colorPrimaryContainer">@color/primary_700</item> | |
<item name="colorOnPrimaryContainer">@color/primary_100</item> | |
<item name="colorPrimaryInverse">@color/primary_600</item> | |
</style> | |
<!-- Interesting alternative to Material 3: https://material-foundation.github.io/material-theme-builder --> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- Reference: https://material.io/resources/color --> | |
<color name="primary_100">#ffcdd2</color> | |
<color name="primary_200">#ef9a9a</color> | |
<color name="primary_600">#e53935</color> | |
<color name="primary_700">#d32f2f</color> | |
<color name="primary_900">#b71c1c</color> | |
</resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".ui.welcome.WelcomeActivity"> | |
<TextView | |
android:id="@+id/tvWelcome" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginLeft="@dimen/margin_default" | |
android:layout_marginTop="32dp" | |
android:layout_marginRight="@dimen/margin_default" | |
android:text="@string/txt_welcome" | |
app:layout_constraintLeft_toLeftOf="parent" | |
app:layout_constraintRight_toRightOf="parent" | |
app:layout_constraintTop_toTopOf="parent" /> | |
<!-- Reference: https://material.io/components/text-fields/android --> | |
<com.google.android.material.textfield.TextInputLayout | |
android:id="@+id/tilAccountHolderId" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="@dimen/margin_default" | |
android:layout_marginTop="@dimen/margin_default" | |
android:layout_marginEnd="@dimen/margin_default" | |
android:hint="ID do Correntista" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@+id/tvWelcome"> | |
<com.google.android.material.textfield.TextInputEditText | |
android:id="@+id/etAccountHolderId" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:inputType="number" /> | |
</com.google.android.material.textfield.TextInputLayout> | |
<Button | |
android:id="@+id/btContinue" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="@dimen/margin_default" | |
android:layout_marginTop="@dimen/margin_default" | |
android:layout_marginEnd="@dimen/margin_default" | |
android:text="@string/txt_continue" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toBottomOf="@+id/tilAccountHolderId" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<com.google.android.material.card.MaterialCardView 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:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_margin="@dimen/default_half_margin"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView | |
android:id="@+id/ivIcon" | |
android:layout_width="80dp" | |
android:layout_height="80dp" | |
android:layout_margin="@dimen/margin_default" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" | |
tools:src="@drawable/ic_money_on" /> | |
<TextView | |
android:id="@+id/tvDescription" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="@dimen/margin_default" | |
android:layout_marginEnd="@dimen/margin_default" | |
android:layout_marginBottom="@dimen/default_half_margin" | |
android:textAppearance="@style/TextAppearance.Material3.TitleMedium" | |
app:layout_constraintBottom_toTopOf="@+id/tvValue" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toEndOf="@+id/ivIcon" | |
tools:text="Meu Primeiro Salário" /> | |
<TextView | |
android:id="@+id/tvValue" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="@dimen/margin_default" | |
android:layout_marginEnd="@dimen/margin_default" | |
android:textAppearance="@style/TextAppearance.Material3.TitleLarge" | |
android:textStyle="bold" | |
app:layout_constraintBottom_toBottomOf="@+id/ivIcon" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toEndOf="@+id/ivIcon" | |
app:layout_constraintTop_toTopOf="@+id/ivIcon" | |
tools:text="1500.00" /> | |
<TextView | |
android:id="@+id/tvDatetime" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="@dimen/margin_default" | |
android:layout_marginTop="@dimen/margin_half_default" | |
android:layout_marginEnd="@dimen/margin_default" | |
android:textAppearance="@style/TextAppearance.Material3.TitleMedium" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toEndOf="@+id/ivIcon" | |
app:layout_constraintTop_toBottomOf="@+id/tvValue" | |
tools:text="01/05/2022 21:24:55" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> | |
</com.google.android.material.card.MaterialCardView> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".ui.statement.BankStatementActivity"> | |
<!-- Reference: https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout?hl=pt-br --> | |
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout | |
android:id="@+id/srlBankStatement" | |
android:layout_width="0dp" | |
android:layout_height="0dp" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent"> | |
<androidx.recyclerview.widget.RecyclerView | |
android:id="@+id/rvBankStatement" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:listitem="@layout/bank_statement_item" /> | |
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | |
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.dio.bankline.ui.adapters | |
import android.view.LayoutInflater | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.RecyclerView | |
/** | |
* Reference: https://developer.android.com/guide/topics/ui/layout/recyclerview?hl=pt-br#kotlin | |
*/ | |
class CustomAdapter(private val dataSet: List<TODO_MODEL>) : RecyclerView.Adapter<CustomAdapter.ViewHolder>() { | |
class ViewHolder(private val binding: TODO_BINDING) : RecyclerView.ViewHolder(binding.root) { | |
fun bind(item: TODO_MODEL) = with(binding) { | |
TODO() | |
} | |
} | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | |
val binding = TODO_BINDING.inflate(LayoutInflater.from(parent.context), parent, false) | |
return ViewHolder(binding) | |
} | |
override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) { | |
val item = dataSet[position] | |
viewHolder.bind(item) | |
} | |
override fun getItemCount() = dataSet.size | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment