Page MenuHomePhabricator

Create EventLogging dev setting
Closed, InvalidPublic

Description

Add a user configurable URL string to dev settings and migrate the EventLogging URL from EventLoggingEvent.java to Prefs.java. When the user string is specified, use that. When the user string is unspecified, the current logic should be used: when ReleaseUtil.isPreBetaRelease() is true, use "https://deployment.wikimedia.beta.wmflabs.org/beacon/event", otherwise "https://meta.wikimedia.org/beacon/event".

Event Timeline

I assume this should be in the DeveloperSettingsFragment class ?
PS: Im a new dev to the project.

@AlfredAfutu, yep. DeveloperSettingsFragment and DeveloperSettingsPreferenceLoader and developer_preferences.xml too!

Great thanks!!

One more question: @Niedzielski where is the user string specified?

@AlfredAfutu, the user string is presented by DeveloperSettingsFragment. It would look like this:

screenshot-2017-06-28-09-22-29-214086007.png (800×480 px, 42 KB)

screenshot-2017-06-28-09-22-45-345107647.png (800×480 px, 48 KB)

@Niedzielski Thanks again. I want to be able to see what ive done . How do i access the dev settings on the app?

@AlfredAfutu:

  1. Enable developer settings:
    1. Go to app settings.
    2. Tap about Wikipedia.
    3. Tap seven times on the circular Wikipedia logo.
  2. Press back to go to app settings again.
  3. Open developer settings from the new icon in the top toolbar.

Developer settings are also enabled by default in the "dev" flavor (under build variants in Android Studio):

Screenshot from 2017-06-28 11-26-41.png (811×1 px, 215 KB)

@Niedzielski Ive sent a new Patch set to be reviewed.

@Niedzielski I was trying to see how the developer settings works but after tap seven times on the circular Wikipedia logo I got the following error:

java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.support.design.widget.CoordinatorLayout$LayoutParams
                                                                        at org.wikipedia.util.FeedbackUtil.adjustLayoutParamsIfRequired(FeedbackUtil.java:120)
                                                                        at org.wikipedia.util.FeedbackUtil.makeSnackbar(FeedbackUtil.java:115)
                                                                        at org.wikipedia.util.FeedbackUtil.showMessage(FeedbackUtil.java:72)
                                                                        at org.wikipedia.util.FeedbackUtil.showMessage(FeedbackUtil.java:60)
                                                                        at org.wikipedia.settings.AboutActivity$AboutLogoClickListener.showSettingAlreadyEnabledMessage(AboutActivity.java:125)
                                                                        at org.wikipedia.settings.AboutActivity$AboutLogoClickListener.onClick(AboutActivity.java:108)

What should be done when mistakes like these are found? Is it better to create a task with the all the information about the bug? Or do you automatically receive a crash report and after that you see if it is necessary to create a task or not?

@Jcasariego, please open a new bug! The Android app does collect crash reports but detailed tickets are nearly always easier to fix. In this case specifically, the crash may go unnoticed since it's in developer settings. Thank you!

@Niedzielski after doing a git pull the bug has gone. So, no more error :)

Change 403457 had a related patch set uploaded (by Yashasvi; owner: Yashasvi):
[apps/android/wikipedia@master] create EventLogging dev setting

https://gerrit.wikimedia.org/r/403457

Hi @Niedzielski

I've created a patch for this.

Here are the screenshots :

device-2018-01-11-002916.png (1×1 px, 91 KB)

device-2018-01-11-002730.png (1×1 px, 85 KB)

Screen Shot 2018-01-11 at 12.29.49 AM.png (676×2 px, 381 KB)

One doubt:

Do we also want to move the default dev and prod urls from static fields to Prefs?

@yashasvi, UI looks great! @Dbrant, @cooltey, would one of you mind following up with @yashasvi on their patch?

Thanks @yashasvi and @Niedzielski , I will do it :)

Thanks @cooltey , I'll wait for your review then.

Change 403457 abandoned by Dbrant:
create EventLogging dev setting

Reason:
No longer necessary; closing to reduce clutter.

https://gerrit.wikimedia.org/r/403457