Skip to content

Commit

Permalink
fix: Keyboard persistence bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sridharjajoo authored and therajanmaurya committed Apr 5, 2018
1 parent 17a4af3 commit 476b750
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.mifos.mobilebanking.ui.activities.base;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
Expand All @@ -12,6 +13,7 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;

import org.mifos.mobilebanking.MifosSelfServiceApp;
Expand Down Expand Up @@ -252,4 +254,13 @@ public int stackCount() {
return getSupportFragmentManager().getBackStackEntryCount();
}


public static void hideKeyboard(Context context) {
Activity activity = (Activity) context;
InputMethodManager inputMethodManager =
(InputMethodManager) context.getSystemService(
Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(
activity.getCurrentFocus().getWindowToken(), 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import butterknife.ButterKnife;
import butterknife.OnClick;

import static org.mifos.mobilebanking.ui.activities.base.BaseActivity.hideKeyboard;

/**
* Created by Rajan Maurya on 10/03/17.
*/
Expand Down Expand Up @@ -193,7 +195,7 @@ void reviewTransfer() {
transferPayload.setTransferAmount(Double.parseDouble(etAmount.getText().toString()));
transferPayload.setTransferDescription(etRemark.getText().toString());


hideKeyboard(getActivity());
((BaseActivity) getActivity()).replaceFragment(TransferProcessFragment.
newInstance(transferPayload, TransferType.SELF), true, R.id.container);
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/org/mifos/mobilebanking/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ public static String formatTransactionType(String type) {
}
return builder.toString();
}

}

0 comments on commit 476b750

Please sign in to comment.