Skip to content

Commit 2080a29

Browse files
committed
add system default option to theme choice
1 parent 45b7657 commit 2080a29

File tree

9 files changed

+16
-10
lines changed

9 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### v1.7.0
4+
5+
* Add system default option for Android Q's theming capabilities
6+
37
### v1.6.1
48

59
* Update dark theme background

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To include it in your project, add this to your module's `build.gradle` file:
1919
```groovy
2020
dependencies {
2121
...
22-
compile 'com.klinkerapps:drag-dismiss-activity:1.6.1'
22+
compile 'com.klinkerapps:drag-dismiss-activity:1.7.0'
2323
}
2424
```
2525

@@ -81,7 +81,7 @@ I have provided a [DragDismissBundleBuilder](https://github.com/klinker24/Androi
8181
Intent dragDismissActivity = new Intent(this, MyDragDismissActivity.class);
8282

8383
new DragDismissBundleBuilder(context)
84-
.setTheme(DragDismissBundleBuilder.Theme.LIGHT) // LIGHT (default), DARK, BLACK, DAY_NIGHT
84+
.setTheme(DragDismissBundleBuilder.Theme.LIGHT) // LIGHT (default), DARK, BLACK, DAY_NIGHT, SYSTEM_DEFAULT
8585
.setPrimaryColorResource(R.color.colorPrimary) // defaults to a semi-transparent black
8686
.setToolbarTitle("Normal Activity Sample") // defaults to null
8787
.setShowToolbar(true) // defaults to true
@@ -117,7 +117,7 @@ The full changelog for the library can be found [here](https://github.com/klinke
117117

118118
## License
119119

120-
Copyright 2017 Luke Klinker
120+
Copyright 2019 Luke Klinker
121121

122122
Licensed under the Apache License, Version 2.0 (the "License");
123123
you may not use this file except in compliance with the License.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ buildscript {
2020
google()
2121
}
2222
dependencies {
23-
classpath 'com.android.tools.build:gradle:3.1.4'
23+
classpath 'com.android.tools.build:gradle:3.4.0'
2424
}
2525
}
2626

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# limitations under the License.
1515
#
1616

17-
GRADLE_PLUGIN_VERSION=3.2.0
17+
GRADLE_PLUGIN_VERSION=3.4.0
1818
ANDROID_X_VERSION=1.0.0
1919

2020
MIN_SDK=15
2121
TARGET_SDK=28
2222
COMPILE_SDK=28
2323

24-
VERSION_NAME=1.6.1
24+
VERSION_NAME=1.7.0
2525
VERSION_CODE=1
2626
GROUP=com.klinkerapps
2727

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
implementation "com.google.android.material:material:${ANDROID_X_VERSION}"
5656

5757
testImplementation 'junit:junit:4.12'
58-
testImplementation "org.robolectric:robolectric:3.8"
58+
testImplementation "org.robolectric:robolectric:4.2"
5959
testImplementation 'org.mockito:mockito-all:1.10.19'
6060
testImplementation 'org.powermock:powermock-mockito-release-full:1.6.1'
6161
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.0'

library/src/main/java/xyz/klinker/android/drag_dismiss/DragDismissIntentBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class DragDismissIntentBuilder {
3636
public static final int DEFAULT_TOOLBAR_RESOURCE = R.color.dragdismiss_toolbarBackground;
3737

3838
public enum Theme {
39-
LIGHT, DARK, BLACK, DAY_NIGHT
39+
LIGHT, DARK, BLACK, DAY_NIGHT, SYSTEM_DEFAULT
4040
}
4141

4242
public enum DragElasticity {

library/src/main/java/xyz/klinker/android/drag_dismiss/delegate/AbstractDragDismissDelegate.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ private void getIntentExtras() {
9898
activity.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
9999
} else if (DragDismissIntentBuilder.Theme.BLACK.name().equals(theme)) {
100100
activity.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
101+
} else if (DragDismissIntentBuilder.Theme.SYSTEM_DEFAULT.name().equals(theme)) {
102+
activity.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
101103
} else {
102104
activity.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
103105
}

library/src/test/java/xyz/klinker/android/drag_dismiss/DragDismissRobolectricSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import androidx.fragment.app.FragmentTransaction;
3232

3333
@RunWith(RobolectricTestRunner.class)
34-
@Config(sdk = {16, 19, 21, 25}, constants = BuildConfig.class)
34+
@Config(sdk = {16, 19, 21, 25})
3535
public abstract class DragDismissRobolectricSuite {
3636

3737
@Before

0 commit comments

Comments
 (0)