use of android.support.v7.widget.AppCompatEditText in project krypton-android by kryptco.
the class OnboardingCreateFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_teams_onboarding_create, container, false);
Button createTeamButton = rootView.findViewById(R.id.createTeamOBButton);
createTeamButton.setEnabled(false);
AppCompatEditText teamNameEditText = rootView.findViewById(R.id.teamName);
teamNameEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.toString().length() == 0) {
createTeamButton.setEnabled(false);
} else {
createTeamButton.setEnabled(true);
}
}
});
createTeamButton.setOnClickListener(v -> {
CreateTeamProgress progress = new CreateTeamProgress(v.getContext());
progress.updateTeamData((s, d) -> {
d.name = teamNameEditText.getText().toString();
return CreateStage.AUDIT_LOGS;
});
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
fragmentManager.beginTransaction().setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_right, R.anim.exit_to_left).replace(R.id.fragment_teams, new OnboardingAuditLogsFragment()).commitNowAllowingStateLoss();
}
});
return rootView;
}
use of android.support.v7.widget.AppCompatEditText in project MTweaks-KernelAdiutorMOD by morogoku.
the class SecurityActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_security);
final String password = Utils.decodeString(getIntent().getStringExtra(PASSWORD_INTENT));
AppCompatEditText editText = (AppCompatEditText) findViewById(R.id.edittext);
mPasswordWrong = findViewById(R.id.password_wrong);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.toString().equals(password)) {
mPasswordWrong.setVisibility(View.GONE);
setResult(1);
finish();
} else {
mPasswordWrong.setVisibility(editable.toString().isEmpty() ? View.GONE : View.VISIBLE);
}
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Prefs.getBoolean("fingerprint", false, this)) {
mFingerprintManagerCompat = FingerprintManagerCompat.from(this);
if (mFingerprintManagerCompat.isHardwareDetected() && mFingerprintManagerCompat.hasEnrolledFingerprints() && getSystemService(KeyguardManager.class).isDeviceSecure()) {
loadFingerprint();
}
}
}
use of android.support.v7.widget.AppCompatEditText in project MTweaks-KernelAdiutorMOD by morogoku.
the class ViewUtils method dialogEditTexts.
public static Dialog dialogEditTexts(String text, String text2, String hint, String hint2, final DialogInterface.OnClickListener negativeListener, final onDialogEditTextsListener onDialogEditTextListener, Context context) {
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
int padding = (int) context.getResources().getDimension(R.dimen.dialog_padding);
layout.setPadding(padding, padding, padding, padding);
final AppCompatEditText editText = new AppCompatEditText(context);
editText.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
if (text != null) {
editText.append(text);
}
if (hint != null) {
editText.setHint(hint);
}
editText.setSingleLine(true);
final AppCompatEditText editText2 = new AppCompatEditText(context);
editText2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
if (text2 != null) {
editText2.setText(text2);
}
if (hint2 != null) {
editText2.setHint(hint2);
}
editText2.setSingleLine(true);
layout.addView(editText);
layout.addView(editText2);
Dialog dialog = new Dialog(context).setView(layout);
if (negativeListener != null) {
dialog.setNegativeButton(context.getString(R.string.cancel), negativeListener);
}
if (onDialogEditTextListener != null) {
dialog.setPositiveButton(context.getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
onDialogEditTextListener.onClick(editText.getText().toString(), editText2.getText().toString());
}
}).setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
if (negativeListener != null) {
negativeListener.onClick(dialog, 0);
}
}
});
}
return dialog;
}
use of android.support.v7.widget.AppCompatEditText in project EssayJoke by qiyei2015.
the class SkinAppCompatViewInflater method createView.
public final View createView(View parent, final String name, @NonNull Context context, @NonNull AttributeSet attrs, boolean inheritContext, boolean readAndroidTheme, boolean readAppTheme) {
final Context originalContext = context;
// by using the parent's context
if (inheritContext && parent != null) {
context = parent.getContext();
}
if (readAndroidTheme || readAppTheme) {
// We then apply the theme on the context, if specified
context = themifyContext(context, attrs, readAndroidTheme, readAppTheme);
}
View view = null;
// We need to 'inject' our tint aware Views in place of the standard framework versions
switch(name) {
case "TextView":
view = new AppCompatTextView(context, attrs);
break;
case "ImageView":
view = new AppCompatImageView(context, attrs);
break;
case "Button":
view = new AppCompatButton(context, attrs);
break;
case "EditText":
view = new AppCompatEditText(context, attrs);
break;
case "Spinner":
view = new AppCompatSpinner(context, attrs);
break;
case "ImageButton":
view = new AppCompatImageButton(context, attrs);
break;
case "CheckBox":
view = new AppCompatCheckBox(context, attrs);
break;
case "RadioButton":
view = new AppCompatRadioButton(context, attrs);
break;
case "CheckedTextView":
view = new AppCompatCheckedTextView(context, attrs);
break;
case "AutoCompleteTextView":
view = new AppCompatAutoCompleteTextView(context, attrs);
break;
case "MultiAutoCompleteTextView":
view = new AppCompatMultiAutoCompleteTextView(context, attrs);
break;
case "RatingBar":
view = new AppCompatRatingBar(context, attrs);
break;
case "SeekBar":
view = new AppCompatSeekBar(context, attrs);
break;
}
if (view == null) {
// If the original context does not equal our themed context, then we need to manually
// inflate it using the name so that android:theme takes effect.
view = createViewFromTag(context, name, attrs);
}
if (view != null) {
// If we have created a view, check it's android:onClick
checkOnClickListener(view, attrs);
}
return view;
}
use of android.support.v7.widget.AppCompatEditText in project AnExplorer by 1hakr.
the class CreateConnectionFragment method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Context context = getActivity();
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
final LayoutInflater dialogInflater = getActivity().getLayoutInflater();
final View view = dialogInflater.inflate(R.layout.dialog_create_connection, null, false);
name = (AppCompatEditText) view.findViewById(R.id.name);
host = (AppCompatEditText) view.findViewById(R.id.host);
port = (AppCompatEditText) view.findViewById(R.id.port);
path = (AppCompatEditText) view.findViewById(R.id.path);
hostContainer = view.findViewById(R.id.hostContainer);
pathContainer = view.findViewById(R.id.pathContainer);
username = (AppCompatEditText) view.findViewById(R.id.username);
usernameContainer = view.findViewById(R.id.usernameContainer);
password = (AppCompatEditText) view.findViewById(R.id.password);
passwordContainer = view.findViewById(R.id.passwordContainer);
scheme = (AppCompatSpinner) view.findViewById(R.id.scheme);
anonymous = (AppCompatCheckBox) view.findViewById(R.id.anonymous);
anonymous.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
usernameContainer.setVisibility(b ? View.GONE : View.VISIBLE);
passwordContainer.setVisibility(b ? View.GONE : View.VISIBLE);
}
});
if (connection_id != 0) {
NetworkConnection connection = NetworkConnection.fromConnectionId(getActivity(), connection_id);
ArrayAdapter myAdap = (ArrayAdapter) scheme.getAdapter();
int spinnerPosition = myAdap.getPosition(connection.getScheme().toUpperCase());
scheme.setSelection(spinnerPosition);
name.setText(connection.getName());
host.setText(connection.getHost());
port.setText(Integer.toString(connection.getPort()));
path.setText(connection.getPath());
username.setText(connection.getUserName());
password.setText(connection.getPassword());
anonymous.setChecked(connection.isAnonymousLogin());
if (SERVER.equals(connection.getType())) {
hostContainer.setVisibility(View.GONE);
pathContainer.setVisibility(View.VISIBLE);
}
}
builder.setTitle((connection_id == 0 ? "New" : "Edit") + " Connection");
builder.setView(view);
builder.setPositiveButton(connection_id == 0 ? "ADD" : "SAVE", new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final BaseActivity activity = (BaseActivity) getActivity();
NetworkConnection networkConnection = getNetworkConnection();
if (validate(networkConnection)) {
new CreateConnectionTask(activity, networkConnection).executeOnExecutor(ProviderExecutor.forAuthority(ExplorerProvider.AUTHORITY));
}
}
});
builder.setNegativeButton(android.R.string.cancel, null);
return builder.create();
}
Aggregations