Search in sources :

Example 1 with ShieldView

use of com.waz.zclient.ui.views.e2ee.ShieldView in project wire-android by wireapp.

the class ConversationFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_conversation, viewGroup, false);
    extendedCursorContainer = ViewUtils.getView(view, R.id.ecc__conversation);
    containerPreview = ViewUtils.getView(view, R.id.fl__conversation_overlay);
    cursorLayout = ViewUtils.getView(view, R.id.cl__cursor);
    // TODO: remove that once cursorLayout is reimplemented in scala
    new EditActionSupport((WireContext) getActivity(), cursorLayout);
    audioMessageRecordingView = ViewUtils.getView(view, R.id.amrv_audio_message_recording);
    toolbar = ViewUtils.getView(view, R.id.t_conversation_toolbar);
    leftMenu = ViewUtils.getView(view, R.id.conversation_left_menu);
    toolbarTitle = ViewUtils.getView(toolbar, R.id.tv__conversation_toolbar__title);
    shieldView = ViewUtils.getView(view, R.id.sv__conversation_toolbar__verified_shield);
    shieldView.setVisibility(View.GONE);
    typingIndicatorView = ViewUtils.getView(view, R.id.tiv_typing_indicator_view);
    typingIndicatorView.setCallback(this);
    listView = ViewUtils.getView(view, R.id.messages_list_view);
    toolbar.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            getControllerFactory().getConversationScreenController().showParticipants(toolbar, false);
        }
    });
    toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            switch(item.getItemId()) {
                case R.id.action_audio_call:
                    getControllerFactory().getCallingController().startCall(false);
                    cursorLayout.closeEditMessage(false);
                    return true;
                case R.id.action_video_call:
                    getControllerFactory().getCallingController().startCall(true);
                    cursorLayout.closeEditMessage(false);
                    return true;
            }
            return false;
        }
    });
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (LayoutSpec.isTablet(getContext()) && ViewUtils.isInLandscape(getContext())) {
                return;
            }
            cursorLayout.closeEditMessage(false);
            getActivity().onBackPressed();
            KeyboardUtils.closeKeyboardIfShown(getActivity());
        }
    });
    leftMenu.setOnMenuItemClickListener(new ActionMenuView.OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            switch(item.getItemId()) {
                case R.id.action_collection:
                    getCollectionController().openCollection();
                    return true;
            }
            return false;
        }
    });
    if (LayoutSpec.isTablet(getContext()) && ViewUtils.isInLandscape(getContext())) {
        toolbar.setNavigationIcon(null);
    }
    conversationLoadingIndicatorViewView = ViewUtils.getView(view, R.id.lbv__conversation__loading_indicator);
    if (BuildConfig.SHOW_MENTIONING) {
        getChildFragmentManager().beginTransaction().add(R.id.fl__conversation_overlay, MentioningFragment.getInstance(), MentioningFragment.TAG).commit();
    }
    // invisible footer to scroll over inputfield
    invisibleFooter = new FrameLayout(getActivity());
    AbsListView.LayoutParams params = new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.cursor__list_view_footer__height));
    invisibleFooter.setLayoutParams(params);
    cursorLayout.showSendButton(false);
    // Recording audio messages
    audioMessageRecordingView.setCallback(this);
    if (LayoutSpec.isTablet(getActivity())) {
        view.setBackgroundColor(Color.WHITE);
    }
    if (savedInstanceState != null) {
        isPreviewShown = savedInstanceState.getBoolean(SAVED_STATE_PREVIEW, false);
    }
    return view;
}
Also used : AbsListView(android.widget.AbsListView) CursorMenuItem(com.waz.zclient.ui.cursor.CursorMenuItem) MenuItem(android.view.MenuItem) ShieldView(com.waz.zclient.ui.views.e2ee.ShieldView) AudioMessageRecordingView(com.waz.zclient.ui.audiomessage.AudioMessageRecordingView) LoadingIndicatorView(com.waz.zclient.views.LoadingIndicatorView) MessagesListView(com.waz.zclient.messages.MessagesListView) View(android.view.View) TextView(android.widget.TextView) TypingIndicatorView(com.waz.zclient.pages.main.conversation.views.TypingIndicatorView) AbsListView(android.widget.AbsListView) ActionMenuView(android.support.v7.widget.ActionMenuView) FrameLayout(android.widget.FrameLayout) ActionMenuView(android.support.v7.widget.ActionMenuView) EditActionSupport(com.waz.zclient.messages.controllers.EditActionSupport) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with ShieldView

use of com.waz.zclient.ui.views.e2ee.ShieldView in project wire-android by wireapp.

the class SingleParticipantFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_participants_single, viewGroup, false);
    Toolbar toolbar = ViewUtils.getView(view, R.id.t__single_participant__toolbar);
    shieldView = ViewUtils.getView(view, R.id.sv__otr__verified_shield);
    shieldView.setVisibility(View.GONE);
    Bundle args = getArguments();
    IConnectStore.UserRequester requester = null;
    if (args != null) {
        requester = (IConnectStore.UserRequester) args.getSerializable(ARGUMENT_USER_REQUESTER);
    }
    header = ViewUtils.getView(view, R.id.tv__single_participant__toolbar__title);
    userDetailsView = ViewUtils.getView(view, R.id.udv__single_participant__user_details);
    footerMenu = ViewUtils.getView(view, R.id.upm__footer);
    imageAssetImageViewProfile = ViewUtils.getView(view, R.id.iaiv__single_participant);
    imageAssetImageViewProfile.setDisplayType(ImageAssetImageView.DisplayType.CIRCLE);
    if (requester == IConnectStore.UserRequester.PARTICIPANTS) {
        footerMenu.setVisibility(View.GONE);
        imageAssetImageViewProfile.setVisibility(View.GONE);
        getChildFragmentManager().beginTransaction().add(R.id.fl__participant__tab__container, TabbedParticipantBodyFragment.newInstance(TabbedParticipantBodyFragment.USER_PAGE), TabbedParticipantBodyFragment.TAG).commit();
        // Posting so that we can get height after onMeasure has been called
        view.post(new Runnable() {

            @Override
            public void run() {
                View header = ViewUtils.getView(view, R.id.ll__single_participant__header_container);
                View tabContainer = ViewUtils.getView(view, R.id.fl__participant__tab__container);
                if (header == null || tabContainer == null) {
                    return;
                }
                int height = header.getHeight();
                tabContainer.setPadding(0, height, 0, 0);
            }
        });
    }
    View backgroundContainer = ViewUtils.getView(view, R.id.fl__send_connect_request__background_container);
    if ((LayoutSpec.isPhone(getActivity()) && getControllerFactory().getNavigationController().getPagerPosition() == NavigationController.FIRST_PAGE) || (getControllerFactory().getConversationScreenController().getPopoverLaunchMode() == DialogLaunchMode.AVATAR || getControllerFactory().getConversationScreenController().getPopoverLaunchMode() == DialogLaunchMode.COMMON_USER)) {
        backgroundContainer.setClickable(true);
    } else {
        backgroundContainer.setBackgroundColor(Color.TRANSPARENT);
    }
    if (ThemeUtils.isDarkTheme(getContext())) {
        toolbar.setNavigationIcon(R.drawable.action_back_light);
    } else {
        toolbar.setNavigationIcon(R.drawable.action_back_dark);
    }
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            getContainer().dismissSingleUserProfile();
        }
    });
    // Hide footer until user is loaded
    footerMenu.setVisibility(View.GONE);
    if (savedInstanceState == null) {
        otherUserProfileScreenWasTracked = false;
    } else {
        otherUserProfileScreenWasTracked = savedInstanceState.getBoolean(SAVE_STATE_OTHER_USER_PROFILE_SCREEN_WAS_TRACKED);
    }
    return view;
}
Also used : IConnectStore(com.waz.zclient.core.stores.connect.IConnectStore) Bundle(android.os.Bundle) ImageAssetImageView(com.waz.zclient.views.images.ImageAssetImageView) ShieldView(com.waz.zclient.ui.views.e2ee.ShieldView) View(android.view.View) UserDetailsView(com.waz.zclient.ui.views.UserDetailsView) TextView(android.widget.TextView) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with ShieldView

use of com.waz.zclient.ui.views.e2ee.ShieldView in project wire-android by wireapp.

the class ParticipantHeaderFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_participants_header, container, false);
    toolbar = ViewUtils.getView(rootView, R.id.t__participants__toolbar);
    membersCountTextView = ViewUtils.getView(rootView, R.id.ttv__participants__sub_header);
    userDetailsView = ViewUtils.getView(rootView, R.id.udv__participants__user_details);
    headerReadOnlyTextView = ViewUtils.getView(rootView, R.id.ttv__participants__header);
    headerEditText = ViewUtils.getView(rootView, R.id.taet__participants__header__editable);
    bottomBorder = ViewUtils.getView(rootView, R.id.v_participants__header__bottom_border);
    shieldView = ViewUtils.getView(rootView, R.id.sv__otr__verified_shield);
    shieldView.setVisibility(View.GONE);
    penIcon = ViewUtils.getView(rootView, R.id.gtv__participants_header__pen_icon);
    penIcon.setVisibility(View.GONE);
    membersCountTextView.setVisibility(View.GONE);
    userDetailsView.setVisibility(View.GONE);
    headerEditText.setOnTouchListener(headerOnTouchListener);
    headerEditText.setOnEditorActionListener(editorActionListener);
    // Hide bottom border initially
    bottomBorder.setVisibility(View.GONE);
    if (LayoutSpec.isTablet(getContext())) {
        toolbar.setNavigationIcon(null);
        toolbar.setContentInsetsAbsolute(toolbar.getContentInsetEnd(), getResources().getDimensionPixelSize(R.dimen.content__padding_left));
    } else {
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                if (userRequester == IConnectStore.UserRequester.POPOVER) {
                    getContainer().dismissDialog();
                } else {
                    getControllerFactory().getConversationScreenController().hideParticipants(true, false);
                }
            }
        });
    }
    return rootView;
}
Also used : ShieldView(com.waz.zclient.ui.views.e2ee.ShieldView) View(android.view.View) UserDetailsView(com.waz.zclient.ui.views.UserDetailsView) TextView(android.widget.TextView)

Example 4 with ShieldView

use of com.waz.zclient.ui.views.e2ee.ShieldView in project wire-android by wireapp.

the class DevicePreference method onBindViewHolder.

@Override
@SuppressLint("com.waz.ViewUtils")
public void onBindViewHolder(PreferenceViewHolder holder) {
    super.onBindViewHolder(holder);
    ShieldView shieldView = (ShieldView) holder.findViewById(R.id.sv__pref__device);
    shieldView.setVerified(isVerified);
}
Also used : ShieldView(com.waz.zclient.ui.views.e2ee.ShieldView) SuppressLint(android.annotation.SuppressLint)

Aggregations

ShieldView (com.waz.zclient.ui.views.e2ee.ShieldView)4 View (android.view.View)3 TextView (android.widget.TextView)3 Toolbar (android.support.v7.widget.Toolbar)2 UserDetailsView (com.waz.zclient.ui.views.UserDetailsView)2 SuppressLint (android.annotation.SuppressLint)1 Bundle (android.os.Bundle)1 ActionMenuView (android.support.v7.widget.ActionMenuView)1 MenuItem (android.view.MenuItem)1 AbsListView (android.widget.AbsListView)1 FrameLayout (android.widget.FrameLayout)1 IConnectStore (com.waz.zclient.core.stores.connect.IConnectStore)1 MessagesListView (com.waz.zclient.messages.MessagesListView)1 EditActionSupport (com.waz.zclient.messages.controllers.EditActionSupport)1 TypingIndicatorView (com.waz.zclient.pages.main.conversation.views.TypingIndicatorView)1 AudioMessageRecordingView (com.waz.zclient.ui.audiomessage.AudioMessageRecordingView)1 CursorMenuItem (com.waz.zclient.ui.cursor.CursorMenuItem)1 LoadingIndicatorView (com.waz.zclient.views.LoadingIndicatorView)1 ImageAssetImageView (com.waz.zclient.views.images.ImageAssetImageView)1