Coder Social home page Coder Social logo

Comments (4)

ursusursus avatar ursusursus commented on August 30, 2024 1

Okay, but I do think this is a bug

I dont think restoring view focus or position of cursor in edittext should be users responsibility + dialog fragment handles this

from conductor-dialog.

ursusursus avatar ursusursus commented on August 30, 2024

Okay now I noticed that savedViewState always empty in onBindView, and only non-empty if I put something in onSaveViewState

@Override protected void onRestoreViewState(@NonNull View view, @NonNull Bundle savedViewState) {
        super.onRestoreViewState(view, savedViewState);
        Bundle dialogState = savedViewState.getBundle(SAVED_DIALOG_VIEW_STATE_TAG);
        if (dialogState != null && dialog != null) {
            dialog.onRestoreInstanceState(dialogState);
        }
    }

    @Override protected void onSaveViewState(@NonNull View view, @NonNull Bundle outState) {
        super.onSaveViewState(view, outState);
        if (dialog != null) {
            Bundle dialogState = dialog.onSaveInstanceState();
            outState.putBundle(SAVED_DIALOG_VIEW_STATE_TAG, dialogState);
        }
    }

This works well for all of view hierarchy, no need to futz about with individial views

from conductor-dialog.

MkhytarMkhoian avatar MkhytarMkhoian commented on August 30, 2024

Hi
When config change the controller not destroyed and onSaveInstanceState, onRestoreInstanceState not called.

from conductor-dialog.

MkhytarMkhoian avatar MkhytarMkhoian commented on August 30, 2024

So, if you use MVP your presenter still alive after config change and you can bind data to UI

from conductor-dialog.

Related Issues (5)

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.