This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Buraya serviebuilderModul ekledik | |
@Singleton //Bunu unutma | |
@Component(modules = [AndroidSupportInjectionModule::class, AppModule::class, ViewBuilderModule::class, ServiceBuilderModule::class]) | |
interface AppComponent : AndroidInjector<AppControl> { | |
@Component.Builder | |
abstract class Builder : AndroidInjector.Builder<AppControl>() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val open = KeyboardState.OPEN // change value true | |
private val close = KeyboardState.CLOSE // change value false | |
private var lastKeyboardState = close | |
fun listener(rootView: View?, keyboardState: (KeyboardState) -> Unit) { | |
rootView?.viewTreeObserver?.addOnGlobalLayoutListener { | |
val rect = Rect().apply { rootView.getWindowVisibleDisplayFrame(this) } | |
val screenHeight = rootView.height | |
val keypadHeight = screenHeight - rect.bottom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hideSystemUI() { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) | |
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requireActivity().window.decorView.setOnSystemUiVisibilityChangeListener { visibility -> | |
// Note that system bars will only be "visible" if none of the | |
// LOW_PROFILE, HIDE_NAVIGATION, or FULLSCREEN flags are set. | |
if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { | |
// TODO: The system bars are visible. Make any desired | |
// adjustments to your UI, such as showing the action bar or | |
// other navigational controls. | |
Handler(Looper.getMainLooper()).postDelayed({ | |
hideSystemUi() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
... | |
dependencies { | |
compile 'com.google.android.gms:play-services-safetynet:17.0.0' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun errors(statusCode: Int){ | |
when(statusCode){ | |
RECAPTCHA_INVALID_KEYTYPE -> { | |
Timber.d("Kopyaladığınız \"site key\" doğruluğundan emin olun" ) | |
} | |
RECAPTCHA_INVALID_PACKAGE_NAME -> { | |
Timber.d("Yanlış paket adı.\"Packages\" kısmına doğru paket adını eklediğinizden emin olun" ) | |
} | |
TIMEOUT -> { | |
Timber.d("Captcha zaman aşımına uğradı yeniden yükleyin" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<string name="key_captcha_client_sc_ky" translatable="false">6LdpiycaAAAAACZj3EXVTm4tQy7JisKGih_BmaP3</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun loadCaptcha() { | |
SafetyNet.getClient(activity) | |
.verifyWithRecaptcha(getString(R.string.key_captcha_client_sc_ky)) | |
.addOnSuccessListener(activity) { response -> | |
if (response.tokenResult?.isNotEmpty() == true) { | |
val captchaToken = response.tokenResult //Token elimize ulaştı | |
// Bu kısımda bu aldığımız token'ı | |
// Server kısmında yazacağımız onaylama(token doğrulama) api linki ne yollayacağız | |
// callCaptchaAuth(captChaToken) | |