Skip to content

Commit 3d11593

Browse files
Merge pull request #1369 from misaochan/nearby-fixes
Additional fix for text wrap issue in Nearby
2 parents 15b5f02 + f23cd82 commit 3d11593

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/NearbyMapFragment.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,9 @@ public void onSlide(@NonNull View bottomSheet, float slideOffset) {
394394
}
395395
});
396396

397-
// Remove texts if it doesnt fit
398-
if (wikipediaButtonText.getLineCount() > 1
399-
|| wikidataButtonText.getLineCount() > 1
400-
|| commonsButtonText.getLineCount() > 1
401-
|| directionsButtonText.getLineCount() > 1) {
397+
// Remove button text if they exceed 1 line or if internal layout has not been built
398+
// Only need to check for directions button because it is the longest
399+
if (directionsButtonText.getLineCount() > 1 || directionsButtonText.getLineCount() == 0) {
402400
wikipediaButtonText.setVisibility(View.GONE);
403401
wikidataButtonText.setVisibility(View.GONE);
404402
commonsButtonText.setVisibility(View.GONE);
@@ -583,7 +581,7 @@ private void showFAB() {
583581

584582

585583
/*
586-
* Add amnchors back before making them visible again.
584+
* Add anchors back before making them visible again.
587585
* */
588586
private void addAnchorToBigFABs(FloatingActionButton floatingActionButton, int anchorID) {
589587
CoordinatorLayout.LayoutParams params = new CoordinatorLayout.LayoutParams
@@ -594,7 +592,7 @@ private void addAnchorToBigFABs(FloatingActionButton floatingActionButton, int a
594592
}
595593

596594
/*
597-
* Add amnchors back before making them visible again. Big and small fabs have different anchor
595+
* Add anchors back before making them visible again. Big and small fabs have different anchor
598596
* gravities, therefore the are two methods.
599597
* */
600598
private void addAnchorToSmallFABs(FloatingActionButton floatingActionButton, int anchorID) {
@@ -651,9 +649,6 @@ private void passInfoToSheet(Place place) {
651649
DirectUpload directUpload = new DirectUpload(this, controller);
652650
storeSharedPrefs();
653651
directUpload.initiateGalleryUpload();
654-
655-
//TODO: App crashes after image upload completes
656-
//TODO: Handle onRequestPermissionsResult
657652
}
658653
});
659654
}

0 commit comments

Comments
 (0)