Merge pull request #64 from dddddd-mmmmmm/issue-48

issue-48: hide keyboard when switching to now playing
This commit is contained in:
Andrew Rabert 2020-01-13 11:01:02 -05:00 committed by GitHub
commit d5b56eecdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -171,6 +171,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
panelSlideListener = new SlidingUpPanelLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
Util.hideKeyboard(panel);
}
@Override

View File

@ -41,9 +41,12 @@ import android.text.util.Linkify;
import android.util.Log;
import android.util.SparseArray;
import android.view.Gravity;
import android.view.inputmethod.InputMethodManager;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.app.Activity;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
@ -1135,4 +1138,10 @@ public final class Util {
return random;
}
public static void hideKeyboard(View view) {
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}