Closed erdemyerebasmaz closed 3 years ago
Hi @erdemyerebasmaz,
Would a podcast not potentially support both Lightning and Funding links, or are you presenting the funding links within Breez itself?
@amugofjava only Lightning is supported in Breez
Hi, I've made a slight adjustment to podcast details. Returning a SizedBox
whilst waiting for data to appear in the stream causes a noticeable screen jump as you can see in the first video below (slowed down to make it more visible). It shouldn't have any impact on the funding button, but let me know if you have any problems.
https://user-images.githubusercontent.com/5526902/111432567-17d6e180-86f5-11eb-8249-befc3be57f47.mp4
https://user-images.githubusercontent.com/5526902/111432599-1f968600-86f5-11eb-9689-143337c72c41.mp4
Hi, I've made a slight adjustment to podcast details. Returning a
SizedBox
whilst waiting for data to appear in the stream causes a noticeable screen jump as you can see in the first video below (slowed down to make it more visible). It shouldn't have any impact on the funding button, but let me know if you have any problems.settings_jank.mp4 settings_fixed.mp4
Good catch! @amugofjava I tested and unfortunately funding button is displayed till showFunding setting is retrieved. because stream is initialized with AppSettings.sensibleDefaults()
https://user-images.githubusercontent.com/4012752/111447351-6a78c380-871e-11eb-9c4c-8d63fac02d4b.mp4
What we should do is to move StreamBuilder inside Column children where FundingMenu is:
StreamBuilder<AppSettings>(
stream: _settingsBloc.settings,
⋮
child: [
SubscriptionButton(podcast),
PodcastContextMenu(podcast),
settings.showFunding ? FundingMenu(podcast.funding) : Container(),
]
⋮
SubscriptionButton(podcast),
PodcastContextMenu(podcast),
StreamBuilder<AppSettings>(
stream: _settingsBloc.settings,
builder: (context, settingsSnapshot) {
return (settingsSnapshot.hasData && settingsSnapshot.data.showFunding)
? FundingMenu(podcast.funding)
: Container();
},
),
This way the wait won't affect the whole widget.
@amugofjava Please see my comment above.
Hi @erdemyerebasmaz,
Yes, I'll give that a try and see if it improves things.
Hi @erdemyerebasmaz,
I tried moving the stream closer to the widget using it. It's good practice but made no difference. So, I have changed the settings BLoC to allow direct access to the current settings. This does break the 'contract' that BLoCs should only be accessed via sinks and streams, but in this case I think it's more important to have a jank free ui! :) I hadn't noticed until I saw your video that the play button was janky too so I have also fixed that.
Since we have our own payment system integrated into the plugin via hooks, this raised the need to hide
FundingMenu
onPodcastDetails
page. We believe the least intrusive way to go with this change was to add ashowFunding
flag toAppSettings
.This PR introduces
showFunding
settings flag that allows developers to hideFundingMenu
onPodcastDetails
page. This setting istrue
by default and won't be configurable throughSettings
page.