Skip to content

Commit

Permalink
Correções nos dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonatansabadi committed Dec 7, 2020
1 parent de6cdef commit d335fb3
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MultiItemDialog(
adapter = MultiItemAdapter(itens, icons ?: iconsfilled, this@MultiItemDialog)
setHasFixedSize(true)
isNestedScrollingEnabled = true
addItemDecoration(DividerItemDecoration(activity, LinearLayoutManager(activity).orientation))
// addItemDecoration(DividerItemDecoration(activity, LinearLayoutManager(activity).orientation))
}
}

Expand Down
73 changes: 34 additions & 39 deletions android-dialog/src/main/res/layout/multi_item_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,29 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@android:color/transparent"
android:paddingTop="32dp"
android:paddingBottom="32dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:background="@android:color/transparent">

<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="18dp"
android:layout_marginBottom="32dp"
app:cardCornerRadius="10dp"
app:cardBackgroundColor="?android:attr/colorBackground"
app:cardCornerRadius="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:background="?android:attr/colorBackground"
android:id="@+id/constraint_multi_choice"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/colorBackground"
android:orientation="vertical">


<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottieDialog"
android:layout_width="0dp"
android:layout_height="@dimen/dimen_lottie_image"
android:visibility="gone"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/imageDialog"
android:layout_width="match_parent"
Expand All @@ -52,23 +37,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/lottieDialog" />


<com.google.android.material.textview.MaterialTextView
android:id="@+id/titleDialog"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:text="Title"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp"
android:textStyle="normal|bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageDialog" />

<androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView3"
android:layout_width="match_parent"
Expand All @@ -80,19 +48,46 @@
app:layout_constraintTop_toBottomOf="@+id/titleDialog">

<androidx.recyclerview.widget.RecyclerView
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/recyclerViewDialog"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:paddingTop="8dp"
android:paddingBottom="24dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="5"
tools:listitem="@layout/recycler_multi_item" />
</androidx.core.widget.NestedScrollView>


<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottieDialog"
android:layout_width="0dp"
android:layout_height="@dimen/dimen_lottie_image"
android:scaleType="centerCrop"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/titleDialog"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:text="Title"
android:textColor="?android:attr/textColorPrimary"
android:textSize="20sp"
android:textStyle="normal|bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageDialog" />

<include
android:id="@+id/include2"

android:id="@+id/multi_item_dialog_include"
layout="@layout/base_dialog_actions"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,16 @@ class MainActivity : AppCompatActivity() {
multiItemDialog(mutableListOf(
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 1",
"Item 2"
"Item 1"
), R.drawable.ic_alarm) {
setLottieImage("moto.json")
title = "Algum titulo"
actionButton("OK") {
Toast.makeText(this@MainActivity, "OK", Toast.LENGTH_LONG).show()
}
neutralButton {
it.dismiss()
}
// actionButton("OK") {
// Toast.makeText(this@MainActivity, "OK", Toast.LENGTH_LONG).show()
// }
// neutralButton {
// it.dismiss()
// }
}
}

Expand All @@ -86,6 +70,7 @@ class MainActivity : AppCompatActivity() {
colorPickerDialogButton.setOnClickListener {
colorPickerDialog(mutableListOf(R.color.blue, R.color.red)) {
okButton {
setLottieImage("moto.json")
it.dismiss()
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
maven { url = "https://dl.bintray.com/kotlin/kotlin-eap" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0-alpha05'
classpath 'com.android.tools.build:gradle:4.2.0-alpha16'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-6.7-bin.zip

0 comments on commit d335fb3

Please sign in to comment.