Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to customize FAB? #50

Open
thirtythreeforty opened this issue Oct 13, 2017 · 1 comment
Open

Possible to customize FAB? #50

thirtythreeforty opened this issue Oct 13, 2017 · 1 comment

Comments

@thirtythreeforty
Copy link

thirtythreeforty commented Oct 13, 2017

I would like to use one of the various "FAB progress" libraries that allow you to either wrap an existing FAB object, such as this one or use the library directly as a FAB object, such as this one.

The SlidingActivity appears to handle the lifecycle of all its views directly (which is very convenient for the most part); I do not see a way to easily customize the FAB or any other view for that matter, other than the normal setContent().

I attempted the following in init(), and it "works" in the sense that it does not crash, but it loses all the layout information of the FAB, which now appears in the top-left corner. With more work I could probably get it fairly well integrated, but it would be nicer to have a first-party solution.

        val fab = findViewById(R.id.fab)
        val fabParent = fab.parent as ViewGroup
        fabParent.removeView(fab)

        val fabWrapper = FABProgressCircle(this)
        fabWrapper.addView(fab)
        fabParent.addView(fabWrapper)

Is there a good way to use SlidingActivity with these kinds of extras?

@klinker24
Copy link
Collaborator

There isn't really a great way to do this currently, no. Right now, you would have to fork the lib and provide a custom implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants