Search in sources :

Example 1 with CircleImageView

use of com.hotbitmapgg.bilibili.widget.CircleImageView in project bilibili-android-client by HotBitmapGG.

the class MainActivity method initNavigationView.

/**
   * 初始化NavigationView
   */
private void initNavigationView() {
    mNavigationView.setNavigationItemSelectedListener(this);
    View headerView = mNavigationView.getHeaderView(0);
    CircleImageView mUserAvatarView = (CircleImageView) headerView.findViewById(R.id.user_avatar_view);
    TextView mUserName = (TextView) headerView.findViewById(R.id.user_name);
    TextView mUserSign = (TextView) headerView.findViewById(R.id.user_other_info);
    ImageView mSwitchMode = (ImageView) headerView.findViewById(R.id.iv_head_switch_mode);
    //设置头像
    mUserAvatarView.setImageResource(R.drawable.ic_hotbitmapgg_avatar);
    //设置用户名 签名
    mUserName.setText(getResources().getText(R.string.hotbitmapgg));
    mUserSign.setText(getResources().getText(R.string.about_user_head_layout));
    //设置日夜间模式切换
    mSwitchMode.setOnClickListener(v -> switchNightMode());
    boolean flag = PreferenceUtil.getBoolean(ConstantUtil.SWITCH_MODE_KEY, false);
    if (flag) {
        mSwitchMode.setImageResource(R.drawable.ic_switch_daily);
    } else {
        mSwitchMode.setImageResource(R.drawable.ic_switch_night);
    }
}
Also used : CircleImageView(com.hotbitmapgg.bilibili.widget.CircleImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) CircleImageView(com.hotbitmapgg.bilibili.widget.CircleImageView) NavigationView(android.support.design.widget.NavigationView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) CircleImageView(com.hotbitmapgg.bilibili.widget.CircleImageView)

Aggregations

NavigationView (android.support.design.widget.NavigationView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1 CircleImageView (com.hotbitmapgg.bilibili.widget.CircleImageView)1