Skip to content

Commit

Permalink
version 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Smirnov committed Dec 21, 2020
1 parent 2e628db commit 10b750d
Show file tree
Hide file tree
Showing 379 changed files with 8,880 additions and 971 deletions.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ SOFTWARE.
*/

ext.sdkVersions = [
code : '19',
name : '2.4.0',
code : '21',
name : '2.6.0',

minSdk : 21,
targetSdk : 29,
Expand Down
1 change: 1 addition & 0 deletions samples/app/sdk/src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
66 changes: 66 additions & 0 deletions samples/app/sdk/src/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*******************************************************************************
* 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.
******************************************************************************/

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: '../../dependencies.gradle'

android {
compileSdkVersion "$sdkVersions.compileSdk".toInteger()
buildToolsVersion "$sdkVersions.buildTools"

defaultConfig {
applicationId = "com.vk.sdk.sample"
minSdkVersion "$sdkVersions.minSdk"
targetSdkVersion "$sdkVersions.targetSdk"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError true
checkReleaseBuilds true
}

dexOptions {
preDexLibraries true
javaMaxHeapSize "5g"
}
}

dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
implementation sdkLibraries.kotlin
implementation sdkLibrariesSupport.recyclerView
implementation sdkLibrariesSupport.appCompat
implementation (sdkLibraries.picasso) { transitive = false }
implementation sdkLibraries.okHttp

implementation project(':libapi-sdk-core')
implementation project(':libapi-sdk-api')
//implementation 'com.vk:androidsdk:2.0.0'
}
56 changes: 56 additions & 0 deletions samples/app/sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!-- *******************************************************************************
# 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.
# ****************************************************************************** -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vk.sdk.sample">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:name=".SampleApplication"
android:allowBackup="false"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme" >
<activity
android:name=".WelcomeActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".UserActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name" />
</application>
</manifest>
43 changes: 43 additions & 0 deletions samples/app/sdk/src/main/java/com/vk/sdk/sample/PathUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*******************************************************************************
* 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.
******************************************************************************/

package com.vk.sdk.sample

import android.content.Context
import android.net.Uri
import android.provider.MediaStore

object PathUtils {
fun getPath(context: Context, uri: Uri): String {
if (uri.scheme == "file") {
if (uri.path != null) return uri.path!!
return ""
}
val proj = arrayOf(MediaStore.Images.Media.DATA)
val cursor = context.contentResolver.query(uri, proj, null, null, null)
val columnIndex = cursor!!.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)
cursor.moveToFirst()
return "file://" + cursor.getString(columnIndex)
}
}
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.
******************************************************************************/

package com.vk.sdk.sample

import android.app.Application
import com.vk.api.sdk.VK
import com.vk.api.sdk.VKTokenExpiredHandler

class SampleApplication: Application() {
override fun onCreate() {
super.onCreate()
VK.addTokenExpiredHandler(tokenTracker)
}

private val tokenTracker = object: VKTokenExpiredHandler {
override fun onTokenExpired() {
WelcomeActivity.startFrom(this@SampleApplication)
}
}
}
Loading

0 comments on commit 10b750d

Please sign in to comment.