Skip to content

Commit 83e50c7

Browse files
authored
* Updating Instabug SDK Version to 10.6.0 (#385)
* Changing the color picker library to a new library because the old one no longer working
1 parent 588e1a6 commit 83e50c7

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ dependencies {
6565
//exclude group: 'com.android.support'
6666
}
6767
implementation("com.instabug.library:instabug-ndk-crash:$rootProject.ext.instabugSDK")
68-
implementation "petrov.kristiyan:colorpicker-library:$rootProject.ext.colorPicker"
68+
implementation "com.github.skydoves:colorpickerview:$rootProject.ext.colorPicker"
6969
implementation "androidx.fragment:fragment-ktx:$rootProject.ext.fragmentKtx"
7070

7171
}

app/src/main/java/com/example/instabug/ui/activities/SettingsActivity.java

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
import com.instabug.library.Instabug;
1414
import com.instabug.library.InstabugColorTheme;
1515
import com.instabug.library.invocation.InstabugInvocationEvent;
16+
import com.skydoves.colorpickerview.ColorEnvelope;
17+
import com.skydoves.colorpickerview.ColorPickerDialog;
18+
import com.skydoves.colorpickerview.listeners.ColorEnvelopeListener;
1619

1720
import java.util.ArrayList;
1821
import java.util.Arrays;
1922

20-
import petrov.kristiyan.colorpicker.ColorPicker;
2123

2224
public class SettingsActivity extends BaseActivity {
2325

@@ -92,19 +94,27 @@ public void onClick(DialogInterface dialog, int item) {
9294
}
9395

9496
public void onChangePrimaryColorClicked(View view) {
95-
ColorPicker colorPicker = new ColorPicker(this);
96-
colorPicker.show();
97-
colorPicker.setOnChooseColorListener(new ColorPicker.OnChooseColorListener() {
98-
@Override
99-
public void onChooseColor(int position, int color) {
100-
Instabug.setPrimaryColor(color);
101-
}
102-
103-
@Override
104-
public void onCancel() {
105-
// put code
106-
}
107-
});
97+
new ColorPickerDialog.Builder(this)
98+
.setTitle("ColorPicker Dialog")
99+
.setPreferenceName("MyColorPickerDialog")
100+
.setPositiveButton(getString(android.R.string.ok),
101+
new ColorEnvelopeListener() {
102+
@Override
103+
public void onColorSelected(ColorEnvelope envelope, boolean fromUser) {
104+
Instabug.setPrimaryColor(envelope.getColor());
105+
}
106+
})
107+
.setNegativeButton(getString(android.R.string.cancel),
108+
new DialogInterface.OnClickListener() {
109+
@Override
110+
public void onClick(DialogInterface dialogInterface, int i) {
111+
dialogInterface.dismiss();
112+
}
113+
})
114+
.attachAlphaSlideBar(true) // the default value is true.
115+
.attachBrightnessSlideBar(true) // the default value is true.
116+
.setBottomSpace(12) // set a bottom space between the last slidebar and buttons.
117+
.show();
108118

109119
}
110120
}

build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ buildscript {
88
multidex = "2.0.1"
99
material = "1.0.0"
1010
androidXAppCompat = "1.3.0"
11-
instabugSDK = "10.5.1"
12-
colorPicker = "1.1.8"
11+
instabugSDK = "10.6.0"
12+
colorPicker = "2.2.3"
1313
fragmentKtx = "1.3.4"
1414
}
1515
repositories {
16+
google()
17+
mavenCentral()
1618
maven {
1719
// TODO add this only if interested in getting SNAPSHOT releases
1820
url "https://oss.sonatype.org/content/repositories/snapshots"
1921
}
20-
jcenter()
21-
google()
22+
maven { url "https://jitpack.io" }
2223

2324
}
2425
dependencies {
@@ -31,9 +32,13 @@ buildscript {
3132

3233
allprojects {
3334
repositories {
34-
jcenter()
3535
google()
36-
36+
mavenCentral()
37+
maven { url "https://jitpack.io" }
38+
maven {
39+
// TODO add this only if interested in getting SNAPSHOT releases
40+
url "https://oss.sonatype.org/content/repositories/snapshots"
41+
}
3742
}
3843
}
3944

0 commit comments

Comments
 (0)