This file contains 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
class ConnectionLiveData(context: Context) : | |
MutableLiveData<ConnectionLiveData.ServerConnectionType>() { | |
enum class ServerConnectionType { ONLINE, OFFLINE } | |
private var connectivityManager: ConnectivityManager = | |
context.getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager | |
private val connectivityManagerCallback: ConnectivityManager.NetworkCallback = | |
object : ConnectivityManager.NetworkCallback() { |
This file contains 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 ru.energyhouse.energyhouse.data.network.socket | |
import com.google.gson.annotations.SerializedName | |
import ru.energyhouse.energyhouse.utils.consts.CONNECT_VALUE | |
data class ConnectModel( | |
@SerializedName("operation") | |
val command: String = CONNECT_VALUE, | |
var token: String = "" | |
) |
This file contains 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
import android.content.res.Configuration | |
import android.os.Build | |
import android.view.View | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.appcompat.app.AppCompatDelegate | |
import androidx.core.content.ContextCompat | |
import ru.dit.smartstaff.R | |
import ru.dit.smartstaff.repositories.AppThemeRepository | |
class AppThemeDelegate { |
This file contains 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
import android.content.Intent | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.os.Handler | |
import android.os.Looper | |
import android.util.Log | |
import android.widget.TextView | |
import java.util.* | |
const val ARG_ACTIVITY_NO = "ARG_ACTIVITY_NO" |
This file contains 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
import android.app.Dialog | |
import android.os.Bundle | |
import android.view.View | |
import android.widget.FrameLayout | |
import androidx.fragment.app.FragmentActivity | |
import androidx.fragment.app.FragmentManager | |
import com.google.android.material.bottomsheet.BottomSheetBehavior | |
import com.google.android.material.bottomsheet.BottomSheetDialog | |
import com.google.android.material.bottomsheet.BottomSheetDialogFragment |
This file contains 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
class AppActivity : BaseActivity() { | |
private val viewModel: AppViewModel by viewModel() | |
override fun onNewIntent(intent: Intent?) { | |
super.onNewIntent(intent) | |
tryOpenScreenChain(intent) | |
} | |
private fun tryOpenScreenChain(intent: Intent?) { |
OlderNewer