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
@Composable | |
fun StatesWithSideEffectDemoScreen(modifier: Modifier = Modifier) { | |
var counterState by remember { mutableIntStateOf(0) } | |
Scaffold( | |
modifier = Modifier.fillMaxSize() | |
) { padding -> | |
Box( | |
modifier = Modifier.fillMaxSize().padding(padding), |
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
object SimpleDateFormatProvider { | |
private const val FORMAT_TIMESTAMP_1 = "yyyy-MM-dd'T'HH:mm:ss'Z'" | |
private const val FORMAT_TIMESTAMP_2 = "MMM d yyyy" | |
private const val FORMAT_TIMESTAMP_3 = "yyyy-MM-dd'T'HH:mm:ss.SSSX" | |
private const val FORMAT_TIMESTAMP_4 = "yyyy-MM-dd" | |
private const val FORMAT_TIMESTAMP_5 = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" | |
private const val FORMAT_TIMESTAMP_6 = "yyyyMMdd" | |
fun getSimpleDateFormat(type: TimestampType): SimpleDateFormat { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<application> | |
<meta-data | |
android:name="com.istudio.lib_utils.sdkConfig.SDKInitializer" | |
android:value="initializer" /> | |
</application> | |
</manifest> |
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
class RememberUpdatedStateActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { CurrentScreen(){ | |
// Control is received back after performing the long running operation for a certain duration | |
} } | |
} | |
@Composable |
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
@Composable | |
fun ScreenContent(){ | |
Box( | |
modifier = Modifier | |
.fillMaxSize() | |
.background(Color.Yellow) | |
) { | |
val custScope = rememberCoroutineScope() |
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
class LaunchedEffectActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
CurrentScreen() | |
} | |
} | |
@Composable |
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
data class EventAction( val eventName: 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
const val CUSTOM_ACTION = "custom-action-local-broadcast" | |
class CustomLocalBroadcastReceiver : BroadcastReceiver() { | |
override fun onReceive(context: Context?, intent: Intent) { | |
val data = intent.getStringExtra("message") | |
Toast.makeText(context, data, Toast.LENGTH_LONG).show() | |
} | |
} |
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.droid.code.demos.application_receiver | |
import android.content.Intent | |
import android.content.IntentFilter | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import com.droid.code.databinding.ActivityDynamicRecieverBinding | |
import com.droid.code.demos.application_receiver.reciever.ApplicationReceiverBroadcastReceiver | |
import com.droid.code.demos.dynamic_receiver.reciever.CustomDynamicBroadcastReceiver |
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.droid.code.demos.dynamic_receiver.reciever | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.net.ConnectivityManager | |
import android.widget.Toast | |
const val KEY_AIRPLANE_MODE = "state" |
NewerOlder