Skip to content

Commit

Permalink
version 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Smirnov committed Mar 31, 2021
1 parent 10b750d commit 32898fa
Show file tree
Hide file tree
Showing 175 changed files with 5,513 additions and 373 deletions.
12 changes: 10 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ ext.sdkVersions = [
compileSdk : '29',
buildTools : '29.0.3',

kotlin : '1.4.0',
kotlin : '1.4.30',
androidX : '1.1.0',
okHttp : '4.5.0',

picasso : '2.71828',

androidGradlePlugin : '3.6.0',

gson : '2.8.5',
gson : '2.8.6',

junit : '4.12',
mockito : '1.6.0',
]

ext.sdkLibraries = [
Expand All @@ -57,6 +60,11 @@ ext.sdkLibrariesSupport = [
collection : "androidx.collection:collection:$sdkVersions.androidX",
]

ext.testLibraries = [
junit : "junit:junit:$sdkVersions.junit",
mockito : "com.nhaarman:mockito-kotlin:$sdkVersions.mockito",
]

ext.sdkGradlePlugins = [
android : "com.android.tools.build:gradle:$sdkVersions.androidGradlePlugin",
kotlinGradle : "org.jetbrains.kotlin:kotlin-gradle-plugin:$sdkVersions.kotlin",
Expand Down
1 change: 0 additions & 1 deletion samples/app/sdk/src/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
implementation sdkLibraries.kotlin
implementation sdkLibrariesSupport.recyclerView
implementation sdkLibrariesSupport.appCompat
Expand Down
2 changes: 1 addition & 1 deletion samples/app/sdk/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<resources>
<string name="login">Войти</string>
<string name="logout">Выйти</string>
<string name="share_to_wall">Отправить на стену</string>
<string name="share_to_wall">Post on wall</string>
<string name="message_hint">Ваше сообщение</string>
<string name="wall_ok">Posted</string>
</resources>
46 changes: 38 additions & 8 deletions vk-sdk-api/src/main/java/com/vk/sdk/api/GsonHolder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ object GsonHolder {

private fun makeBuilder(): GsonBuilder {
val builder = GsonBuilder()
builder.registerTypeAdapter(com.vk.sdk.api.calls.dto.CallsEndState::class.java,
com.vk.sdk.api.calls.dto.CallsEndState.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetStatisticsStatsFields::class.java,
com.vk.sdk.api.ads.dto.AdsGetStatisticsStatsFields.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.ads.dto.AdsGetStatisticsPeriod::class.java,
Expand Down Expand Up @@ -133,16 +135,36 @@ object GsonHolder {
com.vk.sdk.api.wall.dto.WallReportCommentReason.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsMediaType::class.java,
com.vk.sdk.api.messages.dto.MessagesGetHistoryAttachmentsMediaType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeInfo::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeInfo.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Call::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Call.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.UseMassMentions::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.UseMassMentions.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangePin::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangePin.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeAdmins::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.ChangeAdmins.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Invite::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.Invite.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.SeeInviteLink::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsPermissions.SeeInviteLink.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesConversation.SpecialServiceType::class.java,
com.vk.sdk.api.messages.dto.MessagesConversation.SpecialServiceType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesConversationPeerType::class.java,
com.vk.sdk.api.messages.dto.MessagesConversationPeerType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetIntentUsersIntent::class.java,
com.vk.sdk.api.messages.dto.MessagesGetIntentUsersIntent.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetHistoryRev::class.java,
com.vk.sdk.api.messages.dto.MessagesGetHistoryRev.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesKeyboardButton.Color::class.java,
com.vk.sdk.api.messages.dto.MessagesKeyboardButton.Color.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesChatSettingsState::class.java,
com.vk.sdk.api.messages.dto.MessagesChatSettingsState.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesSendIntent::class.java,
com.vk.sdk.api.messages.dto.MessagesSendIntent.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesSetActivityType::class.java,
com.vk.sdk.api.messages.dto.MessagesSetActivityType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesTemplateActionTypeNames::class.java,
com.vk.sdk.api.messages.dto.MessagesTemplateActionTypeNames.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.messages.dto.MessagesGetConversationsFilter::class.java,
Expand Down Expand Up @@ -185,10 +207,14 @@ object GsonHolder {
com.vk.sdk.api.fave.dto.FaveAddTagPosition.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveBookmarkType::class.java,
com.vk.sdk.api.fave.dto.FaveBookmarkType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveRemoveClassifiedItemSource::class.java,
com.vk.sdk.api.fave.dto.FaveRemoveClassifiedItemSource.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveSetTagsItemType::class.java,
com.vk.sdk.api.fave.dto.FaveSetTagsItemType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveGetItemType::class.java,
com.vk.sdk.api.fave.dto.FaveGetItemType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.fave.dto.FaveAddClassifiedItemSource::class.java,
com.vk.sdk.api.fave.dto.FaveAddClassifiedItemSource.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsGetByIdNameCase::class.java,
com.vk.sdk.api.polls.dto.PollsGetByIdNameCase.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.polls.dto.PollsBackground.Type::class.java,
Expand Down Expand Up @@ -507,28 +533,32 @@ object GsonHolder {
com.vk.sdk.api.stats.dto.StatsGetInterval.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.widgets.dto.WidgetsCommentMediaType::class.java,
com.vk.sdk.api.widgets.dto.WidgetsCommentMediaType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooterButton.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooterButton.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.store.dto.StoreProduct.Type::class.java,
com.vk.sdk.api.store.dto.StoreProduct.Type.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostFeedbackType::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostFeedbackType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigest.Template::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigest.Template.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestHeader.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestHeader.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItemType::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedNewsfeedItemType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostType::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedUnsubscribeType::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedUnsubscribeType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooter.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooter.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedFilters::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedFilters.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestButton.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestButton.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestHeader.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestHeader.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostType::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemWallpostType.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooter.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFooter.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedNameCase::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedGetBannedNameCase.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedCommentsFilters::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedCommentsFilters.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFullItem.Style::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedItemDigestFullItem.Style.Serializer())
builder.registerTypeAdapter(com.vk.sdk.api.newsfeed.dto.NewsfeedIgnoreItemType::class.java,
com.vk.sdk.api.newsfeed.dto.NewsfeedIgnoreItemType.Serializer())
return builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ import kotlin.Int
* @param disabledUntil Time until that notifications are disabled in seconds
* @param peerId Peer ID
* @param sound Information whether the sound are enabled
* @param disabledMentions Information whether the mentions are disabled
* @param disabledMassMentions Information whether the mass mentions (like '@all', '@online') are
* disabled. Can be affected by 'disabled_mentions'
*/
data class AccountPushConversationsItem(
@SerializedName(value="disabled_until")
val disabledUntil: Int,
@SerializedName(value="peer_id")
val peerId: Int,
@SerializedName(value="sound")
val sound: BaseBoolInt
val sound: BaseBoolInt,
@SerializedName(value="disabled_mentions")
val disabledMentions: BaseBoolInt? = null,
@SerializedName(value="disabled_mass_mentions")
val disabledMassMentions: BaseBoolInt? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ data class AdsAdLayout(
@SerializedName(value="description")
val description: String,
@SerializedName(value="id")
val id: Int,
val id: String,
@SerializedName(value="image_src")
val imageSrc: String,
@SerializedName(value="link_url")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ import kotlin.String
/**
* @param id Targeting music artist ID
* @param name Music artist name
* @param avatar Music artist photo
*/
data class AdsMusician(
@SerializedName(value="id")
val id: Int,
@SerializedName(value="name")
val name: String
val name: String,
@SerializedName(value="avatar")
val avatar: String? = null
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2019 vk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// *********************************************************************
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api.ads.methods

import com.vk.sdk.api.ApiRequestBase
import com.vk.sdk.api.GsonHolder
import com.vk.sdk.api.ads.dto.AdsGetMusiciansResponseDto
import com.vk.sdk.api.ads.responses.AdsGetMusiciansResponse
import kotlin.Int
import kotlin.collections.List
import org.json.JSONObject

/**
* @param ids
*/
class AdsGetMusiciansByIds(
private val ids: List<Int>
) : ApiRequestBase<AdsGetMusiciansResponseDto>(methodName = "ads.getMusiciansByIds") {
init {
addParam("ids", ids)
}

override fun parse(r: JSONObject): AdsGetMusiciansResponseDto =
GsonHolder.gson.fromJson(r.toString(), AdsGetMusiciansResponse::class.java).response
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2019 vk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// *********************************************************************
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api.apps.dto

import com.google.gson.annotations.SerializedName
import kotlin.String

/**
* @param privacyPolicy URL of the app's privacy policy
* @param terms URL of the app's terms
*/
data class AppsGetMiniAppPoliciesResponseDto(
@SerializedName(value="privacy_policy")
val privacyPolicy: String? = null,
@SerializedName(value="terms")
val terms: String? = null
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2019 vk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// *********************************************************************
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api.apps.dto

import com.google.gson.annotations.SerializedName
import kotlin.String

/**
* @param hash Uploading hash
* @param image Uploaded photo data
*/
data class AppsImageUploadResponseDto(
@SerializedName(value="hash")
val hash: String? = null,
@SerializedName(value="image")
val image: String? = null
)
Loading

0 comments on commit 32898fa

Please sign in to comment.