Skip to content

Dialog buttons set as opposite to Android design conventions #3428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aryan-earth opened this issue Feb 23, 2020 · 23 comments · Fixed by #3496
Closed

Dialog buttons set as opposite to Android design conventions #3428

aryan-earth opened this issue Feb 23, 2020 · 23 comments · Fixed by #3496
Assignees

Comments

@aryan-earth
Copy link

aryan-earth commented Feb 23, 2020

Summary:
The text of positive and negative buttons of the dialogs in DialogUtils has been set as the opposite and should we swapped. The positive button text is set as "No" and the negative button text is set as "Yes" as evident in the image attached below.

Side notes:
This issue was created from a discussion that happened at #3397. The relevant discussion starts from #3397 (comment). This was created to discuss the rationale behind why the buttons are the way they are now, if there are any reasons.

Device and Android version:
Redmi Note 5 Pro & Android 9

Commons app version:
2.12.3-debug-testing~65592539b

Screen-shots:

Current state
Screenshot from 2020-02-24 01-50-40
Should be like the image below:
Screenshot from 2020-02-24 01-53-26

Would you like to work on the issue?

Sure. Although, if a new volunteer wants to get their hands dirty in the commons code, this could be a great opportunity for them. This could be marked as a Good First Issue.

@madhurgupta10
Copy link
Collaborator

@glitch101 I am not sure about the design convention but I think you are right, even in Gmail or Android Settings the convention seems to place the Cancel on the Left and OK on Right.

Screenshot_20200305-215243
Screenshot_20200305-215217

@sivaraam What do you think?

@sivaraam
Copy link
Member

sivaraam commented Mar 7, 2020

Yeah, its a common convention indeed. That said we generally don't have to worry about the position of the buttons. If we just specify the positive and negative actions correctly, that should do. Here positive actions corresponds to "Confirming actions" and negative action corresponds to the "Dismissive actions" in the material design guideline.

Just an FYI, this issue was created from a discussion that happened at #3397 . The relevant discussion starts from #3397 (comment). This was created to discuss the rationale behind why the buttons are the way they are now, if there are any reasons.

@madhurgupta10
Copy link
Collaborator

@glitch101 Do tag the comment or issue in your description, it will accelerate the discussion.

@aryan-earth
Copy link
Author

Just an FYI, this issue was created from a discussion that happened at #3397 . The relevant discussion starts from #3397 (comment). This was created to discuss the rationale behind why the buttons are the way they are now, if there are any reasons.

Can I put this subsection of your comment in the description?

@aryan-earth
Copy link
Author

@glitch101 Do tag the comment or issue in your description, it will accelerate the discussion.

Thanks for the tip. I will do that :)

@sivaraam
Copy link
Member

sivaraam commented Mar 8, 2020

Can I put this subsection of your comment in the description?

Sure. Here's the non-rendered markdown text of that part:

Just an FYI, this issue was created from a discussion that happened at https://github.com/commons-app/apps-android-commons/issues/3397 . The relevant discussion starts from https://github.com/commons-app/apps-android-commons/issues/3397#issuecomment-589927150. This was created to [discuss _the rationale behind why_ the buttons](https://github.com/commons-app/apps-android-commons/issues/3397#issuecomment-590108849) are the way they are now, if there are any reasons.

@misaochan
Copy link
Member

Wow, #3397 is a really long discussion thread... I'm still halfway through it, but for this issue I think it is safe to say that it is OK to swap the buttons as per common conventions.

@aryan-earth
Copy link
Author

Wow, #3397 is a really long discussion thread... I'm still halfway through it, but for this issue I think it is safe to say that it is OK to swap the buttons as per common conventions.

Yes, #3397 contains quite a lot of unrelated discussion with respect to this issue. I have updated the issue description to include the links to relevant discussion on #3397 thread.

@sivaraam
Copy link
Member

Wow, #3397 is a really long discussion thread.

Yeah. Sorry about that! 😅

... but for this issue I think it is safe to say that it is OK to swap the buttons as per common conventions.

If we're ok with swapping the "Yes" and "No" in showAlertDialog(Activity, String, String, Runnable, Runnable onNegativeBtnClick, View, boolean), I think there are at least two usages of that method which we have to update to ensure the "Yes" remains as the negative action. Yeah, you read that right I did say negative action. I realize it's common to have "Yes" as the positive action but in the following cases I strongly believe it's more appropriate to have "Yes" as the negative action:

@FawziyahAlebiosu
Copy link
Contributor

This is definitely an interesting issue, @glitch101 can you assign this to me?

@aryan-earth
Copy link
Author

aryan-earth commented Mar 11, 2020

This is definitely an interesting issue, @glitch101 can you assign this to me?

Sorry, I cannot assign an issue to you. I do not have write access to this repository. I am a contributor. I am tagging one of the maintainers so that they can assign you. @maskaravivek

@sivaraam
Copy link
Member

@FawziyahAlebiosu You can take this up. I've assigned this to you. Be sure to let us know how you get on :)

@misaochan
Copy link
Member

I think there are at least two usages of that method which we have to update to ensure the "Yes" remains as the negative action. Yeah, you read that right I did say negative action. I realize it's common to have "Yes" as the positive action but in the following cases I strongly believe it's more appropriate to have "Yes" as the negative action

Those are the warnings when a user tries to upload a duplicate or "bad" picture, right? I agree, those should be kept with "Yes" as the negative action. But the dialog button mentioned in this issue (for turning on location) can be changed.

@macgills
Copy link
Contributor

<string name="upload_title_duplicate" formatted="true">A file with the file name %1$s exists. Are you sure you want to proceed?</string>

That to me seems like yes should be in the positive position.

<string name="upload_problem_do_you_continue">Do you still want to upload this picture?</string>

That also seems like a yes in positive.

Positive/negative have no correlation between destructive/constructive actions. It is simply the response to the question posed

@sivaraam
Copy link
Member

Those are the warnings when a user tries to upload a duplicate or "bad" picture, right?

Yeah

Positive/negative have no correlation between destructive/constructive actions. It is simply the response to the question posed

That's a good point. They really don't seem to have any correlation. FWIW, even the material design guideline for dialog boxes is against keeping dismissive actions (in our case "No") in the left of the dialog. Looks like I was wrong in thinking they are correlated 🤔 Thanks for correcting that @macgills 🙂

One other reason I was suggesting to keep the "Yes" as negative action as I thought that it was intentionally decided to kept them that way. Now that I think about it seems the decision might've been made with the assumption that there's a direct correlation between positive/negative and destructive/constructive actions. @maskaravivek might be able to shed some light about this.

@macgills
Copy link
Contributor

Also if we go with the material guidelines "Yes/No" are poor words to use, the action should be repeated in the positive button eg "Upload/Proceed" and the negative should be something like "Cancel" if you cancel an operation

@FawziyahAlebiosu
Copy link
Contributor

Also if we go with the material guidelines "Yes/No" are poor words to use, the action should be repeated in the positive button eg "Upload/Proceed" and the negative should be something like "Cancel" if you cancel an operation

Will be sure to replace it with that.

@FawziyahAlebiosu
Copy link
Contributor

I think there are at least two usages of that method which we have to update to ensure the "Yes" remains as the negative action. Yeah, you read that right I did say negative action. I realize it's common to have "Yes" as the positive action but in the following cases I strongly believe it's more appropriate to have "Yes" as the negative action

Those are the warnings when a user tries to upload a duplicate or "bad" picture, right? I agree, those should be kept with "Yes" as the negative action. But the dialog button mentioned in this issue (for turning on location) can be changed.

So, is it safe to conclude that the swapping of positive and negative action, as well as replacing with Cancel, and Proceed, is ONLY to the dialog box that shows up when turning location, correct? I am not doing this to any other dialog boxes, right?

@sivaraam
Copy link
Member

So, is it safe to conclude that the swapping of positive and negative action, as well as replacing with Cancel, and Proceed, is ONLY to the dialog box that shows up when turning location, correct?

There seems to be some confusion here. Let me clarify.

@FawziyahAlebiosu You don't have to worry about the dialog that shows up when turning on location. It's just now being added in PR #3438. As of now, the only changes you would have to do is to swap the negative and positive button text in the DialogUtil#showAlertDialog method.

Changing the text of the buttons actually not in the scope of this issue. So, if you're interested in doing that change you can you can do that separately. I've created #3494 for that 🙂

Others, correct me if I'm wrong somewhere.

FawziyahAlebiosu added a commit to FawziyahAlebiosu/apps-android-commons that referenced this issue Mar 11, 2020
…ding to Android Convention, they were opposite each other
@FawziyahAlebiosu
Copy link
Contributor

Ahh @sivaraam thanks for clarifying haha! I've created a pull request to address the correct issue then. Also, I'll definitely work on issue #3494 as well.

@FawziyahAlebiosu
Copy link
Contributor

Update while testing this, I realized that I will need to figure out which part in the method I need to swap as well-so I'm halfway done!
yesNo

@macgills
Copy link
Contributor

@FawziyahAlebiosu I would giving the official guide a read if you are not too familiar with Dialogs, that should familiarise you with their api

FawziyahAlebiosu added a commit to FawziyahAlebiosu/apps-android-commons that referenced this issue Mar 12, 2020
…ped text in dialog buttons because, according to Android Convention, they were opposite each other
macgills pushed a commit that referenced this issue Mar 20, 2020
* Issue #3428: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other

* Fixed Issue #3428 so it actually works correctly now: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other

* Made sure that all of the places where the two types of showAlertDialog accurately match up with the new position of positive and negative text on the dialog box
Also removed occurences of empty lambda expressions and used null instead

* modified deletThisPicture to be accurate lambda call

* reverted mistake where ellipses replaced the three dots
@macgills
Copy link
Contributor

Due to an error I am reopening to verify the usages of DialogUtil

 public static void showAlertDialog(Activity activity,
                                       String title,
                                       String message,
                                       final Runnable onPositiveBtnClick,
                                       final Runnable onNegativeBtnClick)

Has 3 usages, its api passes yes & no to the correct positions.

 DialogUtil.showAlertDialog(getActivity(),
                getString(R.string.upload_nearby_place_found_title),
                String.format(Locale.getDefault(),
                        getString(R.string.upload_nearby_place_found_description),
                        place.getName()),
                () -> {
                    etTitle.setText(place.getName());
                    Description description = new Description();
                    description.setLanguageCode("en");
                    description.setDescriptionText(place.getLongDescription());
                    descriptions = Arrays.asList(description);
                    setDescriptionsInAdapter(descriptions);
                },
                () -> {

                });
    }

Positive click listener in correct first position.

        DialogUtil.showAlertDialog(getActivity(),
                getString(R.string.warning),
                String.format(Locale.getDefault(),
                        uploadTitleFormat,
                        uploadItem.getFileName()),
                () -> {
                    uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP);
                    onNextButtonClicked();
                }, null);

Positive click listener in correct first position.

            DialogUtil.showAlertDialog(getActivity(),
                    getString(R.string.warning),
                    errorMessageForResult,
                    () -> {
                        uploadItem.setImageQuality(ImageUtils.IMAGE_KEEP);
                        onNextButtonClicked();
                    },
                    () -> deleteThisPicture()
        );

Positive click listener in correct first position

    public static void showAlertDialog(Activity activity,
                                       String title,
                                       String message,
                                       String positiveButtonText,
                                       String negativeButtonText,
                                       final Runnable onPositiveBtnClick,
                                       final Runnable onNegativeBtnClick) {

This method has 8 usages

        DialogUtil
            .showAlertDialog(getActivity(), getString(R.string.ask_to_turn_location_on), getString(R.string.nearby_needs_location),
                getString(R.string.yes), getString(R.string.no),  this::openLocationSettings, null);

yes,no and click listeners in correct position.

        DialogUtil.showAlertDialog(activity,
                activity.getString(R.string.quiz),
                activity.getString(R.string.quiz_alert_message, REVERT_PERCENTAGE_FOR_MESSAGE),
                activity.getString(R.string.about_translate_proceed),
                activity.getString(android.R.string.cancel),
                () -> startQuizActivity(activity),
                null);

proceed,cancel positivie click in correct position.

      DialogUtil.showAlertDialog(ReviewActivity.this,
                getString(R.string.skip_image).toUpperCase(),
                getString(R.string.skip_image_explanation),
                getString(android.R.string.ok),
                "",
                null,
                null);

ok in correct position, no click listeners

        DialogUtil.showAlertDialog(ReviewActivity.this,
                getString(R.string.title_activity_review),
                getString(R.string.review_image_explanation),
                getString(android.R.string.ok),
                "",
                null,
                null);

ok in correct position, no click listeners.

        DialogUtil.showAlertDialog(getActivity(),
                getString(R.string.no_categories_selected),
                getString(R.string.no_categories_selected_warning_desc),
                getString(R.string.yes_submit),
                getString(R.string.no_go_back),
                () -> goToNextScreen(),
                null);

yes,no,positive correct.

        showAlertDialog(activity,
                title,
                message,
                activity.getString(R.string.yes),
                activity.getString(R.string.no),
                onPositiveBtnClick,
                onNegativeBtnClick);

all correct positions.

                        DialogUtil.showAlertDialog(activity, activity.getString(rationaleTitle),
                            activity.getString(rationaleMessage),
                            activity.getString(R.string.navigation_item_settings), null,
                            () -> askUserToManuallyEnablePermissionFromSettings(activity), null);

positive button and listener in correct positions.

                    DialogUtil.showAlertDialog(activity, activity.getString(rationaleTitle),
                        activity.getString(rationaleMessage),
                        activity.getString(android.R.string.ok),
                        activity.getString(android.R.string.cancel),
                        token::continuePermissionRequest, token::cancelPermissionRequest);

positive/negative message/liteners in correct positions

 public static void showAlertDialog(Activity activity,
                                       String title,
                                       String message,
                                       final Runnable onPositiveBtnClick,
                                       final Runnable onNegativeBtnClick,
                                       View customView,
                                       boolean cancelable) {

1 usage

        DialogUtil.showAlertDialog(getActivity(),
                getString(R.string.nearby_card_permission_title),
                getString(R.string.nearby_card_permission_explanation),
                this::requestLocationPermission,
                this::displayYouWontSeeNearbyMessage,
                checkBoxView,
                false);

pos/neg click in correct position.

    public static void showAlertDialog(Activity activity, String title, String message, String positiveButtonText, final Runnable positiveButtonClick, boolean cancellable) {

1 usage

        DialogUtil.showAlertDialog(getActivity(), getString(titleStringID), getString(messageStringId), getString(android.R.string.ok), null, true);

no click listener to worry about.

That is all the dialogs.

Conclusion: there are no further erroneous usages of DialogUtil

@macgills macgills reopened this Mar 25, 2020
maskaravivek added a commit to maskaravivek/apps-android-commons that referenced this issue Apr 20, 2020
* Versioning

* Update changelog.md

* Optimize imports (commons-app#3272)

* Convert few model classes to kotlin (commons-app#3270)

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3231 "Nearby" always first puts me in Punta Arenas (commons-app#3271)

* Update tables from 10 to 11

* Remove unneeded changes

* Update strings.xml (commons-app#3285)

Improve share_text string for commons-app#3192.

* Localisation updates from https://translatewiki.net.

* color accent changed tto blue in dark theme (commons-app#3234)

* Localisation updates from https://translatewiki.net.

* Fix UI tests (commons-app#3297)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Bugfix/null revision in review (commons-app#3309)

* Fixes commons-app#3305
 * Handle null firstRevision

* initialise explanation

* Fixes commons-app#3307 (commons-app#3308)

* Fixed positional argument format for string in "image_uploaded_by"

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* More natural language instead of a slash (commons-app#3318)

* Remove unnecessary space before colon (commons-app#3317)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Versioning for v2.12.1

* Update changelog.md

* Localisation updates from https://translatewiki.net.

* CategoryItem: add javadocs to the file (commons-app#3332)

* Change tempalte character case from EXIF to Exif (commons-app#3330)

* Fixes commons-app#3335 (commons-app#3337)

Handled sqlitexception for adding existig column in app versions which already have COLUMN location_pic

* Issue 3236: Change nearby search text to white (commons-app#3331)

* Clear parent from customView if parent is not null

* Apply white search bar theme to nearby search

* Undo changes from bad merge

* Fix up tag formatting

* Versioning for v2.12.2

* Update changelog.md

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3320 (commons-app#3349)

* Fixes commons-app#3320
* Added SSL certificate for commons beta
* Asked OKHTTP client to use SSLContext from beta certificate
* Probable Fix of commons-app#3345

* Use ConfigUtils to verify flavor

* Fixes commons-app#3345 (commons-app#3350)

* Fixes commons-app#3345
* Trust all hosts for beta
* Added a custom NetworkFetcger for Fresco when on beta

* removed unused assets

* make TestCommonsApplication extend Application instead of Commons Application

* Fixes commons-app#3336 Hotfix: Coordinates of picture are not uploaded (commons-app#3339)

* Fixes commons-app#3336
 * Donot redact locatio by default

* Correction inn default tag save

* Use same key across application for managedExifTags

* Updated key name to avoid class cast in existing build

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3327: Trim whitespaces from title on upload (commons-app#3348)

Trim WhiteSpaces from Image-Title while upload

* Fixes: commons-app#3343 TextUtils.isEmpty creates problems when unit testing with Mockito (commons-app#3344)

* TextUtils: add mock textUtils for tests

* TextUtils: add more methods to mock for testing

* UploadControllerTest: fix the test resulting travis ci to fail

* Fixes: commons-app#3278: Add java docs to methods which have it missing (commons-app#3351)

* achievements/: add Javadocs

* actions/: add Javadocs

* WikiAccountAuthenticator: add Javadocs

* ReasonBuilder: add Javadocs

* di: Add javadocs to DI files

* bookmarks: add Javadocs to bookmarks files

* di: Added more Javadocs

* file: add Javadocs for file picker

* actions: add proper decription to the classes

* Fixes: commons-app#3179 Make category search non case-sensitive (commons-app#3326)

* CategoryClient: fix category search case-sensitivity by converting to lower case as MW api is inherently case-sensitive, the results obtained will be same

* CategoryItem: reverting javadoc changes

* CategoriesModel: make category search case-insensitive

* CategoryItem: fix whitespaces

* Add tests for case-insensitivity

* CategoryClientTest: add more test cases

* CategoryClientTest: fix travis ci test

* CategoriesModelTest: changes mage to CategoriesModel and tested

* Suggest and auto fill title and description based on image location (commons-app#3323)

* Suggest and auto fill title and description based on image location

* with java docs

* Versioning for v2.12.3

* Update changelog.md

* Localisation updates from https://translatewiki.net.

* Fix: Issue commons-app#3367 Bug: SoftKeyboard showing even after switching from nearby tab to contribution tab (commons-app#3368)

Hide keyboard when switched back from NearbyFragment to ContributionsListFragment

* Localisation updates from https://translatewiki.net.

* Adds a Test for Method A categories search (commons-app#3366)

* CategoriesModelTest: add methodA test for categories search

* CategoriesModelTest: use lateinit wherever possible

* CategoriesModelTest: make method name meaningful

* Fixes commons-app#3303 (commons-app#3322)

* Fixes commons-app#3303
* Refactor Nearby to alig lifecycle methods

* Pass updated place list to listfragment

* Added default zoom rate to mapbox

* Removed NearbyListFragmet and added the ui login to handle the same in NearbyParentFragment

* More code refactor
* Make BottomSheetList hideable
* onFragmentHide, hide the bottom sheets

* BigFix, Fragmet visibility, register/un-register camera move based on fragments lifecycke

* More code refactor
* Let the ExecutorUtil have non-ui thread
* Add Location Marker on non-ui thread (the non-ui stuffs)

* BugFixes
* Removed configchanges "orientation" from MainActivity in Manifest (That was messing with the fragment lifecycle)
* Some null checks
* Initialise lastknown location in onMapReady

* UI Fixes
* Adjusted UI to support dark and no-dark themes both (in nearby)
* Do not update map on Location Slightly changed

* Fix failing test case, let TestCommonsApplication extend Application instead of CommonsApplication

* start map view when nearby is visible

* start the map when NearbyFragmet is visible

* More bugfixes
* Added DUMMY view for NearbyPresenter's onDetach State
* Added a wrapper frame layout parent for MapView to preven it from drawing above other views

* More bugfixes (Fixes commons-app#3287)
* Gray out the un-selected markers from the nearby filter list

* BugFix, search this area should search the nearby places for the current camera position

* More BugFixes
* Handle null primitives with proxy
* Current location marker flow via permission flow

* onCameraMove should have null-check on NearbyController.latestSearchLocation instead of currentLocation

* Search for places around last focus location

* Handle location updates
* If the user is browsing the map, donot update the map with current location

* Fixes commons-app#3371 (commons-app#3372)

* Is UserBrowsing should first check if last known location is non-null before checkig if last location and current locations are close

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3382 Fixed Notification Message  Icon Background (commons-app#3383)

* changing background color of conditions in nearby as uniform (according to chip state) (commons-app#3365)

Signed-off-by: Mudit Jain <[email protected]>

* Fixes commons-app#3392 Fixed Nearby List Item Icon's Background (commons-app#3393)

* Hide Review for logged out users (commons-app#3390)

It makes sense to not show the review activity for logged
out users for the same reasons that we don't allow users
to upload images.

We're even considering to limit the review activity to users
with a particular level of achievement[1]. So, it's valid to
not show review activity for logged out users who don't
have achievements levels at all.

[1]: commons-app#2852

* Localisation updates from https://translatewiki.net.

* Fix commons-app#3191 Make the username along with the rewards icon clickable in the Navigation Drawer (commons-app#3401)

* Don't show the quiz pop-up twice (commons-app#3398)

* Avoid showing the quiz pop-up twice to the user

Due to the current flow of code it's possible that in
some cases the quiz pop-up is shown to the user twice.
This is unnecessary and unintentional.

So, change the logic in such a way that the quiz pop-up
would be never be shown twice to the user.

Fixes: commons-app#3281

* Quiz: remove unused parameters from methods

Some methods don't seem to be using the parameters that
they receive. So, just remove the unused parameters.

* Fixed minor Login Bug (commons-app#3373)

* Fixes commons-app#3197 Replace hardcoded dimensions with dimen resource values (commons-app#3402)

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3403 Add padding between privacy policy button and bottom of the screen (commons-app#3404)

Fixes commons-app#3403 Add padding between privacy policy button and bottom of the screen

* code-quality: remove CDATA and <u> tags from string.xml (commons-app#3310)

Remove CDATA and <u> tags from string resources. Instead use setUnderlinedText() method added in Utils to create underlined string resources.

* fix typo commons-app#3417 (commons-app#3418)

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3355 : Do not display pins at all when "Needs Photo" is selected (commons-app#3407)

* ic_custom_greyed_out_marker: removing grey marker

* NearbyParentFragment: changing function name and description

* change method name to hideAllMarkers

* Localisation updates from https://translatewiki.net.

* Fix commons-app#3416 Add snackbar on clicking add/remove from bookmarks (commons-app#3419)

* Added progress dialog for setting wallpaper (commons-app#3427)

* Added progress dialog for setting wallpaper

* Updated dialog strings

* Localisation updates from https://translatewiki.net.

* Fixed a type in NearbyParentFragment.java where significantly was written instead of slightly while adding a log using Timber (commons-app#3432)

* Fixes commons-app#814 Added App Shortcuts (commons-app#3381)

* Fixes commons-app#814 Added App Shortcuts

* removed Review app shortcut

* Added Adaptive icons

* Localisation updates from https://translatewiki.net.

* Replace functions in FileUtilsTest with ones from kotlin-stdlib (commons-app#2943)

* Fix commons-app#3091: Remove odd code in CategoryImagesListFragment (commons-app#3133)

* Moved some Java files to kotlin (commons-app#3439)

* Converted NetworkConnectionType.java to Kotlin

* Converted Urls.java to Kotlin and Updated AboutActivity

* Improved code quality

* Open external links in same activity (commons-app#3395)

It's common for users to expect that re-opening the app would
allow them to "continue where they left off". This also applies
for the case where they leave the app after opening an
external link. It's natural for them to expect that they would
see the webpage they left open when they re-open the app. This
doesn't happen for our app as we open custom tabs in a separate
activity. As a consequence, this makes the experience
un-intuitive.

Fix this by opening custom tabs in the same activity.

Fixes: commons-app#2944

Co-authored-by: Adam Jones <[email protected]>

* Update mapbox, gradle and android plugin versions (commons-app#3443)

* Localisation updates from https://translatewiki.net.

* Fix existing Espresso tests (commons-app#3450)

* Fix existing Espresso tests

* Convert class to kotlin

* Added Support for System Wide Dark Theme (commons-app#3460)

* Added Support for System Wide Dark Theme

* changed methods to private

* Moved Strings to strings.xml

* Used Dagger to reduce code repetition

* Changes made as per review suggestions

* Minor Changes

* Fixes as per suggestions

* Minor Fixes as per suggestion

* made the variables static

* removed irrelevant code

* Localisation updates from https://translatewiki.net.

* commons-app#3469 Update Gradle Play Publisher to resolve issues with travis build (commons-app#3470)

* commons-app#3469 Update Gradle Play Publisher to resolve issues with travis build - update GPP/Gradle and use jacoco-android fork with gradle 6.0 support

* commons-app#3469 Update Gradle Play Publisher to resolve issues with travis build - remove extraneous space

* Comment out application id from default config

* About page: Update logos (commons-app#3472)

* Fixes commons-app#3295: Ultimate achievement: Too many contributions (commons-app#3378)

* commons-app#3476 Use individual test commands on CI instead of check  (commons-app#3477)

* commons-app#3476 Use individual test commands on CI instead of check - use individual commands and narrow scope

* commons-app#3476 Use individual test commands on CI instead of check - fix indentation

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#3414:  For v2.13, Handle zoom in media details view (commons-app#3422)

* MediaDetailFragment: add zoom feature

* fragment_media_detail: add SimpleDrawee for Scroll picture

* ZoomableActivity: activity which facilitates zoom in

* activity_zoomable: xml for zoom activity

* zoomControllers: controllers for handling gesture and zooming

* MediaDetailFragment: fixing name of image variable

* MediaDetailFragment: display as per the aspect ratio of image

* add zoom activity to AndroidManifest

* fix travis ci faliure

* fix resizing of image

* Shift contributions to use Room DB (commons-app#3324)

* Part of commons-app#3127
* Added Room Dependency
* Shifted ContributionsDao to use RoomDB

* Save and Fetch contributions via RoomDAO

* Bugfixes, fixed test cases, injected schedulers for ContributionsPresenter

* removed stetho

* Fixed ReviewHelperTest cases

* Fixed test cases in DeleteHelperTest

* Fetch all contributions [TODO add pagination to use this, maybe later in a seperate PR]

* Update Schema false in AppDatabase

* removed parameter from fetchControbutions

* Added logs for fetch contributions

* Fixed test case ContributionsPresenter

* Added an autogenerate primary key, submit save contributions on executor

* fixed getItemAtPosition

* MainActivity Config changes +=orientation

* BugFixes
* Make AppDataBase Singleton
* Set _id as autogenerate primary key [replacing the previously used filename, seems like they are not unique]
* Replace Execxutor Utils with Subscribers on Singles in UploadService
* BugFix, Upload Progress

* Remove un-nescessary null check on contributions in ContributionsListAdapter

* removed ContributionsListFragment [not-implemeted]

* Review suggested changes
* removed un-nescessary null checks
* provide ContributionsDao
* Minor bug fixes

* wip

* delete existing contributions table (from the existing db) on upgrade

* remove un-nescessary null checks in test classes

* shifted media to be a local variable in ReviewHelperTest

* removed captured folder

* Dispose composite disposables in UploadService

* replaced size check with isEmpty ContributionsPresenter

* transform saveContributions to a Completable

* Addressed comments in review
* Typo in Contributions
* ReasonBuilderTest (create media object instead of mocking)
* Use global Gson object instead of creating a new one in Converters

* Provide Gson to Converters from the CommonsApplicationComponent

* use static method instead of field instead of static field to provide GSON in Converters

* Modified gitignore to exclude captures/*

* [WIP] Implemented Espresso tests for upload with multilingual descriptions (commons-app#2830)

* With more upload tests

* Fix tests

* Fix tests

* openStreetMap attribution enabled (commons-app#3485)

* commons-app#3445 Add codestyle to git  - import google java code style, use predefined styles for kotlin/xml (commons-app#3486)

* commons-app#3488 Delete app/prod folder - deleted (commons-app#3489)

* Added AboutActivityTest (commons-app#3475)

* Added AboutActivityTest

* Changes made as per suggestions

* Removed File to resolve conflict

* Removed hardcoded packagename

* Changes as per suggestion

* Removed Unrelated changes

* Fixed Build Issues

* Localisation updates from https://translatewiki.net.

* commons-app#3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment (commons-app#3499)

* commons-app#3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - add apropriate schedulers and convert justs to fromCallable

* commons-app#3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - remove test for removed functionality

* commons-app#3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - replace kotlin with java

* Revert stopgaps related to beta server cert issue (commons-app#3396)

* Revert stopgaps related to beta server cert issue

The upstream issue with Commons beta server has been
fixed now[1]. So, there's no point in stopgapping
the issue anymore. So, revert the related changes.

This reverts fa87eb5
and df426f7 which
correspond to PRs commons-app#3350 and commons-app#3349 respectively.

[1]: https://phabricator.wikimedia.org/T243881#5861983

* Test-fix: fix the failing CI test

* Chek if getContext() is instanceOf CategoryImagesCallback and only then request more images

* commons-app#3471 Remove android.enableUnitTestBinaryResources - remove line (commons-app#3478)

* Change item background according to the theme (commons-app#3480)

* Change item  background according to the theme

* Change background colour of item on being selected

* Change background colors using XML selectors

* solved crashing problem in nomination button (commons-app#3522)

solved crashing problem in nomination button

solved crashing problem in nomination button

* author not shown bug (commons-app#3525)

* Localisation updates from https://translatewiki.net.

* Fixes commons-app#2238 scalebar added in map  (commons-app#3511)

* scalebar added in map

* changes reverted in .idea/Project.xml

* magic numbers replaced with constants for scalebar

* Default setting for scaling unit

* Default setting for scalebar refresh interval

* Reformatted code for adding scalebar

* dimen values for scalebar params

* Fix p18 issue For an item with P18 item, do not add another one (commons-app#3527)

* Add p18value variable to contrib

* set place.pic to candidate contribution

* Add p18 value to contrib

* Passes p18 value to wikidata upload service

* Checks if pic parameter of the wikidata item is empty or not. If not, it does not overrides the existing image, it is just a regular commons upload.

* Make public var private

* Make current tests pass

* Add test case for p18 value is not empty

* Fix wrong log message

* Add nonnul annotation and fix method javadoc

* commons-app#3524 Convert SpinnerLanguagesAdapter to kotlin - converted to kotlin (commons-app#3528)

* commons-app#3524 Convert SpinnerLanguagesAdapter to kotlin - converted to kotlin

* commons-app#3524 Convert SpinnerLanguagesAdapter to kotlin - add KDoc - rework logic - format

* Fixes commons-app#3464, App posts deletion request notifications ({{subst:idw}}) on the wrong user's talk page (commons-app#3495)

* Fixed commons-app#3464: App posts deletion request notifications ({{subst:idw}}) on the wrong user's talk page

* Fixed DeleteHelperTest.kt

* Fixed DeleteHelper tests and null-pointer exception

* Modified DeleteHelper makeDeletion() test

* Reverted unintentionally modified Project.xml

* Raising exception when nominating for deletion with empty creator name

* Fixed code style

* Fixed code style

* Fixes commons-app#3465 Use AndroidX Pref (commons-app#3521)

* [WIP] Fixes commons-app#3465 Use AndroidX Pref

* Deleted Unused Files

* Added singleLineTitle

* Updated Gradle Properties

* Migrated to Androidx

* Inline Variable change

* optimise imports

* Fixed Crash on empty input

* Add a dialog to prompt user if location is off in Nearby when L… (commons-app#3438)

* Fixes commons-app#3359 Duplicate Photos in Contributions Page (commons-app#3515)

* Fixes commons-app#3359
* Cache thumb url & imageUrl in local db
* Use Fresco's ImageRequest to show images in ContributionViewHolder[this was the issue, we should have always used this to show the image]
* Deleted DisplayableContribution (not needed anymore)
* Exposed abstract function in ContributionDao to updateContribution

* * Make position private in ContributionViewHolder
* Remove MediaDataExtractor from ContributionsFragment

* * Show placeholder image for Contributions while the image loads
* setHasStableId's ContributionsAdapter

* make Random variable private in ContributionViewHolder

* replace local variable-if-with ternary operator in ContributionViewHolder

* Fix indentation/formatting of ternary operator in ContributionViewHolder

* I might revert this commit[I have reasons]

* Create in-memory drawables in CVH's onBind, caches are bad, add mental overhead

* Revert "I might revert this commit[I have reasons]"

This reverts commit 627ac91.

* minor formatting changes, reverted 627ac91

* uh-oh missed semicolon, java

* minor formatting changes

* Fixes 3536 (commons-app#3537)

* Removed the focus change listener of the username edittext (commons-app#3538)

* Modify PR template (commons-app#3548)

* Localisation updates from https://translatewiki.net.

* Issue commons-app#3428: Swapped text in dialog buttons  (commons-app#3496)

* Issue commons-app#3428: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other

* Fixed Issue commons-app#3428 so it actually works correctly now: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other

* Made sure that all of the places where the two types of showAlertDialog accurately match up with the new position of positive and negative text on the dialog box
Also removed occurences of empty lambda expressions and used null instead

* modified deletThisPicture to be accurate lambda call

* reverted mistake where ellipses replaced the three dots

* commons-app#3532 Issue with gitignore - synchronise section with default plugin state (commons-app#3535)

* Fixes commons-app#3473 Changed Names and Order or Theme Options (commons-app#3556)

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes  (commons-app#3543)

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - refactor FileProcessor

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - refactor and rename GpsExtractor

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - convert ImageCoordinates to kotlin

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - convert FileProcessor to kotlin

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - minor reformatting

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - fix compilation and naming issues

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - remove empty test

* commons-app#3408 Refactoring the FileProcessor and GPSExtractor classes - set coordinates for upload item if user chooses it

* Change "Archived" notifications to "Read" notifications (commons-app#3554)

* Change archived to read

* Change string names

* Fix hardcoded string in similar image dialog (commons-app#3563)

Fixes commons-app#3557

* Change BiMap to HashMap (commons-app#3572)

* Change BiMap to HashMap

* Change containsKey to containsValue and delete BiMap.java

* Localisation updates from https://translatewiki.net.

* PULL_REQUEST_TEMPLATE: request only issue number (commons-app#3545)

For some time now, GitHub is showing cards when we hover over an issue
number which gives us a quick summary of the issue. The issue title is
shown in the card among other things.

Given that and the fact that we already require the issue number to be
specified in the pull request description, it's now moot to
ask the contributors to include the issue title in the pull request
description. So, let's remove this unnecessary burden from them.

* Fix title/desc not getting filled for nearby picture (commons-app#3577)

* Wiki itemname displaying in toast (commons-app#3569)

* Wiki itemname displaying in toast

* Wikidata label displaying in toast

* Wikidata label displaying in toast

* wikiItemName added to parcelable methods

* Wikidata label displayed in toast

* Wikidata label displayed in toast

* commons-app#3579 p18Value causes NPE in WikidataEditService createClaimWithLogging - add null check (commons-app#3580)

* Fixes commons-app#3494 (commons-app#3519)

* better names for the upload warning dialog buttons commons-app#3494

* Dialog button pt2

* dialog buttons pt3

* round 4..

Co-authored-by: Hdot <[email protected]>

* Fix auto zoom issue commons-app#3391 Zoom level gets reset at every second. (commons-app#3564)

* Add method to check if curr location marker is vsible or not

* Recenter map if users see their current location marker

* Add new methods to Contract

* Localisation updates from https://translatewiki.net.

* PULL_REQUEST_TEMPLATE: clarify that issue number needs to be replaced (commons-app#3599)

Some contributors seem to be missing the fact that they have to mention
the issue number right after `Fixes ` to ensure the corresponding issue
gets closed[1] when the PR gets merged.

Clarify this by using a better phrase that clearly states that they
have to replace the placeholder text with the issue number.

[1]: https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

* swipe away failed notification (commons-app#3598)

* issue-commons-app#3567: logos in about activity visible (commons-app#3592)

* Fixes commons-app#3479: Implement Progress Bar for Zoom Activity  (commons-app#3481)

* ZoomableActivity: add hierarchy to view for displaying progress bar

* CircularProgressBar: circular progress bar for ZoomableDraweeView

* ZoomableActivity: add indeterministic loading spinner

* activity_zoomable: add inderterministic Progressbar

* remove circular progressbar and make changes to controller listener

* Fixes commons-app#3575 (commons-app#3602)

* Donot show random colors as placeholders for contributions items
* Theme contributionsItem background as mainBackground from attributes

* Fixes commons-app#3611 (commons-app#3613)

* Properly generate Parcealables for Media & Contribution

* issue-commons-app#3606: cancel in translate goes back to about screen (commons-app#3610)

* Localisation updates from https://translatewiki.net.

* Fixed issue commons-app#3195 ordering contribution list (commons-app#3589)

* issue-commons-app#3195: order contribution list refactored

* issue-commons-app#3195: ordered contribution list

* exit app on back pressed in tutorial (commons-app#3597)

* exit app on back pressed in tutorial

* exit app from ongoing tutorial

* exit app on back press in tutorial

* Fixes commons-app#3466  No crash information in crash email (Gmail) (commons-app#3605)

* Send ACRA logs as file instead

* no need to set it true, default is true

* Fixed issue commons-app#3195 ordering contribution list (commons-app#3589)

* issue-commons-app#3195: order contribution list refactored

* issue-commons-app#3195: ordered contribution list

* Update wiki page links (commons-app#3608)

We've moved the documentation to a separate repo.

So, change the old links to point to the corresponding
places in the documentation repo.

* Fixes commons-app#3506: Image height remains zero for some time on bad network (commons-app#3513)

* optimise width loading

* amending as per the reviews

* aspect ratio updates after layout completion

* MediaDetailFragment: update aspect ratio using onGlobalLayoutListener

* remove unnecessary imports

* commons-app#3492 Add inspections to git - add inspection profile (commons-app#3631)

* commons-app#3628 Update Gradle Plugin - bump version (commons-app#3629)

* commons-app#3624 DateTimeFormat wrong - match pattern returned from servers (commons-app#3625)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Copy place name on long click (commons-app#3609)

* Copy place name on long click

* Remove hard coded string

* Fixed logout problem commons-app#3547 (commons-app#3649)

* fixed logout problem

fixed logout problem

fixed logout problem

fixed logout problem

fixed logout problem

* added error handling on logout

* Fast scroll issue fixed (commons-app#3593)

* fast scroll fixed in explore activity

* fast scroll fixed in explore activity

* fast scroll issue in explore

* fastscroll removed from explore

* Converted DialogUtil to Kotlin (commons-app#3621)

* Converted DialogUtil to Kotlin

* Kotlin syntax and standard changes

* Removed ;

* Added missing null

* Added missing null

* Removed unnecessary code

* Reduced functions

* added let to customView

* reverted "let" changes

* reverted "let" changes

* removed if-statements

* replaced with "it"

* fixed overflow error

* Function rename

* Used named arguments

* Fix Typo

* single lined

* Update DialogUtil.kt

* changed default value

* ReviewController: remove call to review category notif builder while sending thanks (commons-app#3655)

* With data-client added as library module (commons-app#3656)

* With data-client added as library module

* Fix build

* Fixed username visible after logout bug (commons-app#3648)

* Localisation updates from https://translatewiki.net.

* commons-app#3630 [Library Discussion] Core-ktx (commons-app#3660)

* Convert download code to kotlin (commons-app#3665)

* Remove unused constructor (commons-app#3668)

* commons-app#3658 Throw exception instead of allowing nullable network models onError - peek response body and throw error (commons-app#3659)

* commons-app#3658 Throw exception instead of allowing nullable network models onError - peek response body and throw error

* commons-app#3658 Throw exception instead of allowing nullable network models onError - allow for more general error response catching

* Address code review comments (commons-app#3669)

* Fixes commons-app#3436 and commons-app#2881: Media Detail design Overhaul (commons-app#3505)

* ic_map_dark_24dp: map icon for white background

* ic_info_outline_dark_24dp: info icon for dark background

* MediaDetailFragment: update the spacer as per image aspect ratio

* fragment_media_detail: design overhaul

* fragment_media_detail: remove redundant background color statements

* make requested changes

* add dark mode support

* minor ui tweak

* white map icon in dark mode

* make rquested changes

* make requested changes to layout

* fix misalignment of category list

* subtle amendments

* convert comments to javadocs

* minor amendments

* minor changes

* add styles for media detail

* Media detail fragment refactored

* make suggested changes

* minor name fix

* fix the delete button border

Co-authored-by: Josephine Lim <[email protected]>
Co-authored-by: Manuel Alcaraz <[email protected]>
Co-authored-by: translatewiki.net <[email protected]>
Co-authored-by: neslihanturan <[email protected]>
Co-authored-by: Zoran Dori <[email protected]>
Co-authored-by: ANKIT <[email protected]>
Co-authored-by: Ashish Kumar <[email protected]>
Co-authored-by: Amir E. Aharoni <[email protected]>
Co-authored-by: Kshitij Bhardwaj <[email protected]>
Co-authored-by: Malcolm Smith <[email protected]>
Co-authored-by: Alicia <[email protected]>
Co-authored-by: Somanshu <[email protected]>
Co-authored-by: animeshk08 <[email protected]>
Co-authored-by: Madhur Gupta <[email protected]>
Co-authored-by: Mudit Jain <[email protected]>
Co-authored-by: Kaartic Sivaraam <[email protected]>
Co-authored-by: Yash Khare <[email protected]>
Co-authored-by: Aastha Bist <[email protected]>
Co-authored-by: gouri-panda <[email protected]>
Co-authored-by: Aryan Tyagi <[email protected]>
Co-authored-by: Veyndan Stuart <[email protected]>
Co-authored-by: Aristos Pasalidis <[email protected]>
Co-authored-by: Adam Jones <[email protected]>
Co-authored-by: Seán Mac Gillicuddy <[email protected]>
Co-authored-by: Anmol Gupta <[email protected]>
Co-authored-by: taakanksha <[email protected]>
Co-authored-by: Kaartic Sivaraam <[email protected]>
Co-authored-by: 318anushka <[email protected]>
Co-authored-by: Vitaly V. Pinchuk <[email protected]>
Co-authored-by: Fawziyah Alebiosu <[email protected]>
Co-authored-by: hudlerr <[email protected]>
Co-authored-by: Hdot <[email protected]>
Co-authored-by: Prince Amankwah <[email protected]>
Co-authored-by: Prince Amankwah <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants