Search in sources :

Example 1 with AllowedViewersModifiedEvent

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));
}
Also used : Bundle(android.os.Bundle) LinkFragment(com.auth0.sharelock.fragment.LinkFragment) RequestLinkEvent(com.auth0.sharelock.event.RequestLinkEvent)

Example 2 with AllowedViewersModifiedEvent

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);
        }
    });
}
Also used : AllowedViewersModifiedEvent(com.auth0.sharelock.event.AllowedViewersModifiedEvent) TokenCompleteTextView(com.tokenautocomplete.TokenCompleteTextView) Intent(android.content.Intent) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TokenCompleteTextView(com.tokenautocomplete.TokenCompleteTextView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 AllowedViewersModifiedEvent (com.auth0.sharelock.event.AllowedViewersModifiedEvent)1 RequestLinkEvent (com.auth0.sharelock.event.RequestLinkEvent)1 LinkFragment (com.auth0.sharelock.fragment.LinkFragment)1 TokenCompleteTextView (com.tokenautocomplete.TokenCompleteTextView)1