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
| SelectionQueryBuilder q = new SelectionQueryBuilder() | |
| .expr("is_awesome", EQ, true) | |
| .expr("money", GT, 50.0f) | |
| .expr("speed", LT, 21.1f) | |
| .or() | |
| .expr("door_number", EQ, 123) | |
| .or().expr( | |
| new SelectionQueryBuilder() | |
| .expr("a", GT, 0) | |
| .expr("a", LT, 100) |
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 HelloJubakoActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_jubako_recycler) | |
| recyclerView.withJubako(this).load { | |
| for (i in 0..100) { | |
| addView { textView("Hello Jubako!") } | |
| addView { textView("こんにちはジュバコ") } | |
| } |
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
| recyclerView.withJubako(this).load(SimpleJubakoAssembler { | |
| for (i in 0..100) { | |
| add(object : ContentDescriptionProvider<Any> { | |
| override fun createDescription(): ContentDescription<Any> { | |
| return ContentDescription( | |
| viewHolderFactory = viewHolderFactory { | |
| object : JubakoViewHolder<Any>(textView("Hello Jubako!")) { | |
| override fun bind(data: Any?) {} | |
| } | |
| }, |
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 SimpleCarouselsActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_jubako_recycler) | |
| // Set page size to 1 so we can see it loading (descriptions are delayed by 500ms) | |
| recyclerView.withJubako(this, pageSize(1)).load { | |
| (0 until 100).forEach { i -> | |
| addRecyclerView( |
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
| companion object { | |
| fun getNumbersEnglish(): LiveData<List<String>> { | |
| return object : LiveData<List<String>>() { | |
| override fun onActive() { | |
| GlobalScope.launch(Dispatchers.IO) { | |
| delay(500) | |
| postValue(listOf("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight")) | |
| } | |
| } | |
| } |
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
| // Set page size to 1 so we can see it loading (descriptions are delayed by 500ms) | |
| recyclerView.withJubako(this, pageSize(1)).load { | |
| (0 until 100).forEach { i -> | |
| addRecyclerView( | |
| // | |
| // Inflate a view for our carousel | |
| // | |
| view = { inflater, parent -> | |
| inflater.inflate(R.layout.simple_carousel, parent, false) | |
| }, |
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 InfiniteHelloJubakoActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_jubako_recycler) | |
| recyclerView.withJubako(this).load(HelloAssembler()) | |
| } | |
| class HelloAssembler : SimpleJubakoAssembler() { | |
| var counter = 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
| val data = PaginatedLiveData<String> { | |
| hasMore = { loaded.size < 100 } | |
| nextPage = { | |
| listOf("Hello") | |
| } | |
| } |
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
| addRecyclerView( | |
| view = { inflater, parent -> | |
| inflater.inflate(R.layout.simple_carousel, parent, false) | |
| }, | |
| data = PaginatedLiveData<String> { | |
| hasMore = { loaded.size < 100 } | |
| nextPage = { | |
| delay(2000) | |
| listOf("Hello") | |
| } |
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 CardDesignerScreen(repository: MemoryCardRepository = get(), cardUuid: String? = null) { | |
| val state = remember { CardDesignerState() } | |
| if (cardUuid != null && cardUuid.isNotEmpty()) { | |
| observe({ repository.getCard(cardUuid) }) { | |
| state.card = it | |
| state.loadingState = LoadingState.Loaded | |
| } | |
| } |
OlderNewer