Search in sources :

Example 1 with ViewTOS

use of com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS in project wire-android by wireapp.

the class PhoneInvitationFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_invite__phone, viewGroup, false);
    int buttonColor = getResources().getColor(R.color.text__primary_dark);
    TextView termsOfServicesTextView = ViewUtils.getView(view, R.id.tv__phone_invite__terms_of_service);
    TextViewUtils.linkifyText(termsOfServicesTextView, buttonColor, false, new Runnable() {

        @Override
        public void run() {
            getContainer().onOpenUrlInApp(getString(R.string.url_terms_of_service), true);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new ViewTOS(ViewTOS.Source.FROM_JOIN_PAGE));
        }
    });
    signUpAlternativeButton = ViewUtils.getView(view, R.id.zb__phone_invite__signup_alternative);
    signUpAlternativeButton.setIsFilled(false);
    signUpAlternativeButton.setAccentColor(getResources().getColor(R.color.text__secondary_dark__40));
    if (LayoutSpec.isPhone(getActivity())) {
        signUpAlternativeButton.setText(getString(R.string.invitation_phone__normal_phone_signup_button));
    } else {
        signUpAlternativeButton.setText(getString(R.string.invitation_phone__normal_email_signup_button));
    }
    headerTextView = ViewUtils.getView(view, R.id.ttv_phone_invite__header);
    headerTextView.setText(getResources().getString(R.string.invitation_email__welcome_header, name));
    registerButton = ViewUtils.getView(view, R.id.zb__first_launch__confirm);
    registerButton.setIsFilled(true);
    registerButton.setAccentColor(buttonColor);
    phoneNumberTextView = ViewUtils.getView(view, R.id.tet__phone_invite__number);
    phoneNumberTextView.setText(phone);
    return view;
}
Also used : BaseScalaActivity(com.waz.zclient.BaseScalaActivity) ViewTOS(com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 2 with ViewTOS

use of com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS in project wire-android by wireapp.

the class EmailInvitationFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_invite__email, viewGroup, false);
    int buttonColor = getResources().getColor(R.color.text__primary_dark);
    TextView termsOfServicesTextView = ViewUtils.getView(view, R.id.tv__email_invite__terms_of_service);
    TextViewUtils.linkifyText(termsOfServicesTextView, buttonColor, false, new Runnable() {

        @Override
        public void run() {
            if (getContainer() == null || getControllerFactory() == null || getControllerFactory().isTornDown()) {
                return;
            }
            getContainer().onOpenUrlInApp(getString(R.string.url_terms_of_service), true);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new ViewTOS(ViewTOS.Source.FROM_JOIN_PAGE));
        }
    });
    signUpAlternativeButton = ViewUtils.getView(view, R.id.zb__email_invite__signup_alternative);
    signUpAlternativeButton.setIsFilled(false);
    signUpAlternativeButton.setAccentColor(getResources().getColor(R.color.text__secondary_dark__40));
    if (LayoutSpec.isPhone(getActivity())) {
        signUpAlternativeButton.setText(getString(R.string.invitation_email__normal_phone_signup_button));
    } else {
        signUpAlternativeButton.setText(getString(R.string.invitation_email__normal_email_signup_button));
    }
    headerTextView = ViewUtils.getView(view, R.id.ttv_email_invite__header);
    headerTextView.setText(getResources().getString(R.string.invitation_email__welcome_header, name));
    messageTextView = ViewUtils.getView(view, R.id.ttv_email_invite__message);
    registerButton = ViewUtils.getView(view, R.id.zb__email_invite__register);
    registerButton.setIsFilled(true);
    registerButton.setAccentColor(buttonColor);
    registerButton.setEnabled(false);
    passwordEditText = ViewUtils.getView(view, R.id.tet__email_invite__password);
    passwordEditText.setHint(getResources().getString(R.string.invitation_email__password_placeholder, getResources().getInteger(R.integer.password_validator__min_password_length)));
    emailTextView = ViewUtils.getView(view, R.id.tet__email_invite__email);
    emailTextView.setText(email);
    view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {

        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
            int[] buttonLocation = new int[2];
            signUpAlternativeButton.getLocationOnScreen(buttonLocation);
            int[] headerLocation = new int[2];
            headerTextView.getLocationOnScreen(headerLocation);
            if (buttonLocation[1] + signUpAlternativeButton.getHeight() > headerLocation[1]) {
                headerTextView.setVisibility(View.INVISIBLE);
                messageTextView.setVisibility(View.INVISIBLE);
            } else {
                headerTextView.setVisibility(View.VISIBLE);
                messageTextView.setVisibility(View.VISIBLE);
            }
        }
    });
    return view;
}
Also used : BaseScalaActivity(com.waz.zclient.BaseScalaActivity) ViewTOS(com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView)

Example 3 with ViewTOS

use of com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS in project wire-android by wireapp.

the class PhoneRegisterFragment method onClick.

@Override
public void onClick(View view) {
    switch(view.getId()) {
        case R.id.tv__country_code:
        case R.id.ttv_new_reg__signup__phone__change_country:
            getContainer().openCountryBox();
            break;
        case R.id.pcb__signup:
            confirmPhoneNumber();
            break;
        case R.id.zb__welcome__sign_in:
            getStoreFactory().getAppEntryStore().setState(AppEntryState.EMAIL_SIGN_IN);
            break;
        case R.id.tv__welcome__terms_of_service:
            getContainer().onOpenUrlInApp(getString(R.string.url_terms_of_service), true);
            ((BaseScalaActivity) getActivity()).injectJava(GlobalTrackingController.class).tagEvent(new ViewTOS(ViewTOS.Source.FROM_JOIN_PAGE));
            break;
    }
}
Also used : GlobalTrackingController(com.waz.zclient.tracking.GlobalTrackingController) ViewTOS(com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS)

Aggregations

ViewTOS (com.waz.zclient.core.controllers.tracking.events.registration.ViewTOS)3 View (android.view.View)2 TextView (android.widget.TextView)2 BaseScalaActivity (com.waz.zclient.BaseScalaActivity)2 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)1