Skip to content

Instantly share code, notes, and snippets.

# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or
# relative to the home directory (e.g. "data"). The home directory is
# "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable
# or --home cmd flag.
#######################################################################
### Main Base Config Options ###
{
"genesis_time": "2021-10-13T14:56:51.578365Z",
"chain_id": "cronostestnet_338-3",
"initial_height": "1",
"consensus_params": {
"block": {
"max_bytes": "1048576",
"max_gas": "81500000",
"time_iota_ms": "1000"
},
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Create view model that normally would be created in an injection system such as
// by viewModel, or Dagger, or Hilt.
// For our purposes of discussion we are just instantiating here as it does not matter
// where our BusinessLogicCenter (ViewModel) comes from.
val viewModel = ProductInfoBusinessLogicCenterViewModel()
setContent {
ProductInformation(viewModel.productInfo.observeAsState())
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Create the binding and set it as the content view.
val binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
// Create view model that normally would be created in an injection system such as
// by viewModel, or Dagger, or Hilt.
// For our purposes of discussion we are just instantiating here as it does not matter
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="displayObject"
type="com.anthonysierradevelopments.universallyapplicableviewarchitecture.ProductInfoDisplay" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Create view model that normally would be created in an injection system such as
// by viewModel, or Dagger, or Hilt.
// For our purposes of discussion we are just instantiating here as it does not matter
// where our BusinessLogicCenter (ViewModel) comes from.
/**
* Business logic center.
*/
class ProductInfoBusinessLogicCenterViewModel: ViewModel() {
/**
* Observable object for the view to watch.
*/
val productInfo = MutableLiveData<ProductInfoDisplay>()
/**
* Business logic center.
*/
class ProductInfoBusinessLogicCenterViewModel: ViewModel() {
/**
* Observable object for the view to watch.
*/
val productInfo = MutableLiveData<ProductInfoDisplay>()
data class ServerObject(val product: ServerProductInformation)
data class ServerProductInformation(val productName: String, val price: String, val isOnSale: Boolean)
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Create view model that normally would be created in an injection system such as
// by viewModel, or Dagger, or Hilt.
// For our purposes of discussion we are just instantiating here as it does not matter
// where our BusinessLogicCenter (ViewModel) comes from.
val viewModel = ProductInfoBusinessLogicCenterViewModel()
viewModel.productInfo.observe(this, { displayObject ->