bugshaker-android icon indicating copy to clipboard operation
bugshaker-android copied to clipboard

Custom Dialog and Translation

Open ryanhoo95 opened this issue 6 years ago • 14 comments

Hi, can Bugshaker support custom dialog and custom string resources (to support multi-language)?

ryanhoo95 avatar Nov 08 '19 01:11 ryanhoo95

Hi @ryanhoo95!

From a quick review of the library, it looks like the email subject line can be replaced with a localized string, but that's about it.

The dialog strings are currently hard-coded: https://github.com/stkent/bugshaker-android/blob/8ff33357268c151782ec934f4e5502609756d7cd/bugshaker/src/main/java/com/github/stkent/bugshaker/flow/dialog/DialogProvider.java#L26-L29

as are the email field strings: https://github.com/stkent/bugshaker-android/blob/8ff33357268c151782ec934f4e5502609756d7cd/bugshaker/src/main/java/com/github/stkent/bugshaker/flow/email/FeedbackEmailIntentProvider.java#L94-L102

Which of these strings were you looking to localize (or was it others that I missed)? I have some ideas how to proceed but would like to learn more about what your goal is first :)

stkent avatar Nov 08 '19 03:11 stkent

Hi @stkent , I wish to customize the dialog string, as well as the whole dialog, because I customize every dialog in my app.

ryanhoo95 avatar Nov 08 '19 03:11 ryanhoo95

Ok! What do you mean by

as well as the whole dialog

What other parts of the dialog would you ideally like to be able to control/change?

stkent avatar Nov 08 '19 03:11 stkent

Is it possible for something like this: When init the bugshaker in Application class, we can add in a shake listenser, implement custom dialog inside the listener.

ryanhoo95 avatar Nov 08 '19 03:11 ryanhoo95

Hmm, I think I understand now. I can explore this a bit tomorrow and see whether this is feasible or not, and I'll report back here afterwards!

stkent avatar Nov 08 '19 03:11 stkent

@stkent Thanks...

ryanhoo95 avatar Nov 08 '19 03:11 ryanhoo95

Hi @ryanhoo95,

I have created a new version of the library for you to test! Please download it from here and place it in your project's libs folder, and then temporarily replace your existing dependency on the published BugShaker with

implementation files('libs/bugshaker-release.aar')

The documentation for this version can be found here. In particular, please try out the new setCustomDialogProvider method and see if it works for your use case. Let me know how the test goes, and if it's successful I can create a new release.

stkent avatar Nov 08 '19 13:11 stkent

A quick test using the new version of the library to create a custom dialog in the sample app:

screencap 2019-11-08 at 11 19 58 AM

stkent avatar Nov 08 '19 16:11 stkent

Hi stkent, Sorry for the late reply, been very busy lately.  The link given returns 404. Have you already removed the project?  Thanks.

ryanhoo95 avatar Nov 14 '19 07:11 ryanhoo95

Hi @ryanhoo95,

No worries! That temporary file-sharing site must only keep files for 24 hours or so. Here's a link that should last a little longer: https://drive.google.com/open?id=1jRtMXQpmLpzwvPKhk3ZjZ_8u98XqZLrp

Let me know if it works for you when you're able :)

stkent avatar Nov 14 '19 12:11 stkent

Hi @ryanhoo95,

Any update on how that new version worked out for you?

Cheers!

stkent avatar Nov 28 '19 21:11 stkent

Hey Stkent, can you share me also the link ? your library is awesome, I tried to pass a custom dialog with the dialogProvider instance the parameter is a closure with activity and a listener, but how can I custom the colors/strings ?

Dave181295 avatar Jan 14 '21 02:01 Dave181295

Hi @Dave181295,

I haven't actually released v2.0.0 of the library yet; I'll do that tomorrow. Once that's available you should be able to customize the dialog fully.

Hope that helps,

Stuart

stkent avatar Jan 14 '21 03:01 stkent

OK, v2.0.0 is out, please try it out!

dependencies {
    implementation("com.github.stkent:bugshaker:2.0.0")
}

stkent avatar Jan 14 '21 03:01 stkent