@Nullable @Override public View onCreateView( LayoutInflater inflater, @Nullable ViewGroup viewContainer, @Nullable Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_likes_list, viewContainer, false); toolbar = ViewUtils.getView(rootView, R.id.t__likes_list__toolbar); likersListView = ViewUtils.getView(rootView, R.id.rv__likes_list); likesAdapter = new LikesAdapter(); likersListView.setLayoutManager(new LinearLayoutManager(getActivity())); likersListView.setAdapter(likesAdapter); toolbar.setNavigationOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { getContainer().closeLikesList(); } }); Message likedMessage = getArguments().getParcelable(ARGUMENT_LIKED_MESSAGE); likesAdapter.setLikes(likedMessage.getLikes()); return rootView; }
public static int getCursorEditTextAnchorPosition(Context context, int width) { if (ViewUtils.isInPortrait(context)) { return (width - context.getResources().getDimensionPixelSize(R.dimen.cursor_desired_width)) / 2; } return context.getResources().getDimensionPixelSize(R.dimen.cursor_anchor2); }
public static int getCursorMenuLeftMargin(Context context, int totalWidth) { if (ViewUtils.isInPortrait(context)) { return getCursorEditTextAnchorPosition(context, totalWidth) - context.getResources().getDimensionPixelSize(R.dimen.new_cursor_menu_button_width) - context.getResources().getDimensionPixelSize(R.dimen.cursor_typing_left_margin); } return context.getResources().getDimensionPixelSize(R.dimen.cursor_typing_left_margin); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_notification, container, false); chatheadView = ViewUtils.getView(view, R.id.mncv__notifications__chathead); chatheadVisibleDuration = getResources().getInteger(R.integer.notification__chathead__show_duration); return view; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_otr_device_limit, container, false); view.setOnClickListener(this); logoutButton = ViewUtils.getView(view, R.id.zb__otr_device_limit__logout); logoutButton.setIsFilled(false); logoutButton.setAccentColor(getResources().getColor(R.color.text__primary_dark)); logoutButton.setOnClickListener(this); manageDevicesButton = ViewUtils.getView(view, R.id.zb__otr_device_limit__manage_devices); manageDevicesButton.setIsFilled(true); manageDevicesButton.setAccentColor(getResources().getColor(R.color.text__primary_dark)); manageDevicesButton.setOnClickListener(this); return view; }
public static int getMarginBetweenCursorButtons(Context context) { int margin; int cursorButtonWidth = context.getResources().getDimensionPixelSize(R.dimen.new_cursor_menu_button_width); if (LayoutSpec.isPhone(context)) { int paddingEdge = context .getResources() .getDimensionPixelSize(R.dimen.cursor_toolbar_padding_horizontal_edge); int total = ViewUtils.getOrientationIndependentDisplayWidth(context) - 2 * paddingEdge - cursorButtonWidth * NUM_CURSOR_ROW_BUTTONS; margin = total / (NUM_CURSOR_ROW_BUTTONS - 1); } else { margin = context.getResources().getDimensionPixelSize(R.dimen.cursor_toolbar_padding_item); } return margin; }
public void testGetListUnreadIndicatorRadiusesCount13() { int expectedRadius = ViewUtils.toPx(context, 6); int count = 13; assertEquals(expectedRadius, ConversationUtils.getListUnreadIndicatorRadiusPx(context, count)); }