Comments (8)
Handler is problematic, but I could define a callback interface that the parent activity needs to implement which will be called if the button is clicked - the standard thing for fragment <-> activity communication...
from changelog.
What do you mean by "Handler is problematic". If it took an callback interface as an input (instead of forcing the parent activity to implement something which does not work very well if your using MVP with a single activity) that would work fine. I was thinking the AlertDialog's neutral or negative button could be leveraged
from changelog.
This is a DialogFragment
, no AlertDialog
. It survices rotation e.g.... All the data passed to it must be parcelable. That's why the builder is parcelable...
It should be possible to check if the parent activity or the parent fragment implements the callback interface, but that's the only solution I can think of (other than buses or similar, which is not part of the library, and it should work without them as well)
from changelog.
ah yea.. that makes sense
okay so i propose you do the callback interface that the activity would have to support and also add the ability to pass in a fragment that implements the interface as well. Under the hood the activity is only used to get the support manager. As mentioned before my app is a single activity with tons of fragments so i would like to keep all the of the logic for the fragment that is going to show the changelog inside that fragment (or.. well the presenter of the fragment). I believe you can leverage
https://developer.android.com/reference/android/app/Fragment#settargetfragment
to access the fragment that created the dialogfragment
Example:
https://gist.github.com/Joev-/5695813
from changelog.
Would you mind adding this with the callback and create a pull request? Feel free to make it the way you like it, I may make adjustments afterwards... (like support for parent activity, maybe layout adjustments, whatever).
from changelog.
Yeah I can take a stab at it
from changelog.
I added withRateButton(true)
and the IChangelogRateHandler
, check out this to see the implementation:
And
New feature is added in this release: https://github.com/MFlisar/changelog/releases/tag/1.0.3
from changelog.
PS: v1.0.4 will open the play store link by default, no need to implement the callback if you want this default behaviour
from changelog.
Related Issues (20)
- Improvement - allow url as changelog source
- Materialise look/layouts HOT 1
- Shows only one version at a time HOT 5
- AndroidX migration HOT 1
- ManagedShowOnStart seems to be bugged? HOT 5
- Suggestion - add support for line breaks and other formatting HOT 2
- How to implement this in a complete activity as it appears in the screenshots? HOT 3
- How can I use this dependency with Java 7? HOT 4
- Overriding DialogFragment style HOT 4
- How to support multi-language. HOT 1
- Improvement - custom version formatter HOT 1
- Changelog stays empty HOT 4
- Rating and Ok buttons wont show in builder.buildAndStartActivity HOT 1
- `ChangelogBuilder.getCustomTitle` throws exception HOT 2
- Improvement - summaries HOT 1
- rethink your screenshots HOT 4
- Is it possible to use on Fragments? HOT 4
- Crash launching activity HOT 9
- ManagedShowOnStart make the dialog skip. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from changelog.