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;
}
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;
}
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;
}
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);
}
Aggregations