Skip to content

Commit 615c0be

Browse files
neslihanturanmaskaravivek
authored andcommitted
Add information icon action Fiixes #2055 2.9.0: the 'i' icon in nearby doesn't do anything (#2057)
* Localisation updates from https://translatewiki.net. * Remove unused mediawiki api dependency (#1991) * Categories with pipe suffix (#1873) * Bug fix issue #1826 Changes made : -Certain category names used to show suffixed with strings prefixed with pipe '|'. Removed everything after the pipe. As per the discussion on the thread, its safe to remove everything after the pipe, including the pipe * review suggested changes *Code formatting *Extracted out the index of pipe in a variable *Added issue link in comments * Remove libraries section from README (#1988) * Remove libraries section from README * Add wiki link to "libraries used" to README * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Use alert dialog instead of popup window, for nearby information * Revert irrelevant changes, sorry
1 parent 36e077f commit 615c0be

File tree

3 files changed

+3
-36
lines changed

3 files changed

+3
-36
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.free.nrw.commons.contributions;
22

3+
import android.app.AlertDialog;
34
import android.content.Intent;
45
import android.content.SharedPreferences;
56
import android.content.pm.PackageManager;
@@ -119,22 +120,19 @@ private void addTabsAndFragments() {
119120

120121
// Set custom view to add nearby info icon next to text
121122
View nearbyTabLinearLayout = LayoutInflater.from(this).inflate(R.layout.custom_nearby_tab_layout, null);
122-
View nearbyInfoPopupWindowLayout = LayoutInflater.from(this).inflate(R.layout.nearby_info_popup_layout, null);
123123
ImageView nearbyInfo = nearbyTabLinearLayout.findViewById(R.id.nearby_info_image);
124124
tabLayout.getTabAt(1).setCustomView(nearbyTabLinearLayout);
125125

126126
nearbyInfo.setOnClickListener(new View.OnClickListener() {
127127
@Override
128128
public void onClick(View view) {
129-
/*new AlertDialog.Builder(MainActivity.this)
129+
new AlertDialog.Builder(MainActivity.this)
130130
.setTitle(R.string.title_activity_nearby)
131131
.setMessage(R.string.showcase_view_whole_nearby_activity)
132132
.setCancelable(true)
133133
.setNeutralButton(android.R.string.ok, (dialog, id) -> dialog.cancel())
134134
.create()
135-
.show();*/
136-
String popupText = getResources().getString(R.string.showcase_view_whole_nearby_activity);
137-
ViewUtil.displayPopupWindow(nearbyInfo, MainActivity.this, nearbyInfoPopupWindowLayout, popupText);
135+
.show();
138136
}
139137
});
140138

app/src/main/java/fr/free/nrw/commons/utils/ViewUtil.java

-12
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@ public static void hideKeyboard(View view){
8181
}
8282
}
8383

84-
public static void displayPopupWindow(View anchorView, Context context, View popupWindowLayout, String text) {
85-
86-
PopupWindow popup = new PopupWindow(context);
87-
popup.setContentView(popupWindowLayout);
88-
// Closes the popup window when touch outside of it - when looses focus
89-
popup.setOutsideTouchable(true);
90-
popup.setFocusable(true);
91-
// Show anchored to button
92-
popup.showAsDropDown(anchorView);
93-
}
94-
9584
/**
9685
* A snack bar which has an action button which on click dismisses the snackbar and invokes the
9786
* listener passed
@@ -111,5 +100,4 @@ public static void showDismissibleSnackBar(View view, int messageResourceId,
111100
snackbar.show();
112101
});
113102
}
114-
115103
}

app/src/main/res/layout/nearby_info_popup_layout.xml

-19
This file was deleted.

0 commit comments

Comments
 (0)