use of com.auth0.sharelock.event.AllowedViewersModifiedEvent in project sharelock-android by auth0.
the class ComposeActivity method onEvent.
public void onEvent(AllowedViewersModifiedEvent event) {
secret.replaceAllowedViewers(event.getViewers());
final LinkFragment fragment = new LinkFragment();
Bundle arguments = new Bundle();
arguments.putParcelable(LinkFragment.LINK_FRAGMENT_SECRET_ARGUMENT, secret);
fragment.setArguments(arguments);
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("Link Step").commit();
bus.post(new RequestLinkEvent(secret));
}
use of com.auth0.sharelock.event.AllowedViewersModifiedEvent in project sharelock-android by auth0.
the class ShareFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
nextButton = (Button) view.findViewById(R.id.next_button);
shareField = (ShareEditText) view.findViewById(R.id.share_input);
shareField.setSplitChar(new char[] { ' ', ',' });
shareField.setTokenListener(new TokenCompleteTextView.TokenListener() {
@Override
public void onTokenAdded(Object o) {
nextButton.setVisibility(View.VISIBLE);
}
@Override
public void onTokenRemoved(Object o) {
nextButton.setVisibility(shareField.getObjects().size() > 0 ? View.VISIBLE : View.INVISIBLE);
}
});
nextButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bus.post(new AllowedViewersModifiedEvent(shareField.getObjects()));
}
});
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);
}
});
}
Aggregations