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
    
  
  
    
  | [ | |
| { | |
| "url": "http://money.cnn.com", | |
| "rss": "http://rss.cnn.com/rss/money_topstories.rss" | |
| }, | |
| { | |
| "url": "http://thehill.com", | |
| "rss": "http://thehill.com/rss/syndicator/19110" | |
| }, | |
| { | 
  
    
      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
    
  
  
    
  | // Project level "build.gradle" | |
| buildscript { | |
| repositories { | |
| google() | |
| } | |
| dependencies { | |
| classpath 'com.jaredsburrows:gradle-license-plugin:0.9.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
    
  
  
    
  | import com.google.android.gms.oss.licenses.OssLicensesMenuActivity | |
| ... | |
| // When the user selects an option to see the licenses: | |
| startActivity(Intent(this, OssLicensesMenuActivity::class.java)) | 
  
    
      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
    
  
  
    
  | // Add plugin to the project level 'build.gradle' file | |
| buildscript { | |
| repositories { | |
| google() | |
| } | |
| dependencies { | |
| classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' | |
| } | |
| } | 
  
    
      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
    
  
  
    
  | plugins { | |
| id 'com.android.application' | |
| id 'org.jetbrains.kotlin.android' | |
| id 'kotlin-kapt' | |
| id 'dagger.hilt.android.plugin' | |
| id 'kotlin-parcelize' | |
| } | |
| android { | |
| // ... | 
  
    
      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
    
  
  
    
  | // Read values | |
| val isSuperFastChargingEnabled = Settings.System.getInt(context.contentResolver, "super_fast_charging", 0) == 1 | |
| val isFastChargingEnabled = Settings.System.getInt(context.contentResolver, "adaptive_fast_charging", 0) == 1 | |
| val isFastWirelessChargingEnabled = Settings.System.getInt(context.contentResolver, "wireless_fast_charging", 0) == 1 | |
| // Navigate to "Fast Charging Settings" activity | |
| val intent = Intent() | |
| intent.component = ComponentName( | 
  
    
      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
    
  
  
    
  | interface NetworkConnectionManager { | |
| /** | |
| * Emits [Boolean] value when the current network becomes available or unavailable. | |
| */ | |
| val isNetworkConnectedFlow: StateFlow<Boolean> | |
| val isNetworkConnected: Boolean | |
| fun startListenNetworkState() | 
  
    
      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 networkCallback = ConnectivityManager.NetworkCallback() { | |
| override fun onAvailable(network: Network) { | |
| // Called when network is ready to use | |
| } | |
| override fun onLost(network: Network) { | |
| // Called when network disconnects | |
| } | |
| override fun onUnavailable() { | 
  
    
      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 connectivityManager: ConnectivityManager = context.getSystemService()!! | |
| val isNetworkConnected: Boolean | |
| get() = connectivityManager.getNetworkCapabilities(connectivityManager.activeNetwork) | |
| .isNetworkCapabilitiesValid() | |
| private fun NetworkCapabilities?.isNetworkCapabilitiesValid(): Boolean = when { | |
| this == null -> false | |
| hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) && | |
| hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) && | 
  
    
      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 connectivityManager: ConnectivityManager = context.getSystemService()!! | |
| val isNetworkConnected: Boolean | |
| get() = connectivityManager.activeNetworkInfo?.isConnected ?: false | 
NewerOlder