theblitz / observablecollections Goto Github PK
View Code? Open in Web Editor NEWObservable Collectons for Android Kotlin apps. Observes adds, deletes etc.
Observable Collectons for Android Kotlin apps. Observes adds, deletes etc.
RecyclerView support range notification (notifyItemRangeRemoved, notifyItemRangeChanged, notifyItemRangeInserted)
Is there a reason why the ObservableCollectionsdoesn't support such mutations?
I have to delete one element at a time
Map put
sends a Clear
action instead of a Put
action.
fun put(key: X, value: Y): Y? {
val resultValue = map!!.put(key, value)
signalChanged(action = ObservableCollectionsAction.Clear, actionKey = key, actionValue = value, resultValue = resultValue)
return resultValue
}
fun putAll(from: Map<out X, Y>) {
map!!.putAll(from)
signalChanged(action = ObservableCollectionsAction.Clear, actionMap = from)
}
observeForever
needs the same treatment as this:
override fun observe(owner: LifecycleOwner, observer: Observer<in ObservableMap<X, Y, T>>) {
super.observe(owner, Observer { observer.onChanged(this) })
}
Otherwise when called, the observer is called with a null mData
and nothing useful happens.
removeAt(index: Int)
sends element index
signalChanged(ObservableCollectionsAction.RemoveAt, actionInt = index, resultElement = resultElement)
but add(index: Int, element: X)
with an index for unknown reason not
signalChanged(ObservableCollectionsAction.Add, actionElement = element)
Why? Let him send it too.
I have the ManActivity as navigation host and start LoginFragment (startDestination), where do i get navigation drawer and lock it.
When I updated the package to 1.4.0, I started getting NRE when I tried to get navdrawer.
The order of execution has changed.
v1.3.1
1 MainActivity.onCreate start
2 MainActivity.onCreate call setContentView(R.layout.activity_main)
3 MainActivity.onCreate executes the rest of the code
4 MainActivity.onCreate finish
...
5 LoginFragment.onCreateView execute
v1.4.0
1 MainActivity.onCreate start
2 MainActivity.onCreate call setContentView(R.layout.activity_main)
3 LoginFragment.onCreateView execute (NRE becouse nav is not initialized yet)
4 MainActivity.onCreate executes the rest of the code
5 MainActivity.onCreate finish
I am begginer in android development. And so the question. Is this a bug of ObservableCollections or am I misunderstanding the order of execution and did the wrong authorization?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.