diff --git a/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java b/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java index 9b8035e5d..24f47e3f0 100644 --- a/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/contributions/MainActivity.java @@ -1,5 +1,6 @@ package fr.free.nrw.commons.contributions; +import android.app.AlertDialog; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; @@ -119,22 +120,19 @@ public class MainActivity extends AuthenticatedActivity implements FragmentManag // Set custom view to add nearby info icon next to text View nearbyTabLinearLayout = LayoutInflater.from(this).inflate(R.layout.custom_nearby_tab_layout, null); - View nearbyInfoPopupWindowLayout = LayoutInflater.from(this).inflate(R.layout.nearby_info_popup_layout, null); ImageView nearbyInfo = nearbyTabLinearLayout.findViewById(R.id.nearby_info_image); tabLayout.getTabAt(1).setCustomView(nearbyTabLinearLayout); nearbyInfo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - /*new AlertDialog.Builder(MainActivity.this) + new AlertDialog.Builder(MainActivity.this) .setTitle(R.string.title_activity_nearby) .setMessage(R.string.showcase_view_whole_nearby_activity) .setCancelable(true) .setNeutralButton(android.R.string.ok, (dialog, id) -> dialog.cancel()) .create() - .show();*/ - String popupText = getResources().getString(R.string.showcase_view_whole_nearby_activity); - ViewUtil.displayPopupWindow(nearbyInfo, MainActivity.this, nearbyInfoPopupWindowLayout, popupText); + .show(); } }); diff --git a/app/src/main/java/fr/free/nrw/commons/utils/ViewUtil.java b/app/src/main/java/fr/free/nrw/commons/utils/ViewUtil.java index 527bf4b9e..e88194d15 100644 --- a/app/src/main/java/fr/free/nrw/commons/utils/ViewUtil.java +++ b/app/src/main/java/fr/free/nrw/commons/utils/ViewUtil.java @@ -81,17 +81,6 @@ public class ViewUtil { } } - public static void displayPopupWindow(View anchorView, Context context, View popupWindowLayout, String text) { - - PopupWindow popup = new PopupWindow(context); - popup.setContentView(popupWindowLayout); - // Closes the popup window when touch outside of it - when looses focus - popup.setOutsideTouchable(true); - popup.setFocusable(true); - // Show anchored to button - popup.showAsDropDown(anchorView); - } - /** * A snack bar which has an action button which on click dismisses the snackbar and invokes the * listener passed @@ -111,5 +100,4 @@ public class ViewUtil { snackbar.show(); }); } - } diff --git a/app/src/main/res/layout/nearby_info_popup_layout.xml b/app/src/main/res/layout/nearby_info_popup_layout.xml deleted file mode 100644 index 04c1a2d54..000000000 --- a/app/src/main/res/layout/nearby_info_popup_layout.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file