Skip to content

Commit

Permalink
Add focus change listener for mainInput, preventing the case where us…
Browse files Browse the repository at this point in the history
…er can coerce both keyboards to be shown at once
  • Loading branch information
icasdri committed Aug 10, 2016
1 parent 55e264b commit df1dbfc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/src/main/java/org/icasdri/mather/MainActivityFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.icasdri.mather;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.os.Bundle;
Expand All @@ -24,14 +23,11 @@
import android.view.ViewTreeObserver;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.TextView;

import javax.net.ssl.ManagerFactoryParameters;

/**
* Fragment controlling the main recycler view.
*/
Expand Down Expand Up @@ -81,6 +77,13 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);

/* Main Input switcher button initialization */
this.mainInput.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
MainActivityFragment.this.useUserKeysKeyboard(!hasFocus);
}
});

mainInputSwitcherButton = (ImageButton) fragment.findViewById(R.id.main_input_switcher_button);
mainInputSwitcherButton.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down

0 comments on commit df1dbfc

Please sign in to comment.