mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Remove redundant methods for showing/hiding keyboard.
This commit is contained in:
@@ -45,6 +45,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Logger.getLogger;
|
||||
import static org.briarproject.briar.android.TestingConstants.PREVENT_SCREENSHOTS;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideSoftKeyboard;
|
||||
|
||||
/**
|
||||
* Warning: Some activities don't extend {@link BaseActivity}.
|
||||
@@ -214,14 +215,6 @@ public abstract class BaseActivity extends AppCompatActivity
|
||||
});
|
||||
}
|
||||
|
||||
public void showSoftKeyboard(View view) {
|
||||
UiUtils.showSoftKeyboard(view);
|
||||
}
|
||||
|
||||
public void hideSoftKeyboard(View view) {
|
||||
UiUtils.hideSoftKeyboard(view);
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void handleDbException(DbException e) {
|
||||
supportFinishAfterTransition();
|
||||
|
||||
@@ -32,6 +32,7 @@ import static android.view.View.VISIBLE;
|
||||
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideSoftKeyboard;
|
||||
|
||||
public class RssFeedImportActivity extends BriarActivity {
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ import static org.briarproject.bramble.util.LogUtils.logDuration;
|
||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||
import static org.briarproject.bramble.util.LogUtils.now;
|
||||
import static org.briarproject.briar.android.util.UiUtils.enterPressed;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideSoftKeyboard;
|
||||
import static org.briarproject.briar.android.util.UiUtils.showSoftKeyboard;
|
||||
import static org.briarproject.briar.api.forum.ForumConstants.MAX_FORUM_NAME_LENGTH;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
|
||||
@@ -43,6 +43,7 @@ import static java.util.Objects.requireNonNull;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.bramble.util.LogUtils.logException;
|
||||
import static org.briarproject.briar.android.util.UiUtils.getContactDisplayName;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideSoftKeyboard;
|
||||
import static org.briarproject.briar.api.introduction.IntroductionConstants.MAX_INTRODUCTION_TEXT_LENGTH;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@@ -184,7 +185,7 @@ public class IntroductionMessageFragment extends BaseFragment
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
introductionActivity.hideSoftKeyboard(ui.message);
|
||||
hideSoftKeyboard(ui.message);
|
||||
introductionActivity.onBackPressed();
|
||||
return true;
|
||||
default:
|
||||
@@ -201,7 +202,7 @@ public class IntroductionMessageFragment extends BaseFragment
|
||||
makeIntroduction(contact1, contact2, text);
|
||||
|
||||
// don't wait for the introduction to be made before finishing activity
|
||||
introductionActivity.hideSoftKeyboard(ui.message);
|
||||
hideSoftKeyboard(ui.message);
|
||||
introductionActivity.setResult(RESULT_OK);
|
||||
introductionActivity.supportFinishAfterTransition();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ import javax.inject.Inject;
|
||||
import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.QUITE_WEAK;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideSoftKeyboard;
|
||||
import static org.briarproject.briar.android.util.UiUtils.showSoftKeyboard;
|
||||
|
||||
public class ChangePasswordActivity extends BriarActivity
|
||||
implements OnClickListener, OnEditorActionListener {
|
||||
|
||||
@@ -24,6 +24,8 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
|
||||
import static org.briarproject.briar.android.util.UiUtils.enterPressed;
|
||||
import static org.briarproject.briar.android.util.UiUtils.hideSoftKeyboard;
|
||||
import static org.briarproject.briar.android.util.UiUtils.showSoftKeyboard;
|
||||
import static org.briarproject.briar.api.privategroup.PrivateGroupConstants.MAX_GROUP_NAME_LENGTH;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@@ -94,7 +96,7 @@ public class CreateGroupFragment extends BaseFragment {
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
if (nameEntry.requestFocus()) listener.showSoftKeyboard(nameEntry);
|
||||
showSoftKeyboard(nameEntry);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,7 +122,7 @@ public class CreateGroupFragment extends BaseFragment {
|
||||
|
||||
private void createGroup() {
|
||||
if (!validateName()) return;
|
||||
listener.hideSoftKeyboard(nameEntry);
|
||||
hideSoftKeyboard(nameEntry);
|
||||
createGroupButton.setVisibility(GONE);
|
||||
progress.setVisibility(VISIBLE);
|
||||
listener.onGroupNameChosen(nameEntry.getText().toString());
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package org.briarproject.briar.android.privategroup.creation;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import org.briarproject.briar.android.fragment.BaseFragment.BaseFragmentListener;
|
||||
|
||||
interface CreateGroupListener extends BaseFragmentListener {
|
||||
|
||||
void onGroupNameChosen(String name);
|
||||
|
||||
void showSoftKeyboard(View view);
|
||||
|
||||
void hideSoftKeyboard(View view);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user