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
# 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 ### |
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
{ | |
"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" | |
}, |
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 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()) |
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 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 |
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"?> | |
<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" |
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 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. |
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
/** | |
* Business logic center. | |
*/ | |
class ProductInfoBusinessLogicCenterViewModel: ViewModel() { | |
/** | |
* Observable object for the view to watch. | |
*/ | |
val productInfo = MutableLiveData<ProductInfoDisplay>() |
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
/** | |
* Business logic center. | |
*/ | |
class ProductInfoBusinessLogicCenterViewModel: ViewModel() { | |
/** | |
* Observable object for the view to watch. | |
*/ | |
val productInfo = MutableLiveData<ProductInfoDisplay>() |
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 ServerObject(val product: ServerProductInformation) | |
data class ServerProductInformation(val productName: String, val price: String, val isOnSale: Boolean) |
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 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 -> |
NewerOlder