use of com.applozic.mobicomkit.uiwidgets.uilistener.CustomToolbarListener in project Applozic-Android-SDK by AppLozic.
the class UserProfileFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.user_profile_fragment_layout, container, false);
name_cardView = (CardView) view.findViewById(R.id.applzoic_name_cardView);
email_cardView = (CardView) view.findViewById(R.id.applzoic_email_cardview);
status_cardView = (CardView) view.findViewById(R.id.applzoic_last_sean_status_cardView);
phone_cardView = (CardView) view.findViewById(R.id.applozic_user_phone_cardview);
name = (TextView) view.findViewById(R.id.userName);
status = (TextView) view.findViewById(R.id.applozic_user_status);
email = (TextView) view.findViewById(R.id.email);
phone = (TextView) view.findViewById(R.id.phone);
contactImage = (CircleImageView) view.findViewById(R.id.contactImage);
alphabeticTextView = (TextView) view.findViewById(R.id.alphabeticImage);
Bundle bundle = getArguments();
if (bundle != null) {
contact = (Contact) bundle.getSerializable(ConversationUIService.CONTACT);
contact = baseContactService.getContactById(contact.getContactIds());
((CustomToolbarListener) getActivity()).setToolbarTitle(contact.getDisplayName());
name.setText(contact.getDisplayName());
char firstLetter = contact.getDisplayName().toUpperCase().charAt(0);
String contactNumber = contact.getDisplayName().toUpperCase();
if (firstLetter != '+') {
alphabeticTextView.setText(String.valueOf(firstLetter));
} else if (contactNumber.length() >= 2) {
alphabeticTextView.setText(String.valueOf(contactNumber.charAt(1)));
}
Character colorKey = AlphaNumberColorUtil.alphabetBackgroundColorMap.containsKey(firstLetter) ? firstLetter : null;
GradientDrawable bgShape = (GradientDrawable) alphabeticTextView.getBackground();
bgShape.setColor(getActivity().getResources().getColor(AlphaNumberColorUtil.alphabetBackgroundColorMap.get(colorKey)));
if (contact.isDrawableResources()) {
int drawableResourceId = getResources().getIdentifier(contact.getrDrawableName(), "drawable", getActivity().getPackageName());
contactImage.setImageResource(drawableResourceId);
} else {
contactImageLoader.loadImage(contact, contactImage, alphabeticTextView);
}
name.setText(contact.getDisplayName());
if (!TextUtils.isEmpty(contact.getEmailId())) {
email_cardView.setVisibility(View.VISIBLE);
email.setText(contact.getEmailId());
}
if (!TextUtils.isEmpty(contact.getStatus())) {
status_cardView.setVisibility(View.VISIBLE);
status.setText(contact.getStatus());
}
if (!TextUtils.isEmpty(contact.getContactNumber())) {
phone_cardView.setVisibility(View.VISIBLE);
phone.setText(contact.getContactNumber());
} else {
phone_cardView.setVisibility(View.GONE);
}
}
return view;
}
use of com.applozic.mobicomkit.uiwidgets.uilistener.CustomToolbarListener in project Applozic-Android-SDK by AppLozic.
the class MobiComQuickConversationFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View list = inflater.inflate(R.layout.mobicom_message_list, container, false);
recyclerView = (RecyclerView) list.findViewById(R.id.messageList);
recyclerView.setBackgroundColor(getResources().getColor(R.color.conversation_list_all_background));
if (messageList != null && !messageList.contains(null)) {
messageList.add(null);
}
recyclerAdapter = new QuickConversationAdapter(getContext(), messageList, null);
recyclerAdapter.setAlCustomizationSettings(alCustomizationSettings);
linearLayoutManager = new AlLinearLayoutManager(getContext());
linearLayoutManager.setOrientation(AlLinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext());
recyclerView.addItemDecoration(dividerItemDecoration);
recyclerView.setAdapter(recyclerAdapter);
toolbar = (Toolbar) getActivity().findViewById(R.id.my_toolbar);
toolbar.setClickable(false);
fabButton = (ImageButton) list.findViewById(R.id.fab_start_new);
loading = true;
LinearLayout individualMessageSendLayout = (LinearLayout) list.findViewById(R.id.individual_message_send_layout);
LinearLayout extendedSendingOptionLayout = (LinearLayout) list.findViewById(R.id.extended_sending_option_layout);
individualMessageSendLayout.setVisibility(View.GONE);
extendedSendingOptionLayout.setVisibility(View.GONE);
emptyTextView = (TextView) list.findViewById(R.id.noConversations);
emptyTextView.setTextColor(Color.parseColor(alCustomizationSettings.getNoConversationLabelTextColor().trim()));
fabButton.setVisibility(alCustomizationSettings.isStartNewFloatingButton() ? View.VISIBLE : View.GONE);
swipeLayout = (SwipeRefreshLayout) list.findViewById(R.id.swipe_container);
swipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
recyclerView.setLongClickable(true);
registerForContextMenu(recyclerView);
((CustomToolbarListener) getActivity()).setToolbarTitle(ApplozicService.getContext(getContext()).getString(R.string.conversation));
return list;
}
Aggregations