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
/* | |
SampleAuthenticator (c) by Farhan Khan | |
SampleAuthenticator is licensed under a | |
Creative Commons Attribution 3.0 Unported License. | |
http://creativecommons.org/licenses/by/3.0/ | |
*/ | |
class SampleAuthenticator( |
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
package com.zakrodionov.commonApp.app.platform | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.net.ConnectivityManager | |
import android.net.Network | |
import android.os.Build | |
import androidx.core.content.ContextCompat.getSystemService |
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 Activity.hideKeyboardOnClickOutsideEditText(view: View) { | |
// Set up touch listener for non-text box views to hide keyboard. | |
var previousAction = 0 | |
val onTouchListener = View.OnTouchListener { v, event -> | |
if (currentFocus != null | |
&& event.action != MotionEvent.ACTION_DOWN | |
&& event.action != MotionEvent.ACTION_MOVE | |
&& previousAction != MotionEvent.ACTION_MOVE | |
) { | |
currentFocus?.clearFocus() |
OlderNewer