package io.openim.android.ouicontact.ui;


import android.os.Bundle;

import io.openim.android.ouicontact.databinding.ActivityGroupNoticeInviteDetailBinding;
import io.openim.android.ouicontact.vm.ContactVM;
import io.openim.android.ouicore.base.BaseActivity;

/**
 * 别人邀请加入群聊确认
 */
public class GroupNoticeInvitedDetailActivity extends BaseActivity<ContactVM, ActivityGroupNoticeInviteDetailBinding> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        bindVMByCache(ContactVM.class);
        super.onCreate(savedInstanceState);
        bindViewDataBinding(ActivityGroupNoticeInviteDetailBinding.inflate(getLayoutInflater()));
        sink();
        view.setContactVM(vm);

        initView();
    }

    private void initView() {
        view.avatar.load("", true);
        view.peopleCount.setText(vm.groupDetail.getValue().getMemberCount() + getString(io.openim.android.ouicore.R.string.people));
        view.info.setText(vm.groupDetail.getValue().getInviterUserID() + getString(io.openim.android.ouicore.R.string.invite) + vm.groupDetail.getValue().getNickname() + getString(io.openim.android.ouicore.R.string.join_group));
    }

    @Override
    public void onSuccess(Object body) {
        finish();
    }
}
