You can change UI with this configuration.
1. Title
- Change Text Title
.setTitle("ini title")
- Change Text Title Size
.setTitleSize(21)
- Change Text Title Color
.setTitleColor(getResources().getColor(R.color.colorAccent)).setTitleColor(Color.parseColor("#03DAC5"))
- Change Text Title Alignment
.setTitleAlignment(View.TEXT_ALIGNMENT_TEXT_END)- Available Value :
View.TEXT_ALIGNMENT_TEXT_ENDView.TEXT_ALIGNMENT_CENTERView.TEXT_ALIGNMENT_TEXT_START- etc.
- Available Value :
2. Content
- Change Text Content
.setContent("ini content")
- Change Text Content Size
.setContentSize(21)
- Change Text Content Color
.setContentColor(getResources().getColor(R.color.colorAccent)).setContentColor(Color.parseColor("#03DAC5"))
- Change Text Content Alignment
.setContentAlignment(View.TEXT_ALIGNMENT_TEXT_END)- Available Value :
View.TEXT_ALIGNMENT_TEXT_ENDView.TEXT_ALIGNMENT_CENTERView.TEXT_ALIGNMENT_TEXT_START- etc.
- Available Value :
3. Filter Field
- Change Filter Text Field Size
.setTextSearchSize(21)
- Change Filter Text Field Color
.setTextSearchColor(getResources().getColor(R.color.colorAccent)).setTextSearchColor(Color.parseColor("#03DAC5"))
4. Text List Item
- Change Filter Text Field Size
.setTextListSize(21)
- Change Filter Text Field Color
.setTextListColor(getResources().getColor(R.color.colorAccent)).setTextListColor(Color.parseColor("#03DAC5"))
5. Content List
6. Button Ok
- Change Text Button Ok
.setBtnOkTitle("Yuhuu")
- Change Text Button Ok Color
.setBtnOkTitleColor(getResources().getColor(R.color.colorAccent)).setBtnOkTitleColor(Color.parseColor("#03DAC5"))
- Change Icon Button Ok
.setOkIconLeft(R.drawable.ic_baseline_add_24).setOkIconTop(R.drawable.ic_baseline_add_24).setOkIconRight(R.drawable.ic_baseline_add_24).setOkIconBottom(R.drawable.ic_baseline_add_24)
7. Button Cancel
- Change Text Button Cancel
.setBtnCancelTitle("Batal")
- Change Text Button Cancel Color
.setBtnCancelTitleColor(getResources().getColor(R.color.colorAccent)).setBtnCancelTitleColor(Color.parseColor("#03DAC5"))
- Change Icon Button Cancel
.setCancelIconLeft(R.drawable.ic_baseline_add_24).setCancelIconTop(R.drawable.ic_baseline_add_24).setCancelIconRight(R.drawable.ic_baseline_add_24).setCancelIconBottom(R.drawable.ic_baseline_add_24)
8. Parent Button
- Change Text Button Size
.setButtonTextSize(21)
- Change Style Button
.setButtonStyle(ButtonStyle.ButtonContained)- Available Value :
ButtonStyle.ButtonContainedButtonStyle.ButtonOutlinedButtonStyle.ButtonText
- Available Value :
- Change Gravity Parent Button
.setButtonGravity(Gravity.CENTER)- Available Value :
Gravity.CENTERGravity.ENDGravity.START- etc.
- Available Value :
- Change Button Background Color
.setButtonColor(getResources().getColor(R.color.colorPrimary))or.setButtonColor(Color.parseColor("#03DAC5"))you can use this only if you use .setButtonStyle(ButtonStyle.ButtonContained)
Look At Orange Arrow. you can set shape/canvas from drawable to dialog with shape.xml-><shape></shape>. in my example i am using rounded_corner_2.xml.
XML :
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
<solid android:color="@android:color/white" />
</shape>Other Example:
- Same Radius ->
R.drawable.rounded_cornerxml Preview - Different Radius ->
R.drawable.rounded_corner_2xml Preview - Dialog 3D ->
R.drawable.rounded_layerxml Preview - Shadow Dialog ->
R.drawable.dialog_shadowxml Preview
Code :
new SearchViewDialog(getSupportFragmentManager(), list)
.setDialogCanvas(getResources().getDrawable(R.drawable.rounded_corner_2))
...
.show();Look At Orange Arrow. You can change Width of dialog, with percentage of your screen. you can use value from 0.5 - 1.0 (50% - 100%).
Code :
new SearchViewDialog(getSupportFragmentManager(), list)
.setCanvasWidth(0.5)
...
.show();Preview :
Look At Orange Arrow. You can change Height of dialog, with number.
Code :
new SearchViewDialog(getSupportFragmentManager(), list)
.setContentListHeight(1100)
...
.show();Preview :
FullScreenDialog You can make dialog FullScreen.
Code :
new SearchViewDialog(getSupportFragmentManager(), list)
.enableFullScreen()
...
.show();Notes. This function will make .setContentListHeight(1100) and .setCanvasWidth(0.5) ignored.
Preview :
Animation Dialog Show You can change dialog animation.
Code :
new SearchViewDialog(getSupportFragmentManager(), list)
.setAnimationStyle(R.style.CustomDialogStyle)
...
.show();Here is the style
<resources>
<!-- res->styles.xml -->
<style name="CustomDialogStyle" parent="Theme.MaterialComponents.Light.Dialog">
<item name="android:windowMinWidthMajor">80%</item>
<item name="android:windowMinWidthMinor">80%</item>
<item name="android:windowEnterAnimation">@anim/anim_in</item>
<item name="android:windowExitAnimation">@anim/anim_out</item>
</style>
</resources>Style that i prepare for you
- anim_in & anim_out.
- slide_down & slide_up.
FullCode Preview :







