-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from Trendyol/dialogs/customviewdialog
Add dialog with custom view support
- Loading branch information
Showing
14 changed files
with
232 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
29 changes: 29 additions & 0 deletions
29
libraries/dialogs/src/main/res/layout/layout_dialog_header.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
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:id="@+id/viewTitleBackground" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:paddingStart="@dimen/ui_components_dialogs_margin_outer" | ||
android:paddingEnd="@dimen/ui_components_dialogs_margin_outer"> | ||
|
||
<androidx.appcompat.widget.AppCompatTextView | ||
android:id="@+id/textTitle" | ||
style="@style/Trendyol.UIComponents.Dialogs.PrimaryText.Title" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_vertical" | ||
android:layout_weight="1" | ||
tools:text="Lorem Ipsum" /> | ||
|
||
<androidx.appcompat.widget.AppCompatImageView | ||
android:id="@+id/imageClose" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_vertical" | ||
android:background="?selectableItemBackgroundBorderless" | ||
android:padding="@dimen/ui_components_dialogs_margin_inner" | ||
app:srcCompat="@drawable/ic_ui_components_dialogs_close" /> | ||
</LinearLayout> |
This file contains 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
24 changes: 24 additions & 0 deletions
24
sample/src/main/java/com/trendyol/uicomponents/ExampleCustomView.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.trendyol.uicomponents | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.LayoutInflater | ||
import android.widget.FrameLayout | ||
import androidx.databinding.DataBindingUtil | ||
import com.trendyol.uicomponents.databinding.ViewCustomExampleBinding | ||
|
||
class ExampleCustomView @JvmOverloads constructor( | ||
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | ||
) : FrameLayout(context, attrs, defStyleAttr) { | ||
|
||
private val binding: ViewCustomExampleBinding = | ||
DataBindingUtil.inflate(LayoutInflater.from(this.context), R.layout.view_custom_example, this, true) | ||
|
||
fun setButtonCancelClickListener(listener: () -> Unit) { | ||
binding.buttonCancel.setOnClickListener { listener.invoke() } | ||
} | ||
|
||
fun setButtonOkClickListener(listener: () -> Unit) { | ||
binding.buttonOk.setOnClickListener { listener.invoke() } | ||
} | ||
} |
This file contains 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
Oops, something went wrong.