Skip to content

Commit

Permalink
Merge pull request #85 from ChilliBits/master
Browse files Browse the repository at this point in the history
Dark mode support
  • Loading branch information
javiersantos committed Aug 1, 2020
2 parents 8fcf8bc + 3e39871 commit ab89dab
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 25 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.github.javiersantos.materialstyleddialogs.demo"
minSdkVersion 16
targetSdkVersion 29
versionCode 301
versionName "3.0.1"
versionCode 302
versionName "3.0.2"
}
buildTypes {
release {
Expand All @@ -37,12 +37,12 @@ android {

dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.mikepenz:iconics-core:5.0.3'
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.6-kotlin@aar'
implementation('com.mikepenz:aboutlibraries:8.1.2@aar') { transitive = true }
implementation('com.mikepenz:aboutlibraries:8.3.0@aar') { transitive = true }
implementation project(':library')
}
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
android:installLocation="auto">

<application
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar">

Expand Down
6 changes: 2 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
android:fitsSystemWindows="true">

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbarLayout"
Expand Down Expand Up @@ -43,8 +42,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" />
app:layout_collapseMode="pin" />

</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
Expand Down
6 changes: 1 addition & 5 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
Expand All @@ -10,10 +10,6 @@
<item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="CardViewStyle" parent="CardView">
<item name="cardCornerRadius">4dp</item>
<item name="cardElevation">4dp</item>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 11 17:00:19 CEST 2020
#Thu Jul 30 16:56:59 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
8 changes: 4 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
minSdkVersion 14
targetSdkVersion 29
versionCode 301
versionName "3.0.1"
versionCode 302
versionName "3.0.2"
}
buildTypes {
release {
Expand All @@ -33,7 +33,7 @@ repositories {

dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
1 change: 0 additions & 1 deletion library/src/main/res/layout/style_dialog_header_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical">

<RelativeLayout
Expand Down
1 change: 0 additions & 1 deletion library/src/main/res/layout/style_dialog_header_title.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical">

<RelativeLayout
Expand Down
25 changes: 25 additions & 0 deletions library/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MaterialStyledDialogs_Title">
<item name="android:layout_marginTop">20dp</item>
<item name="android:layout_marginBottom">-10dp</item>
<item name="android:layout_marginLeft">26dp</item>
<item name="android:layout_marginRight">26dp</item>
<item name="android:gravity">start</item>
<item name="android:textColor">@android:color/primary_text_dark</item>
<item name="android:textSize">@dimen/md_styled_text_title</item>
<item name="android:textStyle">bold</item>
<item name="android:alpha">0.6</item>
</style>

<style name="MaterialStyledDialogs_Description">
<item name="android:layout_marginTop">20dp</item>
<item name="android:layout_marginBottom">0dp</item>
<item name="android:layout_marginLeft">26dp</item>
<item name="android:layout_marginRight">26dp</item>
<item name="android:gravity">start|center_vertical</item>
<item name="android:textColor">@android:color/primary_text_dark</item>
<item name="android:textSize">@dimen/md_styled_text_description</item>
<item name="android:alpha">0.6</item>
</style>
</resources>

0 comments on commit ab89dab

Please sign in to comment.