daniel-stoneuk / material-about-library

Makes it easy to create beautiful about screens for your apps
Apache License 2.0
1.12k stars 140 forks source link

Dynamic UI #33

Closed abiemann closed 7 years ago

abiemann commented 7 years ago

How does one use the Snackbar in the MaterialAboutActivity?

Also, after getMaterialAboutList() is come and gone, how could I update a .text() field that was generated by a MaterialAboutActionItem.Builder() ?

Thanks !

daniel-stoneuk commented 7 years ago

Regarding the snackbar, you can call something like this:

Snackbar.make(((ExampleMaterialAboutActivity) c).findViewById(android.R.id.content), "Test", Snackbar.LENGTH_SHORT).show();

However, the MaterialAboutActivity is not based on a CoordinatorLayout which means that interaction with the Snackbar (swipe to dismiss) won't work. It would certainly be possible to stick the fragment in an activity that does have a CoordinatorLayout if you need that functionality.

Dynamically changing the UI is certainly something I will look to implement for a later release (won't be long but I don't really want to constantly create releases unless there are big changes). How urgent is this functionality for your app?

abiemann commented 7 years ago

Hi Daniel - thanks for the fast response. To get the screen to update, as an immediate measure, I am redrawing the entire Activity with recreate(). It's not elegant, but the reason for the UI update should be rare (to make a donation and trigger an IAP) - I hope not too rare 👍

daniel-stoneuk commented 7 years ago

Just developed support for updating the UI - check out the demo application's source code. You can either use the latest commit or wait for a new release which may be soon.