Move nearby card methods

This commit is contained in:
neslihanturan 2019-08-29 11:30:06 +03:00
parent eeb03bf5c2
commit 65ca06c7ec

View file

@ -73,34 +73,34 @@ public class NearbyNotificationCardView extends SwipableCardView {
@Override @Override
protected void onAttachedToWindow() { protected void onAttachedToWindow() {
super.onAttachedToWindow(); super.onAttachedToWindow();
/* // If you don't setVisibility after getting layout params, then you will se an empty space in place of nearby NotificationCardView // If you don't setVisibility after getting layout params, then you will se an empty space in place of nearby NotificationCardView
if (((MainActivity)getContext()).defaultKvStore.getBoolean("displayNearbyCardView", true) && this.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) { if (((NearbyTestFragmentLayersActivity)getContext()).defaultKvStore.getBoolean("displayNearbyCardView", true) && this.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
this.setVisibility(VISIBLE); this.setVisibility(VISIBLE);
} else { } else {
this.setVisibility(GONE); this.setVisibility(GONE);
}*/ }
} }
private void setActionListeners(Place place) { private void setActionListeners(Place place) {
/* this.setOnClickListener(view -> { this.setOnClickListener(view -> {
MainActivity m = (MainActivity) getContext(); NearbyTestFragmentLayersActivity m = (NearbyTestFragmentLayersActivity) getContext();
// Change to nearby tab // Change to nearby tab
m.viewPager.setCurrentItem(NEARBY_TAB_POSITION); m.viewPager.setCurrentItem(NEARBY_TAB_POSITION);
// Center the map to the place // Center the map to the place
//((NearbyFragment) m.contributionsActivityPagerAdapter.getItem(NEARBY_TAB_POSITION)).centerMapToPlace(place); //((NearbyFragment) m.contributionsActivityPagerAdapter.getItem(NEARBY_TAB_POSITION)).centerMapToPlace(place);
});*/ });
} }
@Override public boolean onSwipe(View view) { @Override public boolean onSwipe(View view) {
/* view.setVisibility(GONE); view.setVisibility(GONE);
// Save shared preference for nearby card view accordingly // Save shared preference for nearby card view accordingly
((MainActivity) getContext()).defaultKvStore.putBoolean("displayNearbyCardView", false); ((NearbyTestFragmentLayersActivity) getContext()).defaultKvStore.putBoolean("displayNearbyCardView", false);
ViewUtil.showLongToast(getContext(), ViewUtil.showLongToast(getContext(),
getResources().getString(R.string.nearby_notification_dismiss_message)); getResources().getString(R.string.nearby_notification_dismiss_message));
*/return true; return true;
} }
/** /**