Skip to content

Commit 3533aa6

Browse files
committed
RC3
2 parents 57656a6 + 8e5977c commit 3533aa6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1768
-159
lines changed

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44
/.idea/caches
55
/.idea/libraries
66
/.idea/modules.xml
7+
/.idea/misc.xml
78
/.idea/workspace.xml
89
/.idea/navEditor.xml
910
/.idea/assetWizardSettings.xml
11+
/protocol/.idea/caches
12+
/protocol/.idea/libraries
13+
/protocol/.idea/modules.xml
14+
/protocol/.idea/misc.xml
15+
/protocol/.idea/workspace.xml
16+
/protocol/.idea/navEditor.xml
17+
/protocol/.idea/assetWizardSettings.xml
1018
.DS_Store
1119
/build
1220
/captures
@@ -51,7 +59,6 @@ proguard/
5159
captures/
5260

5361
# IntelliJ
54-
*.iml
5562
.idea/workspace.xml
5663
.idea/tasks.xml
5764
.idea/gradle.xml
@@ -70,7 +77,6 @@ captures/
7077
#*.keystore
7178

7279
# External native build folder generated in Android Studio 2.2 and later
73-
.externalNativeBuild
7480
.cxx/
7581

7682
# Google Services (e.g. APIs or Firebase)
@@ -98,3 +104,5 @@ lint/outputs/
98104
lint/tmp/
99105
# lint/reports/
100106
/app/schemas/eu.vojtechh.takeyourpill.database.PillDatabase/
107+
108+
*.aux

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId "eu.vojtechh.takeyourpill"
1515
minSdkVersion 23
1616
targetSdkVersion 30
17-
versionCode 20210329
18-
versionName "v1.5.rc2"
17+
versionCode 20210413
18+
versionName "v1.5.rc3"
1919

2020
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2121

@@ -60,7 +60,7 @@ kapt {
6060
}
6161

6262
dependencies {
63-
def nav_version = '2.3.4'
63+
def nav_version = '2.3.5'
6464
def fragment_version = '1.3.2'
6565
def lifecycle_version = '2.3.1'
6666
def preference_version = "1.1.1"
@@ -70,7 +70,7 @@ dependencies {
7070

7171
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
7272
implementation "androidx.fragment:fragment-ktx:$fragment_version"
73-
implementation "androidx.recyclerview:recyclerview:1.1.0"
73+
implementation 'androidx.recyclerview:recyclerview:1.2.0'
7474
implementation "androidx.preference:preference-ktx:$preference_version"
7575
implementation "androidx.viewpager2:viewpager2:1.0.0"
7676

@@ -87,9 +87,8 @@ dependencies {
8787
implementation "com.google.android.material:material:1.3.0"
8888

8989
// Hilt
90-
implementation 'com.google.dagger:hilt-android:2.33-beta'
91-
kapt 'com.google.dagger:hilt-android-compiler:2.33-beta'
92-
implementation 'androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03'
90+
implementation 'com.google.dagger:hilt-android:2.34-beta'
91+
kapt 'com.google.dagger:hilt-android-compiler:2.34-beta'
9392
kapt 'androidx.hilt:hilt-compiler:1.0.0-beta01'
9493

9594
// LifeCycle

app/src/main/java/eu/vojtechh/takeyourpill/fragment/DetailsFragment.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ class DetailsFragment : Fragment(R.layout.fragment_details) {
6161
if (pillId == -1L) pillId = args.pillId
6262

6363
model.getPillById(pillId).observe(viewLifecycleOwner) { pill ->
64-
model.pill = pill
65-
initViews()
66-
model.loadedData()
64+
pill?.let {
65+
model.pill = it
66+
initViews()
67+
model.loadedData()
68+
}
6769
}
6870

6971
}

app/src/main/java/eu/vojtechh/takeyourpill/fragment/dialog/HistoryViewDialog.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class HistoryViewDialog :
119119
private fun onItemOptionsClick(view: View, historyItem: BaseModel, position: Int) {
120120
if (historyItem is History) {
121121
popupMenu {
122+
if (requireContext().isDarkThemeOn()) {
123+
style = R.style.Widget_MPM_Menu_Dark
124+
}
122125
section {
123126
title = getString(R.string.edit)
124127
if (historyItem.hasBeenConfirmed) {

app/src/main/java/eu/vojtechh/takeyourpill/klass/Extenstions.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package eu.vojtechh.takeyourpill.klass
33
import android.content.BroadcastReceiver
44
import android.content.Context
55
import android.content.res.ColorStateList
6+
import android.content.res.Configuration
7+
import android.content.res.Configuration.UI_MODE_NIGHT_YES
68
import android.content.res.Resources.Theme
79
import android.graphics.BlendMode
810
import android.graphics.BlendModeColorFilter
@@ -129,8 +131,15 @@ fun Context.getAttrColor(res: Int): Int {
129131
return ContextCompat.getColor(this, typedValue.resourceId)
130132
}
131133

134+
fun Context.isDarkThemeOn(): Boolean {
135+
return resources.configuration.uiMode and
136+
Configuration.UI_MODE_NIGHT_MASK == UI_MODE_NIGHT_YES
137+
}
138+
132139
fun Any?.isNull() = this == null
133140

141+
fun Any?.isNotNull() = this != null
142+
134143
fun <T, VH : RecyclerView.ViewHolder> ListAdapter<T, VH>.getItemOrNull(position: Int): T? {
135144
return this.currentList.elementAtOrNull(position)
136145
}

app/src/main/java/eu/vojtechh/takeyourpill/model/Pill.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import androidx.room.Embedded
77
import androidx.room.Ignore
88
import androidx.room.Relation
99
import eu.vojtechh.takeyourpill.R
10+
import eu.vojtechh.takeyourpill.klass.isNotNull
11+
import eu.vojtechh.takeyourpill.klass.isNull
1012

1113
data class Pill(
1214
@Embedded val pillEntity: PillEntity,
@@ -115,9 +117,20 @@ data class Pill(
115117

116118
override fun isContentSame(newItem: BaseModel) =
117119
if (newItem is Pill) {
120+
val isPhotoSame =
121+
if (this.photo.isNull() && newItem.photo.isNotNull()) {
122+
false
123+
} else if (this.photo.isNotNull() && newItem.photo.isNull()) {
124+
false
125+
} else if (this.photo.isNotNull() && newItem.photo.isNotNull()) {
126+
this.photo?.sameAs(newItem.photo) ?: false
127+
} else {
128+
true
129+
}
130+
118131
this.name == newItem.name &&
119132
this.description == newItem.description &&
120-
this.photo?.sameAs(newItem.photo) ?: true &&
133+
isPhotoSame &&
121134
this.color.resource == newItem.color.resource &&
122135
this.deleted == newItem.deleted &&
123136
this.options.isSame(newItem.options) &&

protocol/.idea/.gitignore

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/TakeYourPill-blx.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@Comment{$ biblatex control file $}
2+
@Comment{$ biblatex bcf format version 3.7 $}
3+
% Do not modify this file!
4+
%
5+
% This is an auxiliary file used by the 'biblatex' package.
6+
% This file may safely be deleted. It will be recreated as
7+
% required.
8+
9+
@Control{biblatex-control,
10+
options = {3.7:0:0:1:0:1:1:0:0:0:0:1:3:1:3:1:0:0:3:1:79:+:+:nty},
11+
}

0 commit comments

Comments
 (0)