Skip to content

Add information icon action Fiixes #2055 2.9.0: the 'i' icon in nearby doesn't do anything #2057

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -119,22 +120,19 @@ private void addTabsAndFragments() {

// 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();
}
});

Expand Down
12 changes: 0 additions & 12 deletions app/src/main/java/fr/free/nrw/commons/utils/ViewUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,6 @@ public static void hideKeyboard(View view){
}
}

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
Expand All @@ -106,5 +95,4 @@ public static void showDismissibleSnackBar(View view, int messageResourceId,
snackbar.show();
});
}

}
19 changes: 0 additions & 19 deletions app/src/main/res/layout/nearby_info_popup_layout.xml

This file was deleted.