Search in sources :

Example 21 with CircleImageView

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();
}
Also used : CircleImageView(de.hdodenhof.circleimageview.CircleImageView) Bundle(android.os.Bundle) MenuItem(android.view.MenuItem) Intent(android.content.Intent) TextView(android.widget.TextView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View) TextView(android.widget.TextView) Toolbar(android.support.v7.widget.Toolbar)

Example 22 with CircleImageView

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;
}
Also used : SignedInUser(com.instructure.loginapi.login.model.SignedInUser) ImageView(android.widget.ImageView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) TextView(android.widget.TextView) View(android.view.View)

Example 23 with CircleImageView

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;
}
Also used : User(com.instructure.canvasapi.model.User) LayoutInflater(android.view.LayoutInflater) Activity(android.app.Activity) TextView(android.widget.TextView) View(android.view.View) CircleImageView(de.hdodenhof.circleimageview.CircleImageView)

Example 24 with CircleImageView

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);
    }
}
Also used : CircleImageView(de.hdodenhof.circleimageview.CircleImageView) AccountPainter(com.xabber.android.ui.color.AccountPainter) StatusMode(com.xabber.android.data.account.StatusMode) AccountItem(com.xabber.android.data.account.AccountItem) AccountJid(com.xabber.android.data.entity.AccountJid) FloatingActionButton(com.melnykov.fab.FloatingActionButton) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View)

Example 25 with CircleImageView

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);
}
Also used : CircleImageView(de.hdodenhof.circleimageview.CircleImageView) TextView(android.widget.TextView)

Aggregations

CircleImageView (de.hdodenhof.circleimageview.CircleImageView)30 View (android.view.View)27 TextView (android.widget.TextView)23 ImageView (android.widget.ImageView)13 ActionBar (android.support.v7.app.ActionBar)6 AdapterView (android.widget.AdapterView)6 ListView (android.widget.ListView)6 Intent (android.content.Intent)5 Bitmap (android.graphics.Bitmap)5 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)5 RecyclerView (android.support.v7.widget.RecyclerView)5 BmobUser (cn.bmob.v3.BmobUser)4 DescriptionAnimation (com.daimajia.slider.library.Animations.DescriptionAnimation)4 BaseSliderView (com.daimajia.slider.library.SliderTypes.BaseSliderView)4 User (com.nightonke.saver.model.User)4 CustomSliderView (com.nightonke.saver.ui.CustomSliderView)4 IntentFilter (android.content.IntentFilter)3 ColorDrawable (android.graphics.drawable.ColorDrawable)3 Handler (android.os.Handler)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3