Skip to content

Commit 10b750d

Browse files
author
Oleg Smirnov
committed
version 2.6.0
1 parent 2e628db commit 10b750d

File tree

379 files changed

+8880
-971
lines changed

Some content is hidden

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

379 files changed

+8880
-971
lines changed

dependencies.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ SOFTWARE.
2323
*/
2424

2525
ext.sdkVersions = [
26-
code : '19',
27-
name : '2.4.0',
26+
code : '21',
27+
name : '2.6.0',
2828

2929
minSdk : 21,
3030
targetSdk : 29,

samples/app/sdk/src/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

samples/app/sdk/src/build.gradle

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*******************************************************************************
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 vk.com
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
******************************************************************************/
24+
25+
apply plugin: 'com.android.application'
26+
apply plugin: 'kotlin-android'
27+
apply from: '../../dependencies.gradle'
28+
29+
android {
30+
compileSdkVersion "$sdkVersions.compileSdk".toInteger()
31+
buildToolsVersion "$sdkVersions.buildTools"
32+
33+
defaultConfig {
34+
applicationId = "com.vk.sdk.sample"
35+
minSdkVersion "$sdkVersions.minSdk"
36+
targetSdkVersion "$sdkVersions.targetSdk"
37+
}
38+
39+
compileOptions {
40+
sourceCompatibility JavaVersion.VERSION_1_8
41+
targetCompatibility JavaVersion.VERSION_1_8
42+
}
43+
44+
lintOptions {
45+
abortOnError true
46+
checkReleaseBuilds true
47+
}
48+
49+
dexOptions {
50+
preDexLibraries true
51+
javaMaxHeapSize "5g"
52+
}
53+
}
54+
55+
dependencies {
56+
implementation fileTree(dir: 'libs', include: '*.jar')
57+
implementation sdkLibraries.kotlin
58+
implementation sdkLibrariesSupport.recyclerView
59+
implementation sdkLibrariesSupport.appCompat
60+
implementation (sdkLibraries.picasso) { transitive = false }
61+
implementation sdkLibraries.okHttp
62+
63+
implementation project(':libapi-sdk-core')
64+
implementation project(':libapi-sdk-api')
65+
//implementation 'com.vk:androidsdk:2.0.0'
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!-- *******************************************************************************
2+
# The MIT License (MIT)
3+
#
4+
# Copyright (c) 2019 vk.com
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
# ****************************************************************************** -->
24+
25+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
26+
package="com.vk.sdk.sample">
27+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
28+
29+
<application
30+
android:name=".SampleApplication"
31+
android:allowBackup="false"
32+
android:label="@string/app_name"
33+
android:icon="@mipmap/ic_launcher_round"
34+
android:roundIcon="@mipmap/ic_launcher_round"
35+
android:supportsRtl="true"
36+
android:networkSecurityConfig="@xml/network_security_config"
37+
android:theme="@style/AppTheme" >
38+
<activity
39+
android:name=".WelcomeActivity"
40+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
41+
android:label="@string/app_name"
42+
android:launchMode="singleInstance"
43+
android:windowSoftInputMode="adjustResize">
44+
<intent-filter>
45+
<action android:name="android.intent.action.MAIN"/>
46+
47+
<category android:name="android.intent.category.LAUNCHER"/>
48+
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
49+
</intent-filter>
50+
</activity>
51+
<activity
52+
android:name=".UserActivity"
53+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
54+
android:label="@string/app_name" />
55+
</application>
56+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*******************************************************************************
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 vk.com
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
******************************************************************************/
24+
25+
package com.vk.sdk.sample
26+
27+
import android.content.Context
28+
import android.net.Uri
29+
import android.provider.MediaStore
30+
31+
object PathUtils {
32+
fun getPath(context: Context, uri: Uri): String {
33+
if (uri.scheme == "file") {
34+
if (uri.path != null) return uri.path!!
35+
return ""
36+
}
37+
val proj = arrayOf(MediaStore.Images.Media.DATA)
38+
val cursor = context.contentResolver.query(uri, proj, null, null, null)
39+
val columnIndex = cursor!!.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)
40+
cursor.moveToFirst()
41+
return "file://" + cursor.getString(columnIndex)
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*******************************************************************************
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 vk.com
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
******************************************************************************/
24+
25+
package com.vk.sdk.sample
26+
27+
import android.app.Application
28+
import com.vk.api.sdk.VK
29+
import com.vk.api.sdk.VKTokenExpiredHandler
30+
31+
class SampleApplication: Application() {
32+
override fun onCreate() {
33+
super.onCreate()
34+
VK.addTokenExpiredHandler(tokenTracker)
35+
}
36+
37+
private val tokenTracker = object: VKTokenExpiredHandler {
38+
override fun onTokenExpired() {
39+
WelcomeActivity.startFrom(this@SampleApplication)
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)