Skip to content

Commit c509307

Browse files
committed
fix build issues and open up the apis again that were needed
1 parent da81bab commit c509307

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

core/src/main/java/io/snabble/sdk/DatabaseUtils.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@file:JvmName("DatabaseUtils")
22
package io.snabble.sdk
33

4-
import androidx.annotation.RestrictTo
5-
64
@JvmName("bindArgs")
7-
@RestrictTo(RestrictTo.Scope.LIBRARY)
8-
internal fun String.bindSqlArgs(args: Array<String>?): String {
5+
/**
6+
* Binds the strings in args to ocurrences of '?' in a sql string
7+
*/
8+
fun String.bindSqlArgs(args: Array<String>?): String {
99
if (args == null) {
1010
return this
1111
}

core/src/main/java/io/snabble/sdk/UserPreferences.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ class UserPreferences internal constructor(context: Context) {
195195
.apply()
196196
}
197197

198-
199-
internal var consentStatus: ConsentStatus
198+
/**
199+
* The current consent status
200+
*/
201+
var consentStatus: ConsentStatus
200202
@RestrictTo(RestrictTo.Scope.LIBRARY)
201203
get() {
202204
val s = sharedPreferences.getString(SHARED_PREFERENCES_BIRTHDAY, null)
@@ -213,7 +215,10 @@ class UserPreferences internal constructor(context: Context) {
213215
.putString(SHARED_PREFERENCES_CONSENT_STATUS, consent.name)
214216
.apply()
215217

216-
internal var consentVersion: String?
218+
/**
219+
* The current accepted consent version
220+
*/
221+
var consentVersion: String?
217222
@RestrictTo(RestrictTo.Scope.LIBRARY)
218223
get() = sharedPreferences.getString(SHARED_PREFERENCES_CONSENT_VERSION, null)
219224
@RestrictTo(RestrictTo.Scope.LIBRARY)

ui/src/main/java/io/snabble/sdk/ui/utils/ViewExt.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ fun View.setOneShotClickListener(callback: () -> Unit) =
5959
}
6060
)
6161

62+
inline var View.marginTop: Int
63+
get() = (layoutParams as? ViewGroup.MarginLayoutParams)?.topMargin ?: 0
64+
set(value) {
65+
(layoutParams as? ViewGroup.MarginLayoutParams)?.topMargin = value
66+
}
67+
68+
inline var View.marginBottom: Int
69+
get() = (layoutParams as? ViewGroup.MarginLayoutParams)?.bottomMargin ?: 0
70+
set(value) {
71+
(layoutParams as? ViewGroup.MarginLayoutParams)?.bottomMargin = value
72+
}
73+
6274
inline val View.idName: String
6375
get() = if (id == -1) "null" else context.resources.getResourceName(id)
6476

0 commit comments

Comments
 (0)