use of com.auth0.sharelock.event.NewSecretEvent in project sharelock-android by auth0.
the class SecretInputFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
secretField = (EditText) view.findViewById(R.id.secret_input);
nextButton = (Button) view.findViewById(R.id.next_button);
secretField.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
nextButton.setVisibility(s.length() > 0 ? View.VISIBLE : View.INVISIBLE);
SnackbarManager.dismiss();
}
});
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Secret secret = new Secret(secretField.getText().toString());
bus.post(new NewSecretEvent(secret));
}
});
ImageView craftedBy = (ImageView) view.findViewById(R.id.crafted_by);
craftedBy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(getString(R.string.crafted_by_url)));
startActivity(intent);
}
});
final Bundle arguments = getArguments();
if (arguments != null) {
secretField.setText(arguments.getString(SECRET_INPUT_FRAGMENT_SECRET_ARGUMENT));
}
}
use of com.auth0.sharelock.event.NewSecretEvent in project sharelock-android by auth0.
the class ComposeActivity method onEvent.
public void onEvent(NewSecretEvent event) {
secret = event.getSecret();
final ShareFragment fragment = new ShareFragment();
getSupportFragmentManager().beginTransaction().setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right, android.R.anim.slide_in_left, android.R.anim.slide_out_right).replace(R.id.sharelock_compose_container, fragment).addToBackStack("Share Step").commit();
}
Aggregations