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.colorPrimary))
.setTitleColor(Color.parseColor("#03DAC5"))
- Change Text Title Alignment
.setTitleAlignment(View.TEXT_ALIGNMENT_TEXT_END)
- Available Value :
View.TEXT_ALIGNMENT_TEXT_END
View.TEXT_ALIGNMENT_CENTER
View.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.colorPrimary))
.setContentColor(Color.parseColor("#03DAC5"))
- Change Text Content Alignment
.setContentAlignment(View.TEXT_ALIGNMENT_TEXT_END)
- Available Value :
View.TEXT_ALIGNMENT_TEXT_END
View.TEXT_ALIGNMENT_CENTER
View.TEXT_ALIGNMENT_TEXT_START
- etc.
- Available Value :
3. Button Cancel
-
Change Text Button Cancel
.setBtnCancelTitle("Batal")
-
Change Text Button Cancel Color
.setBtnCancelTitleColor(getResources().getColor(R.color.colorPrimary))
.setBtnCancelTitleColor(Color.parseColor("#03DAC5"))
-
Change Button Cancel Color
.setButtonCancelColor(getResources().getColor(R.color.colorPrimary))
.setButtonCancelColor(Color.parseColor("#03DAC5"))
you can use this only if you use
.setButtonStyle(ButtonStyle.ButtonContained)
-
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)
4. Button Ok
-
Change Text Button Ok
.setBtnOkTitle("Yuhuu")
-
Change Text Button Ok Color
.setBtnOkTitleColor(getResources().getColor(R.color.colorPrimary))
.setBtnOkTitleColor(Color.parseColor("#03DAC5"))
-
Change Button Ok Color
.setButtonOkColor(getResources().getColor(R.color.colorPrimary))
.setButtonOkColor(Color.parseColor("#03DAC5"))
you can use this only if you use
.setButtonStyle(ButtonStyle.ButtonContained)
-
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)
5. Parent Button
- Change Text Button Size
.setButtonTextSize(21)
- Change Style Button
.setButtonStyle(ButtonStyle.ButtonContained)
- Available Value :
ButtonStyle.ButtonContained
ButtonStyle.ButtonOutlined
ButtonStyle.ButtonText
- Available Value :
- Change Gravity Parent Button
.setButtonGravity(Gravity.CENTER)
- Available Value :
Gravity.CENTER
Gravity.END
Gravity.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)
- Disable Text All Caps On Button
.setButtonAllCaps(false)
default value is true.
6. EditText Value
- Change Text Button Size
.setLastValue(12)
optional. default value is 0.
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_corner
xml Preview - Different Radius ->
R.drawable.rounded_corner_2
xml Preview - Dialog 3D ->
R.drawable.rounded_layer
xml Preview - Shadow Dialog ->
R.drawable.dialog_shadow
xml Preview
Code :
new NumberPickerDialog(getSupportFragmentManager())
.setDialogCanvas(getResources().getDrawable(R.drawable.rounded_corner_2))
...
.show();
Animation Dialog Show You can change dialog animation
.
Code :
new NumberPickerDialog(getSupportFragmentManager())
.setAnimationStyle(R.style.CustomDialogStyle)
...
.show();
Here is the style
<resources>
<!-- res->styles.xml -->
<style name="CustomDialogStyle" parent="Theme.MaterialComponents.Light.Dialog">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<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 :