Skip to content

Commit

Permalink
MC-5659 revert some unuseful changes
Browse files Browse the repository at this point in the history
  • Loading branch information
d.naymushin committed May 11, 2022
1 parent 6791b9c commit 1af838b
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#### Fixed
#### Changes
- [app-demo][tinkoff-id] bump up API versions (minSdk to 23, targetSdk and compileSdk to 31) and dependencies versions MC-5659
- [app-demo][tinkoff-id] bump up API versions (targetSdk and compileSdk to 31) and dependencies versions MC-5659
#### Additions

## 1.0.1
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ implementation "ru.tinkoff.core.tinkoffauth:tinkoff-id:${version}"
+ Зарегистрированный идентификатор авторизуемого приложения (`client_id`)
+ Uri авторизуемого клиента, на который будет выполнен редирект по завершению авторизации (`redirectUri`)
+ Зарегистрированный авторизуемым приложением [App Link](https://developer.android.com/training/app-links), который будет использоваться для возврата в приложение после авторизации. Использование deep link возможно, но не рекомендовано.
+ Авторизация через Тинькофф будет работать только начиная с версии Android 6.0, на более ранних версиях получить авторизационные данные не будет возможности.

## Интеграция

Expand Down
4 changes: 3 additions & 1 deletion app-demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<intent-filter
android:autoVerify="true"
tools:targetApi="m">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.BROWSABLE" />
Expand Down
2 changes: 1 addition & 1 deletion gradle/plugin/publish-lib.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ afterEvaluate {
}

task androidJavadocsJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.set('javadoc')
archiveClassifier.set("javadoc")
from dokkaJavadoc.outputDirectory
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ext {
compileSdkVersion = 31
minSdkVersion = 23
minSdkVersion = 21
targetSdkVersion = 31

isRelease = project.hasProperty('release')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public class TinkoffIdAuth(
* @return true if we can open Tinkoff application
*/
public fun isTinkoffAuthAvailable(): Boolean {
return AppLinkUtil.isPossibleToHandleAppLink(applicationContext) &&
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
AppLinkUtil.isPossibleToHandleAppLink(applicationContext) &&
CodeVerifierUtil.getCodeVerifierChallengeMethod() != CodeVerifierUtil.CODE_CHALLENGE_METHOD_PLAIN
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ internal class TinkoffPartnerApiService(private val api: TinkoffIdApi) {

fun revokeAccessToken(accessToken: String, clientId: String): TinkoffCall<Unit> {
return api.revokeToken(accessToken, TOKEN_HINT_TYPE_ACCESS_TOKEN, clientId).wrapToTinkoffCall(
{ },
{ /* left empty intentionally */ },
{ getRevokeErrorType(it) }
)
}

fun revokeRefreshToken(refreshToken: String, clientId: String): TinkoffCall<Unit> {
return api.revokeToken(refreshToken, TOKEN_HINT_TYPE_REFRESH_TOKEN, clientId).wrapToTinkoffCall(
{ },
{ /* left empty intentionally */ },
{ getRevokeErrorType(it) }
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package ru.tinkoff.core.tinkoffId.ui
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.os.Build
import android.text.Layout
import android.text.StaticLayout
import android.text.TextPaint
Expand Down Expand Up @@ -162,17 +163,32 @@ public class TinkoffIdSignInButton @JvmOverloads constructor(
}

private fun createStaticLayout(textWidth: Int, alignment: Layout.Alignment): StaticLayout {
return StaticLayout.Builder.obtain(
text,
0,
text.length,
textPaint,
textWidth
)
.setAlignment(alignment)
.setLineSpacing(0f, 1f)
.setIncludePad(false)
.build()
val spacingMultiplier = 1f
val spacingAddition = 0f

return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
StaticLayout.Builder.obtain(
text,
0,
text.length,
textPaint,
textWidth
)
.setAlignment(alignment)
.setLineSpacing(spacingAddition, spacingMultiplier)
.setIncludePad(false)
.build()
} else {
StaticLayout(
text,
textPaint,
textWidth,
alignment,
spacingMultiplier,
spacingAddition,
false
)
}
}

private fun Int.dpToPx() = TypedValue.applyDimension(
Expand Down

0 comments on commit 1af838b

Please sign in to comment.