Joshua
07/07/2020, 9:09 AMnavController.navigate(R.id.action_global_goOnlineFragment)
takes me to an empty fragment? All other fragments will also be displayed as empty... the only thing that loads properly is the toolbar. Please help me I have been scrathing my head for too longNikola Milovic
07/07/2020, 4:45 PM<deepLink app:uri="myApp://fragmentD"/>
What does myApp represent, and how is it structured? By directories, or modules?Shawn Karber_
07/07/2020, 8:49 PMMichael Friend
07/08/2020, 3:09 PM// The view model
class LazyViewModel(val repo: Repo) : ViewModel() {
val state: LiveData<State<String>> by lazy {
loadData()
_state
}
private val _state = MutableLiveData<State<String>>()
private fun loadData() {
viewModelScope.launch {
_state.value = State.Loading
_state.value = State.Data(repo.getData())
}
}
}
// the test
@Test
fun `get loading then data`() = coroutinesTestRule.testScope.runBlockingTest {
val mockObserver: Observer<State<String>> = mockk(relaxUnitFun = true)
val mockRepo: Repo = mockk {
coEvery { getData() } returns "data"
}
val viewModel = LazyViewModel(mockRepo)
// If I don't pause then resume the dispatcher _state.value = State.Loading seemingly gets skipped
pauseDispatcher()
viewModel.state.observeForever(mockObserver)
resumeDispatcher()
verifyOrder {
mockObserver.onChanged(State.Loading)
mockObserver.onChanged(State.Data("data"))
}
}
paulex
07/08/2020, 3:26 PMval chip = Chip(mContext).apply {
setPadding(130)
setTextAppearance(R.style.ChipTextStyle_ProductList)
isCheckedIconVisible = true
setTextColor(ContextCompat.getColorStateList(mContext, R.color.chip_state_list_bg))
chipBackgroundColor = ContextCompat.getColorStateList(mContext, R.color.chip_bg_state_list)
isCloseIconVisible = true
text = item.name
}
Diayan siat
07/08/2020, 5:40 PMPicasso.get()
.load(url)
.fit()
.centerCrop()
.into(imageView)
but this does not workMadalin Valceleanu
07/09/2020, 6:30 AMAndroid Modular Architecture
just reach 1K ⭐️ on Github
. Maybe sounds insignificant if you compare with video reproductions or a post likes on twitter. But isn’t, the project is among top 10 github projects in Kotlin related with Android Architecture Sample with several mentions/references like Android Weekly
, AndroidSweets
, Droidcon
and KotlinBy
.
I want to say thank you ❤️ in this way for all the support received by the android/kotlin developer community
and I hope that some of the architecture decisions taken help you to apply/inspire to your current or next project.
Of course, nothing is perfect and this project isn’t an exception, there are a lot of things to improve, but the iteration is the key to my point of view.
Project Link: https://github.com/VMadalin/android-modular-architectureLilly
07/09/2020, 2:54 PMMap<Class<? extends AbstractCode>
I tried Class<? : AbstractCode>
and Class<Any : AbstractCode>
.Can someone help me please?Slackbot
07/09/2020, 3:15 PMAndrew Kuryan
07/09/2020, 4:04 PMDeepti M
07/09/2020, 6:04 PMLilly
07/09/2020, 6:13 PMopen class XModemPacket(protected var bytes: ByteArray = ByteArray(133))
Can someone give me a hint, how I can have the getter public. I want that every sub class can set it and can be obtained from outside.Joe Jensen
07/09/2020, 11:37 PMNikola Milovic
07/12/2020, 10:25 AMAntonio
07/12/2020, 11:36 AMDeepti M
07/12/2020, 9:29 PMif (lastWallpaperEngine != null && !lastWallpaperEngine!!.isPreview) {
}
Logs received in play-store...
java.lang.NullPointerException:
at android.service.wallpaper.WallpaperService$Engine.isPreview (WallpaperService.java:390)
at VideoWallpaperEngine.onSurfaceDestroyed (VideoWallpaperService.java:158)
Chethan
07/13/2020, 9:18 AMMohamed Ibrahim
07/13/2020, 12:16 PMsriram
07/14/2020, 12:54 AMLoboda Deni
07/14/2020, 6:40 AMAwodire babajide samuel
07/14/2020, 11:34 AMpaulex
07/14/2020, 2:18 PMRecyclerView
that uses a PagedListAdapter
which fetches data from ROOM
and Network API. It uses a BoundaryCallback
to make request to the API of which the data returned is inserted into the Database(ROOM)
i have a list item that has an increment and decrement button...
I have attached an image of the list...
The current list is filterable, e.g i can filter the list of products by category
Problem
If i increase a product item quantity using the increment button, to e.g 12 and then i try to add more to filter the list by, the current list doesn't refresh which is fine because the DiffUtil.ItemCallback
confirms that the items are the same, but once i try to increment that same product's quantity after filtering by more category, it starts from zero again....
So i'm not really sure what the problem really is: below is the code that does the increment and decrement.
override fun onIncrementQuantity(position: Int, item: ProductEntity) {
item.quantity = item.quantity + 1
selectedProducts[item.item.id!!] = item
productAdapter?.notifyItemChanged(position, item)
}
override fun onDecrementQuantity(position: Int, item: ProductEntity) {
item.quantity = if (item.quantity == 0) 0 else item.quantity - 1
if (item.quantity == 0) {
selectedProducts.remove(item.item.id)
} else {
selectedProducts[item.item.id!!] = item
}
productAdapter?.notifyItemChanged(position, item)
}
Loboda Deni
07/14/2020, 2:24 PMLuis Munoz
07/14/2020, 3:43 PMOfir Bar
07/14/2020, 5:18 PMCar
is a class, which extends an abstract class Vehicle
I didn't write a constructor for Vehicle
. why the compiler complains?Slackbot
07/14/2020, 8:07 PMHafs
07/14/2020, 11:05 PMLoboda Deni
07/15/2020, 6:52 AMLoboda Deni
07/15/2020, 8:41 AMsandi
07/15/2020, 8:47 AMsandi
07/15/2020, 8:47 AMEugene
07/16/2020, 8:59 AMsandi
07/16/2020, 10:24 AMEugene
07/17/2020, 8:54 AM