GithubHelp home page GithubHelp logo

theblitz / observablecollections Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 5.0 144 KB

Observable Collectons for Android Kotlin apps. Observes adds, deletes etc.

Java 0.95% Kotlin 99.05%
android android-kotlin-apps android-library collections kotlin kotlin-android kotlin-android-extensions livedata observable observable-collections

observablecollections's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

observablecollections's Issues

range mutations support

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.

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)
        
    }

ObservableMap does not override observeForever

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.

Adding with index

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.

Unexpected execution order with 1.4.0

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.