Skip to content

Commit 4a12a0e

Browse files
committed
removed involvement of nearbyFragment
1 parent 491d1f2 commit 4a12a0e

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public void onPageSelected(int position) {
180180
Timber.d("Contributions tab selected");
181181
tabLayout.getTabAt(CONTRIBUTIONS_TAB_POSITION).select();
182182
isContributionsFragmentVisible = true;
183-
((NearbyParentFragment)contributionsActivityPagerAdapter.getItem(NEARBY_TAB_POSITION)).hideKeyboard();
183+
ViewUtil.hideKeyboard(tabLayout.getRootView());
184184
updateMenuItem();
185185
break;
186186
case NEARBY_TAB_POSITION:

app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package fr.free.nrw.commons.nearby.fragments;
22

33
import android.Manifest;
4-
import android.app.Activity;
54
import android.app.AlertDialog;
65
import android.content.BroadcastReceiver;
76
import android.content.Context;
@@ -10,15 +9,13 @@
109
import android.content.res.Configuration;
1110
import android.graphics.Bitmap;
1211
import android.os.Bundle;
13-
import android.os.IBinder;
1412
import android.util.Log;
1513
import android.view.Gravity;
1614
import android.view.LayoutInflater;
1715
import android.view.View;
1816
import android.view.ViewGroup;
1917
import android.view.animation.Animation;
2018
import android.view.animation.AnimationUtils;
21-
import android.view.inputmethod.InputMethodManager;
2219
import android.widget.Button;
2320
import android.widget.ImageView;
2421
import android.widget.LinearLayout;
@@ -600,20 +597,6 @@ public void centerMapToPlace(Place place) {
600597
}
601598
}
602599

603-
/**
604-
* Hides the keyboard in case the tab is switched
605-
*/
606-
public void hideKeyboard(){
607-
if(!searchView.isIconified()) {
608-
searchView.clearFocus();
609-
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
610-
final IBinder windowToken = this.getView().getRootView().getWindowToken();
611-
if (view != null) {
612-
imm.hideSoftInputFromWindow(windowToken, InputMethodManager.HIDE_NOT_ALWAYS);
613-
}
614-
}
615-
}
616-
617600

618601
/**
619602
* Thanks to this method we make sure NearbyMapFragment is ready and attached. So that we can

0 commit comments

Comments
 (0)