mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
introduce a hideSoftKeyboard() method and use it
This commit is contained in:
@@ -166,4 +166,10 @@ public abstract class BaseActivity extends AppCompatActivity
|
|||||||
Object o = getSystemService(INPUT_METHOD_SERVICE);
|
Object o = getSystemService(INPUT_METHOD_SERVICE);
|
||||||
((InputMethodManager) o).showSoftInput(view, SHOW_IMPLICIT);
|
((InputMethodManager) o).showSoftInput(view, SHOW_IMPLICIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void hideSoftKeyboard(View view) {
|
||||||
|
Object o = getSystemService(INPUT_METHOD_SERVICE);
|
||||||
|
((InputMethodManager) o).hideSoftInputFromWindow(view.getWindowToken(),
|
||||||
|
0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class PasswordActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onEditorAction(TextView v, int actionId,
|
public boolean onEditorAction(TextView v, int actionId,
|
||||||
KeyEvent event) {
|
KeyEvent event) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(password);
|
||||||
validatePassword(encrypted, password.getText());
|
validatePassword(encrypted, password.getText());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,7 @@ public class PasswordActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void validatePassword(final byte[] encrypted, Editable e) {
|
private void validatePassword(final byte[] encrypted, Editable e) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(password);
|
||||||
// Replace the button with a progress bar
|
// Replace the button with a progress bar
|
||||||
signInButton.setVisibility(INVISIBLE);
|
signInButton.setVisibility(INVISIBLE);
|
||||||
progress.setVisibility(VISIBLE);
|
progress.setVisibility(VISIBLE);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class SetupActivity extends BaseActivity implements OnClickListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(v);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ public class ConversationActivity extends BriarActivity
|
|||||||
timestamp = Math.max(timestamp, getMinTimestampForNewMessage());
|
timestamp = Math.max(timestamp, getMinTimestampForNewMessage());
|
||||||
createMessage(StringUtils.toUtf8(message), timestamp);
|
createMessage(StringUtils.toUtf8(message), timestamp);
|
||||||
content.setText("");
|
content.setText("");
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getMinTimestampForNewMessage() {
|
private long getMinTimestampForNewMessage() {
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ implements OnEditorActionListener, OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean onEditorAction(TextView textView, int actionId, KeyEvent e) {
|
public boolean onEditorAction(TextView textView, int actionId, KeyEvent e) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(textView);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ implements OnEditorActionListener, OnClickListener {
|
|||||||
|
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (view == createForumButton) {
|
if (view == createForumButton) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(view);
|
||||||
if (!validateName()) return;
|
if (!validateName()) return;
|
||||||
createForumButton.setVisibility(GONE);
|
createForumButton.setVisibility(GONE);
|
||||||
progress.setVisibility(VISIBLE);
|
progress.setVisibility(VISIBLE);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ implements OnEditorActionListener, OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean onEditorAction(TextView textView, int actionId, KeyEvent e) {
|
public boolean onEditorAction(TextView textView, int actionId, KeyEvent e) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(textView);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ implements OnEditorActionListener, OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
toggleSoftKeyboard();
|
hideSoftKeyboard(view);
|
||||||
if (!validateNickname()) return;
|
if (!validateNickname()) return;
|
||||||
// Replace the button with a progress bar
|
// Replace the button with a progress bar
|
||||||
createIdentityButton.setVisibility(GONE);
|
createIdentityButton.setVisibility(GONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user