use of de.hdodenhof.circleimageview.CircleImageView in project instructure-android by instructure.
the class StudentDetailsActivity method setupViews.
private void setupViews() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setNavigationIcon(R.drawable.ic_close_white);
toolbar.setNavigationContentDescription(R.string.close);
toolbar.setTitle(R.string.action_settings);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
toolbar.inflateMenu(R.menu.menu_student_details);
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.remove_student) {
if (!BuildConfig.IS_ROBO_TEST) {
Intent intent = new Intent(Intent.ACTION_DELETE);
Bundle extras = new Bundle();
extras.putParcelable(Const.STUDENT, getStudent());
intent.putExtras(extras);
setResult(RESULT_OK, intent);
finish();
return true;
}
}
return false;
}
});
CircleImageView avatar = (CircleImageView) findViewById(R.id.avatar);
TextView studentName = (TextView) findViewById(R.id.studentName);
Picasso.with(StudentDetailsActivity.this).load(getStudent().getAvatarUrl()).placeholder(R.drawable.ic_cv_user).error(R.drawable.ic_cv_user).fit().into(avatar);
studentName.setText(getStudent().getStudentName());
mGradeAbove = (TextView) findViewById(R.id.gradeAboveValue);
mGradeBelow = (TextView) findViewById(R.id.gradeBelowValue);
mAssignmentGradeAbove = (TextView) findViewById(R.id.assignmentGradeAboveValue);
mAssignmentGradeBelow = (TextView) findViewById(R.id.assignmentGradeBelowValue);
configureSwitches();
configureListeners();
}
use of de.hdodenhof.circleimageview.CircleImageView in project instructure-android by instructure.
the class PreviouslySignedInUserAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup viewGroup) {
final SignedInUser signedInUser = previouslySignedInUsers.get(position);
String globalID = OAuthWebLogin.getGlobalUserId(signedInUser.domain, signedInUser.user);
final ViewHolder viewHolder;
if (convertView == null) {
convertView = layoutInflater.inflate(R.layout.previously_signed_in_user, null);
viewHolder = new ViewHolder();
viewHolder.name = (TextView) convertView.findViewById(R.id.name);
viewHolder.domain = (TextView) convertView.findViewById(R.id.domain);
viewHolder.avatar = (CircleImageView) convertView.findViewById(R.id.avatar);
viewHolder.progressBar = (ProgressBar) convertView.findViewById(R.id.loading);
viewHolder.delete = (ImageView) convertView.findViewById(R.id.delete);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.delete.setImageDrawable(activity.getResources().getDrawable(R.drawable.ic_cv_login_x));
ProfileUtils.configureAvatarView(activity, signedInUser.user, viewHolder.avatar);
viewHolder.name.setText(signedInUser.user.getShortName());
viewHolder.domain.setText(signedInUser.domain);
if (selectedUserGlobalId == null) {
viewHolder.delete.setVisibility(View.VISIBLE);
} else {
viewHolder.delete.setVisibility(View.GONE);
}
// Handle deleting items.
viewHolder.delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Make sure they actually want to delete that user.
userToRemove = signedInUser;
genericDialogStyled = GenericDialogStyled.newInstance(R.string.removeUser, R.string.removedForever, R.string.confirm, R.string.cancel, R.drawable.ic_cv_information_light, PreviouslySignedInUserAdapter.this);
genericDialogStyled.show(activity.getSupportFragmentManager(), "Delete confirmation");
}
});
if (globalID.equals(selectedUserGlobalId)) {
viewHolder.progressBar.setVisibility(View.VISIBLE);
} else {
viewHolder.progressBar.setVisibility(View.GONE);
}
return convertView;
}
use of de.hdodenhof.circleimageview.CircleImageView in project instructure-android by instructure.
the class StudentGridAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
row = inflater.inflate(R.layout.student_notes_grid_item, parent, false);
holder = new StudentHolder();
holder.avatar = (CircleImageView) row.findViewById(R.id.avatar);
holder.studentName = (TextView) row.findViewById(R.id.studentName);
row.setTag(holder);
} else {
holder = (StudentHolder) row.getTag();
}
User user = users.get(position);
holder.studentName.setText(user.getName());
Picasso.with(context).load(user.getAvatarURL()).centerCrop().fit().into(holder.avatar);
return row;
}
use of de.hdodenhof.circleimageview.CircleImageView in project xabber-android by redsolution.
the class AccountActionButtonsAdapter method onChange.
@Override
public void onChange() {
Collections.sort(accounts);
for (int index = 0; index < accounts.size(); index++) {
View view = linearLayout.getChildAt(index);
final CircleImageView circleImageView = (CircleImageView) view.findViewById(R.id.account_avatar);
final AccountJid account = accounts.get(index);
circleImageView.setImageDrawable(AvatarManager.getInstance().getAccountAvatar(account));
FloatingActionButton backgroundActionButton = (FloatingActionButton) view.findViewById(R.id.fab);
final AccountPainter accountPainter = ColorManager.getInstance().getAccountPainter();
backgroundActionButton.setColorNormal(accountPainter.getAccountMainColor(account));
backgroundActionButton.setColorPressed(accountPainter.getAccountDarkColor(account));
backgroundActionButton.setColorRipple(accountPainter.getAccountRippleColor(account));
AccountJid selectedAccount = AccountManager.getInstance().getSelectedAccount();
int shadowVisibility;
if (selectedAccount == null) {
shadowVisibility = View.GONE;
} else {
shadowVisibility = View.VISIBLE;
if (selectedAccount.equals(account)) {
shadowVisibility = View.GONE;
}
}
view.findViewById(R.id.account_unselected_shadow).setVisibility(shadowVisibility);
int offlineShadowVisibility;
AccountItem accountItem = AccountManager.getInstance().getAccount(account);
StatusMode statusMode = null;
if (accountItem != null) {
statusMode = accountItem.getDisplayStatusMode();
}
if (statusMode != null && (statusMode == StatusMode.connection || statusMode == StatusMode.unavailable)) {
offlineShadowVisibility = View.VISIBLE;
} else {
offlineShadowVisibility = View.GONE;
}
view.findViewById(R.id.account_offline_shadow).setVisibility(offlineShadowVisibility);
}
}
use of de.hdodenhof.circleimageview.CircleImageView in project UniPool by divya21raj.
the class BaseActivity method setNavHeaderStuff.
protected void setNavHeaderStuff() {
TextView userNameOnHeader = findViewById(R.id.header_username);
userNameOnHeader.setText(finalCurrentUser.getName());
TextView emailOnHeader = findViewById(R.id.header_email);
emailOnHeader.setText(currentUser.getEmail());
CircleImageView userImageOnHeader = findViewById(R.id.header_userImage);
Picasso.get().load(currentUser.getPhotoUrl()).into(userImageOnHeader);
}
Aggregations