Skip to content

Commit 14bc44c

Browse files
authored
Merge pull request #30 from gzeinnumer/dev-1
Bug Color
2 parents d52e3d8 + c1e00c0 commit 14bc44c

12 files changed

Lines changed: 63 additions & 337 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</h1>
88

99
<div align="center">
10-
<a><img src="https://img.shields.io/badge/Version-2.2.1-brightgreen.svg?style=flat"></a>
10+
<a><img src="https://img.shields.io/badge/Version-2.2.2-brightgreen.svg?style=flat"></a>
1111
<a><img src="https://img.shields.io/badge/ID-gzeinnumer-blue.svg?style=flat"></a>
1212
<a><img src="https://img.shields.io/badge/Java-Suport-green?logo=java&style=flat"></a>
1313
<a><img src="https://img.shields.io/badge/Koltin-Suport-green?logo=kotlin&style=flat"></a>
@@ -407,6 +407,8 @@ You can Customize your dialog UI. [**ReadMore**](https://github.com/gzeinnumer/M
407407
- Bug Fixing
408408
- **2.2.1**
409409
- Bug Fixing
410+
- **2.2.2**
411+
- Change color method
410412

411413
---
412414

README_1.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can change UI with this configuration.
1212
- Change Text Title Size
1313
- `.setTitleSize(21)`
1414
- Change Text Title Color
15-
- `.setTitleColor(getResources().getColor(R.color.colorAccent))`
15+
- `.setTitleColor(getResources().getColor(R.color.colorPrimary))`
1616
- `.setTitleColor(Color.parseColor("#03DAC5"))`
1717
- Change Text Title Alignment
1818
- `.setTitleAlignment(View.TEXT_ALIGNMENT_TEXT_END)`
@@ -28,7 +28,7 @@ You can change UI with this configuration.
2828
- Change Text Content Size
2929
- `.setContentSize(21)`
3030
- Change Text Content Color
31-
- `.setContentColor(getResources().getColor(R.color.colorAccent))`
31+
- `.setContentColor(getResources().getColor(R.color.colorPrimary))`
3232
- `.setContentColor(Color.parseColor("#03DAC5"))`
3333
- Change Text Content Alignment
3434
- `.setContentAlignment(View.TEXT_ALIGNMENT_TEXT_END)`
@@ -42,7 +42,7 @@ You can change UI with this configuration.
4242
- Change Text Button Cancel
4343
- `.setBtnCancelTitle("Batal")`
4444
- Change Text Button Cancel Color
45-
- `.setBtnCancelTitleColor(getResources().getColor(R.color.colorAccent))`
45+
- `.setBtnCancelTitleColor(getResources().getColor(R.color.colorPrimary))`
4646
- `.setBtnCancelTitleColor(Color.parseColor("#03DAC5"))`
4747
- Change Icon Button Cancel
4848
- `.setCancelIconLeft(R.drawable.ic_baseline_add_24)`
@@ -54,7 +54,7 @@ You can change UI with this configuration.
5454
- Change Text Button Ok
5555
- `.setBtnOkTitle("Yuhuu")`
5656
- Change Text Button Ok Color
57-
- `.setBtnOkTitleColor(getResources().getColor(R.color.colorAccent))`
57+
- `.setBtnOkTitleColor(getResources().getColor(R.color.colorPrimary))`
5858
- `.setBtnOkTitleColor(Color.parseColor("#03DAC5"))`
5959
- Change Icon Button Ok
6060
- `.setOkIconLeft(R.drawable.ic_baseline_add_24)`
@@ -79,7 +79,7 @@ You can change UI with this configuration.
7979
- `Gravity.START`
8080
- etc.
8181
- Change Button Background Color
82-
- `.setButtonColor(R.color.amber_200)` you can use this only if you use `.setButtonStyle(ButtonStyle.ButtonContained)`
82+
- `.setButtonColor(getResources().getColor(R.color.colorPrimary))` or `.setButtonColor(Color.parseColor("#03DAC5"))` you can use this only if you use `.setButtonStyle(ButtonStyle.ButtonContained)`
8383
- Disable Text All Caps On Button
8484
- `.setButtonAllCaps(false)` default value is true.
8585

README_2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can change UI with this configuration.
1212
- Change Text Title Size
1313
- `.setTitleSize(21)`
1414
- Change Text Title Color
15-
- `.setTitleColor(getResources().getColor(R.color.colorAccent))`
15+
- `.setTitleColor(getResources().getColor(R.color.colorPrimary))`
1616
- `.setTitleColor(Color.parseColor("#03DAC5"))`
1717
- Change Text Title Alignment
1818
- `.setTitleAlignment(View.TEXT_ALIGNMENT_TEXT_END)`
@@ -28,7 +28,7 @@ You can change UI with this configuration.
2828
- Change Text Content Size
2929
- `.setContentSize(21)`
3030
- Change Text Content Color
31-
- `.setContentColor(getResources().getColor(R.color.colorAccent))`
31+
- `.setContentColor(getResources().getColor(R.color.colorPrimary))`
3232
- `.setContentColor(Color.parseColor("#03DAC5"))`
3333
- Change Text Content Alignment
3434
- `.setContentAlignment(View.TEXT_ALIGNMENT_TEXT_END)`
@@ -42,7 +42,7 @@ You can change UI with this configuration.
4242
- Change Text Button Ok
4343
- `.setBtnOkTitle("Yuhuu")`
4444
- Change Text Button Ok Color
45-
- `.setBtnOkTitleColor(getResources().getColor(R.color.colorAccent))`
45+
- `.setBtnOkTitleColor(getResources().getColor(R.color.colorPrimary))`
4646
- `.setBtnOkTitleColor(Color.parseColor("#03DAC5"))`
4747
- Change Icon Button Ok
4848
- `.setOkIconLeft(R.drawable.ic_baseline_add_24)`
@@ -74,7 +74,7 @@ You can change UI with this configuration.
7474
- `Gravity.START`
7575
- etc.
7676
- Change Button Background Color
77-
- `.setButtonColor(R.color.amber_200)` you can use this only if you use `.setButtonStyle(ButtonStyle.ButtonContained)`
77+
- `.setButtonColor(getResources().getColor(R.color.colorPrimary))` or `.setButtonColor(Color.parseColor("#03DAC5"))` you can use this only if you use `.setButtonStyle(ButtonStyle.ButtonContained)`
7878
- Disable Text All Caps On Button
7979
- `.setButtonAllCaps(false)` default value is true.
8080

README_3.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can change UI with this configuration.
1212
- Change Text Title Size
1313
- `.setTitleSize(21)`
1414
- Change Text Title Color
15-
- `.setTitleColor(getResources().getColor(R.color.colorAccent))`
15+
- `.setTitleColor(getResources().getColor(R.color.colorPrimary))`
1616
- `.setTitleColor(Color.parseColor("#03DAC5"))`
1717
- Change Text Title Alignment
1818
- `.setTitleAlignment(View.TEXT_ALIGNMENT_TEXT_END)`
@@ -28,7 +28,7 @@ You can change UI with this configuration.
2828
- Change Text Content Size
2929
- `.setContentSize(21)`
3030
- Change Text Content Color
31-
- `.setContentColor(getResources().getColor(R.color.colorAccent))`
31+
- `.setContentColor(getResources().getColor(R.color.colorPrimary))`
3232
- `.setContentColor(Color.parseColor("#03DAC5"))`
3333
- Change Text Content Alignment
3434
- `.setContentAlignment(View.TEXT_ALIGNMENT_TEXT_END)`
@@ -42,7 +42,7 @@ You can change UI with this configuration.
4242
- Change Text Button Cancel
4343
- `.setBtnCancelTitle("Batal")`
4444
- Change Text Button Cancel Color
45-
- `.setBtnCancelTitleColor(getResources().getColor(R.color.colorAccent))`
45+
- `.setBtnCancelTitleColor(getResources().getColor(R.color.colorPrimary))`
4646
- `.setBtnCancelTitleColor(Color.parseColor("#03DAC5"))`
4747
- Change Icon Button Cancel
4848
- `.setCancelIconLeft(R.drawable.ic_baseline_add_24)`
@@ -54,7 +54,7 @@ You can change UI with this configuration.
5454
- Change Text Button Ok
5555
- `.setBtnOkTitle("Yuhuu")`
5656
- Change Text Button Ok Color
57-
- `.setBtnOkTitleColor(getResources().getColor(R.color.colorAccent))`
57+
- `.setBtnOkTitleColor(getResources().getColor(R.color.colorPrimary))`
5858
- `.setBtnOkTitleColor(Color.parseColor("#03DAC5"))`
5959
- Change Icon Button Ok
6060
- `.setOkIconLeft(R.drawable.ic_baseline_add_24)`
@@ -79,7 +79,7 @@ You can change UI with this configuration.
7979
- `Gravity.START`
8080
- etc.
8181
- Change Button Background Color
82-
- `.setButtonColor(R.color.amber_200)` you can use this only if you use `.setButtonStyle(ButtonStyle.ButtonContained)`
82+
- `.setButtonColor(getResources().getColor(R.color.colorPrimary))` or `.setButtonColor(Color.parseColor("#03DAC5"))` you can use this only if you use `.setButtonStyle(ButtonStyle.ButtonContained)`
8383
- Disable Text All Caps On Button
8484
- `.setButtonAllCaps(false)` default value is true.
8585

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ dependencies {
3535
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
3636
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
3737

38-
implementation 'com.google.android.material:material:1.2.0'
38+
implementation 'com.google.android.material:material:1.2.1'
3939
api 'com.agrawalsuneet.androidlibs:dotsloader:1.4'
40+
implementation 'com.github.gzeinnumer:MyLibStyle:0.1.5'
4041

4142
implementation project(':lib')
4243

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package com.gzeinnumer.mylibdialog;
22

33
import android.os.Bundle;
4-
import android.view.Gravity;
5-
import android.view.View;
6-
import android.widget.Button;
4+
import android.widget.Toast;
75

86
import androidx.appcompat.app.AppCompatActivity;
97

108
import com.gzeinnumer.mylibdialog.constant.ButtonStyle;
11-
import com.gzeinnumer.mylibdialog.dialog.infoDialog.InfoDialog;
129
import com.gzeinnumer.mylibdialog.dialog.numberPicker.NumberPickerDialog;
1310

1411
public class MainActivity extends AppCompatActivity {
@@ -17,5 +14,27 @@ public class MainActivity extends AppCompatActivity {
1714
protected void onCreate(Bundle savedInstanceState) {
1815
super.onCreate(savedInstanceState);
1916
setContentView(R.layout.activity_main);
17+
18+
new NumberPickerDialog(getSupportFragmentManager())
19+
.setLastValue(12)
20+
.setTitle("ini title")
21+
.setContent("ini content")
22+
.setContentColor(getResources().getColor(R.color.colorPrimary))
23+
.setButtonStyle(ButtonStyle.ButtonContained)
24+
.setButtonColor(getResources().getColor(R.color.red_500))
25+
// .setButtonColor(Color.parseColor("#03DAC5"))
26+
.onOkPressedCallBack(new NumberPickerDialog.OnOkPressed() {
27+
@Override
28+
public void onOkPressed(int value) {
29+
Toast.makeText(MainActivity.this, "Nilai nya " + value, Toast.LENGTH_SHORT).show();
30+
}
31+
})
32+
.onCancelPressedCallBack(new NumberPickerDialog.OnCancelPressed() {
33+
@Override
34+
public void onCancelPressed() {
35+
Toast.makeText(MainActivity.this, "Cancel", Toast.LENGTH_SHORT).show();
36+
}
37+
})
38+
.show();
2039
}
2140
}

app/src/main/res/values/styles.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<!-- Base application theme. -->
33
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
44
<!-- Customize your theme here. -->
5-
<item name="colorPrimary">@color/colorPrimary</item>
6-
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
5+
<item name="colorPrimary">@color/red_500</item>
6+
<item name="colorPrimaryDark">@color/red_800</item>
77
<item name="colorAccent">@color/colorAccent</item>
88
</style>
99
</resources>

lib/src/main/java/com/gzeinnumer/mylibdialog/dialog/confirmDialog/ConfirmDialogSetting.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ private void initDesign() {
184184
}
185185

186186
if (buttonColor!=0 && btnStyle == ButtonStyle.ButtonContained){
187-
_dBtnCancelMBC.setBackgroundColor(getResources().getColor(buttonColor));
188-
_dBtnOkMBC.setBackgroundColor(getResources().getColor(buttonColor));
187+
_dBtnCancelMBC.setBackgroundColor(buttonColor);
188+
_dBtnOkMBC.setBackgroundColor(buttonColor);
189189
}
190190

191191
if (!buttonAllCaps){

lib/src/main/java/com/gzeinnumer/mylibdialog/dialog/infoDialog/InfoDialogSetting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private void initDesign() {
182182
}
183183

184184
if (buttonColor!=0 && btnStyle == ButtonStyle.ButtonContained){
185-
_dBtnOkMBC.setBackgroundColor(getResources().getColor(buttonColor));
185+
_dBtnOkMBC.setBackgroundColor(buttonColor);
186186
}
187187

188188
if (!buttonAllCaps){

lib/src/main/java/com/gzeinnumer/mylibdialog/dialog/numberPicker/NumberPickerDialogSetting.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,21 @@ private void initDesign() {
188188
_tvTitle.setTextAlignment(tvTitleAlignment);
189189
}
190190

191-
if(tvContentAlignment != View.TEXT_ALIGNMENT_TEXT_START){
191+
if (tvContentAlignment != View.TEXT_ALIGNMENT_TEXT_START) {
192192
_tvContent.setTextAlignment(tvContentAlignment);
193193
}
194194

195-
if (buttonColor!=0 && btnStyle == ButtonStyle.ButtonContained){
196-
_dBtnCancelMBC.setBackgroundColor(getResources().getColor(buttonColor));
197-
_dBtnOkMBC.setBackgroundColor(getResources().getColor(buttonColor));
195+
if (buttonColor != 0 && btnStyle == ButtonStyle.ButtonContained) {
196+
_dBtnCancelMBC.setBackgroundColor(buttonColor);
197+
_dBtnOkMBC.setBackgroundColor(buttonColor);
198198
}
199199

200-
if (!buttonAllCaps){
200+
if (buttonColor != 0) {
201+
_btnSubtract.setBackgroundColor(buttonColor);
202+
_btnAdd.setBackgroundColor(buttonColor);
203+
}
204+
205+
if (!buttonAllCaps) {
201206
_dBtnCancelMBT.setAllCaps(false);
202207
_dBtnCancelMBO.setAllCaps(false);
203208
_dBtnCancelMBC.setAllCaps(false);

0 commit comments

Comments
 (0)