Release 0.2.0 (#150)
Release Notes * Bumped haze, agp, and guava dependencies * Implemented ordering functionality for friends list * Added scroll to top feature in friends and conversations screens * Improved messages handling * Fixed coloring issues * Cache improvements * Implemented logout functionality * Implemented new authorization flow (no auto-token re-request) * Added support for sticker pack preview attachments * Bump LongPoll to version 19 * Markdown support for messages bubbles * Adjust app name font size based on screen width --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,7 @@ object AppConstants {
|
||||
|
||||
const val INSTALL_APP_MIME_TYPE = "application/vnd.android.package-archive"
|
||||
|
||||
const val API_VERSION = "5.173"
|
||||
const val API_VERSION = "5.238"
|
||||
const val URL_OAUTH = "https://oauth.vk.com"
|
||||
const val URL_API = "https://api.vk.com/method"
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ object VkConstants {
|
||||
const val GROUP_FIELDS = "description,members_count,counters,status,verified"
|
||||
|
||||
const val USER_FIELDS =
|
||||
"photo_50,photo_100,photo_200,photo_400_orig,status,screen_name,online,online_mobile,last_seen,verified,sex,online_info,bdate"
|
||||
"photo_50,photo_100,photo_200,photo_400_orig,status,screen_name,online_info,last_seen,verified,sex,bdate"
|
||||
|
||||
const val ALL_FIELDS =
|
||||
"$USER_FIELDS,$GROUP_FIELDS"
|
||||
|
||||
const val LP_VERSION = 10
|
||||
const val LP_VERSION = 19
|
||||
|
||||
const val VK_APP_ID = "2274003"
|
||||
const val VK_SECRET = "hHbZxrka2uZ6jB1inYsH"
|
||||
@@ -18,6 +18,11 @@ object VkConstants {
|
||||
const val FAST_GROUP_ID = -119516304
|
||||
const val FAST_APP_ID = "6964679"
|
||||
|
||||
const val MESSENGER_APP_ID = 51453752
|
||||
const val MESSENGER_APP_SECRET = "4UyuCUsdK8pVCNoeQuGi"
|
||||
|
||||
const val MESSENGER_APP_SCOPE = 1454174
|
||||
|
||||
object Auth {
|
||||
const val SCOPE = "notify," +
|
||||
"friends," +
|
||||
|
||||
@@ -75,6 +75,11 @@ fun <T> MutableStateFlow<T>.setValue(function: (T) -> T) {
|
||||
update { newValue }
|
||||
}
|
||||
|
||||
fun <T> MutableStateFlow<T>.updateValue(block: T.() -> T) {
|
||||
val newValue = block(value)
|
||||
update { newValue }
|
||||
}
|
||||
|
||||
fun Any.asInt(): Int {
|
||||
return when (this) {
|
||||
is Number -> this.toInt()
|
||||
@@ -83,6 +88,14 @@ fun Any.asInt(): Int {
|
||||
}
|
||||
}
|
||||
|
||||
fun Any.asLong(): Long {
|
||||
return when(this) {
|
||||
is Number -> this.toLong()
|
||||
|
||||
else -> throw IllegalArgumentException("Object is not numeric")
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> Any.toList(mapper: (old: Any) -> T): List<T> {
|
||||
return when (this) {
|
||||
is List<*> -> this.mapNotNull { it?.run(mapper) }
|
||||
|
||||
Reference in New Issue
Block a user