这里先搭建viewpage+BottomNavigationView+Fragment的底部导航栏

activity_tabhost.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:layout_above="@+id/bnv_viewpager"><RelativeLayoutandroid:layout_width="fill_parent"android:layout_height="44dp"android:background="@color/deepskyblue"android:orientation="horizontal"><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="fill_parent"android:layout_alignParentStart="true"android:gravity="center_vertical"><TextViewandroid:id="@+id/tv_title"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginStart="20dp"android:textColor="@color/white"android:textSize="20sp" /></LinearLayout><ImageViewandroid:id="@+id/iv_add"android:layout_width="20dp"android:layout_height="20dp"android:layout_alignParentEnd="true"android:layout_marginTop="12dp"android:layout_marginEnd="20dp"android:contentDescription="@string/tv_icon"android:src="@drawable/add" /><ImageViewandroid:id="@+id/iv_search"android:layout_width="20dp"android:layout_height="20dp"android:layout_marginTop="12dp"android:layout_marginEnd="20dp"android:layout_toStartOf="@id/iv_add"android:src="@drawable/search" /></RelativeLayout><android.support.v4.view.ViewPagerandroid:id="@+id/vp_viewpager"android:layout_width="match_parent"android:layout_height="0dp"android:layout_weight="1"/></LinearLayout><android.support.design.widget.BottomNavigationViewandroid:id="@+id/bnv_viewpager"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:background="@color/lightgrey"app:itemTextColor="@drawable/color_navigation_selector"app:menu="@menu/navigation" />
</RelativeLayout>

fragment_friends.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".friend.FriendsFragment"><com.scwang.smartrefresh.layout.SmartRefreshLayoutandroid:id="@+id/srl_refresh_layout"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.v7.widget.RecyclerViewandroid:id="@+id/rv_friends"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_marginTop="10dp" /></com.scwang.smartrefresh.layout.SmartRefreshLayout></FrameLayout>

fragment_message.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".message.MessageFragment"><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:text="@string/hello_blank_fragment" /></FrameLayout>

fragment_mine.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".message.MessageFragment"><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:text="@string/hello_blank_fragment" /></FrameLayout>

ViewPagerFragmentAdapter

package heath.com.chat.adapter;import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;public class ViewPagerFragmentAdapter extends FragmentPagerAdapter {private Fragment[] fragments;public ViewPagerFragmentAdapter(FragmentManager fm, Fragment[] fragments) {super(fm);this.fragments=fragments;}@Overridepublic Fragment getItem(int position) {return fragments[position];}@Overridepublic int getCount() {return fragments.length;}
}


TabHostActivity

package heath.com.chat;import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;import heath.com.chat.adapter.ViewPagerFragmentAdapter;
import heath.com.chat.friend.AddFriendsActivity;
import heath.com.chat.friend.FriendsFragment;
import heath.com.chat.message.MessageFragment;
import heath.com.chat.mine.MineFragment;public class TabHostActivity extends BaseActivity implements View.OnClickListener {private ImageView mIvAdd;private BottomNavigationView navigationView;private ViewPager viewPager;private Fragment[] fragments;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_tabhost);//初始化控件initView();initListener();//将各个fragment加入到fragments中addFragment();//将viewPager和BottomNavigationView的选择事件连接起来link();//设置viewPager的适配器ViewPagerFragmentAdapter adapter = new ViewPagerFragmentAdapter(getSupportFragmentManager(), fragments);viewPager.setAdapter(adapter);//设置初始的页面项navigationView.setSelectedItemId(R.id.navigation_message);}/*** 初始化控件*/private void initView() {mIvAdd = this.findViewById(R.id.iv_add);navigationView = this.findViewById(R.id.bnv_viewpager);viewPager = this.findViewById(R.id.vp_viewpager);//将控件默认的图标隐藏,以显示自定义的按钮图标navigationView.setItemIconTintList(null);}private void initListener() {mIvAdd.setOnClickListener(this);}/*** 填充fragments*/private void addFragment() {fragments = new Fragment[]{new MessageFragment(),new FriendsFragment(),new MineFragment()};}/*** 将viewPager和BottomNavigationView的事件连接起来* 分为两步* 1.给viewPager添加监听事件,即viewPager的页面变化时,navigation的选中项跟随变化* 2.给navigation添加监听事件,即当navigation的选中项变化时,viewPager的页面跟随变化*/private void link() {//给viewPager设置监听事件,使viewPager页面变化时BottomNavigationView的item跟随其变化viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {//以下三个方法是需要重写的父类方法@Overridepublic void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {////当页面滑动,即当前页面滑动时调用}@Overridepublic void onPageSelected(int position) {//当viewpager选定(滑动)后调用switch (position) {case 0:navigationView.setSelectedItemId(R.id.navigation_message);break;case 1:navigationView.setSelectedItemId(R.id.navigation_friends);break;case 2:navigationView.setSelectedItemId(R.id.navigation_mine);break;}}@Overridepublic void onPageScrollStateChanged(int state) {//当滚动状态发生变化时,比如从滚动变到不滚动时调用}});//配置viewPager的页面随navigation的选中项变化navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {@Overridepublic boolean onNavigationItemSelected(@NonNull MenuItem item) {//每次点击后都将所有图标重置到默认不选中图片resetToDefaultIcon();switch (item.getItemId()) {case R.id.navigation_message:viewPager.setCurrentItem(0);//设置按钮的图标item.setIcon(R.drawable.select_message);return true;case R.id.navigation_friends:viewPager.setCurrentItem(1);//设置按钮的图标item.setIcon(R.drawable.select_friends);return true;case R.id.navigation_mine:viewPager.setCurrentItem(2);//设置按钮的图标item.setIcon(R.drawable.select_mine);return true;}return false;}});}/*** 重置按钮的图片为未选中的图标*/private void resetToDefaultIcon() {navigationView.getMenu().findItem(R.id.navigation_message).setIcon(R.drawable.unselect_message);navigationView.getMenu().findItem(R.id.navigation_friends).setIcon(R.drawable.unselect_friends);navigationView.getMenu().findItem(R.id.navigation_mine).setIcon(R.drawable.unselect_mine);}@Overridepublic void onClick(View v) {switch (v.getId()) {case R.id.iv_add:startActivity(new Intent(TabHostActivity.this, AddFriendsActivity.class));break;default:break;}}
}

FriendsFragment

package heath.com.chat.friend;import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.friend.FriendService;
import com.netease.nimlib.sdk.uinfo.UserService;
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
import com.netease.nimlib.sdk.uinfo.model.UserInfo;import java.util.HashMap;
import java.util.List;import heath.com.chat.R;
import heath.com.chat.adapter.FriendAdapter;public class FriendsFragment extends Fragment {private RecyclerView mRvFriends;private FriendAdapter friendAdapter;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fragment_friends, container,false);initView(view);init();return view;}private void initView(View view) {mRvFriends = view.findViewById(R.id.rv_friends);}private void init(){List<String> friends = NIMClient.getService(FriendService.class).getFriendAccounts();NIMClient.getService(UserService.class).fetchUserInfo(friends).setCallback(new RequestCallback<List<NimUserInfo>>() {@Overridepublic void onSuccess(List<NimUserInfo> param) {if (param.size()>0){friendAdapter = new FriendAdapter(getActivity(), param);mRvFriends.setAdapter(friendAdapter);LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);mRvFriends.setLayoutManager(linearLayoutManager);mRvFriends.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));friendAdapter.setOnItemClickListener(new FriendAdapter.OnItemClickListener() {@Overridepublic void onItemClick(View view, int position) {NimUserInfo nimUserInfo = param.get(position);Intent intent = new Intent(getActivity(),FriendInfoActivity.class);intent.putExtra("nimUserInfo", nimUserInfo);startActivityForResult(intent, 0);}});}}@Overridepublic void onFailed(int code) {}@Overridepublic void onException(Throwable exception) {}});}
}

MessageFragment

package heath.com.chat.message;import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;import heath.com.chat.R;public class MessageFragment extends Fragment {@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fragment_message, container,false);return view;}
}

MineFragment

package heath.com.chat.mine;import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;import heath.com.chat.R;public class MineFragment extends Fragment {@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {View view = inflater.inflate(R.layout.fragment_mine, container,false);return view;}
}

在res文件夹下创建一个menu的文件夹,里面放navigation.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:id="@+id/navigation_message"android:icon="@drawable/unselect_message"android:title="@string/tv_message" /><itemandroid:id="@+id/navigation_friends"android:icon="@drawable/unselect_friends"android:title="@string/tv_friend" /><itemandroid:id="@+id/navigation_mine"android:icon="@drawable/unselect_mine"android:title="@string/tv_mine" />
</menu>

在drawable创建color_navigation_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"><item android:color="@color/deepskyblue" android:state_checked="true" /><item android:color="@color/gainsboro" android:state_checked="false" />
</selector>

这是底部导航栏样式

接下来,我们开始写好友搜索

activity_add_friends.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout  xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_horizontal"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="44dp"android:orientation="horizontal"android:gravity="center_vertical"android:background="@color/deepskyblue"><LinearLayoutandroid:id="@+id/ll_return"android:layout_width="44sp"android:layout_height="44sp"android:gravity="center_vertical"><ImageViewandroid:layout_width="24sp"android:layout_height="24sp"android:src="@drawable/return1"android:layout_marginStart="20dp"android:contentDescription="@string/tv_icon_des"/></LinearLayout><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/tv_add_friends"android:textColor="@color/white"android:textSize="20sp"android:layout_marginStart="20dp"/></LinearLayout><SearchViewandroid:id="@+id/sv_search_friends"android:layout_width="match_parent"android:layout_height="40dp"android:iconifiedByDefault="false"android:queryBackground="@null"android:submitBackground="@null"android:background="@drawable/searchview_line"></SearchView><TextViewandroid:id="@+id/tv_result"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginTop="10dp"/></LinearLayout><RelativeLayoutandroid:id="@+id/rl_loading"android:layout_width="150dp"android:layout_height="150dp"android:layout_gravity="center"android:background="@drawable/shape_label_clarity_black"><com.github.ybq.android.spinkit.SpinKitViewxmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/pb_loading"style="@style/SpinKitView.Large.Circle"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"app:SpinKit_Color="@color/white" /><TextViewandroid:id="@+id/tv_loading_text"android:layout_below="@id/pb_loading"android:layout_centerHorizontal="true"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textColor="@color/white"/></RelativeLayout></FrameLayout>

AddFriendsActivity

package heath.com.chat.friend;import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.SearchView;
import android.widget.TextView;import com.google.gson.Gson;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.uinfo.UserService;
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;import java.util.ArrayList;
import java.util.List;
import java.util.Map;import heath.com.chat.BaseActivity;
import heath.com.chat.R;
import heath.com.chat.utils.LoadingUtils;public class AddFriendsActivity extends BaseActivity implements View.OnClickListener {private String TAG = "friend";private SearchView mSvSearchFriends;private LinearLayout mLlReturn;private TextView mTvResult;private LoadingUtils loadingUtils;final ArrayList<Map<String, Object>> listdata = new ArrayList<>();private Gson gson;@Overrideprotected void onCreate(@Nullable Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_add_friends);initView();init();initListener();}private void initView() {mSvSearchFriends = this.findViewById(R.id.sv_search_friends);mLlReturn = this.findViewById(R.id.ll_return);mTvResult = this.findViewById(R.id.tv_result);gson = new Gson();loadingUtils = new LoadingUtils(AddFriendsActivity.this, "正在搜索");}private void init() {loadingUtils.creat();}private void initListener() {mLlReturn.setOnClickListener(this);mSvSearchFriends.setSubmitButtonEnabled(false);mSvSearchFriends.setQueryHint("查找好友");mSvSearchFriends.setOnQueryTextListener(new SearchView.OnQueryTextListener() {@Overridepublic boolean onQueryTextSubmit(String account) {listdata.clear();loadingUtils.show();loadFriend(account);return false;}@Overridepublic boolean onQueryTextChange(String s) {return false;}});}@Overridepublic void onClick(View view) {switch (view.getId()) {case R.id.ll_return:finish();break;default:break;}}private void loadFriend(final String account) {List<String> accounts = new ArrayList<>();accounts.add(account);NIMClient.getService(UserService.class).fetchUserInfo(accounts).setCallback(new RequestCallback<List<NimUserInfo>>() {@Overridepublic void onSuccess(List<NimUserInfo> param) {loadingUtils.dismiss();if (param.size() > 0) {Log.i(TAG, "loadFriend: " + param.get(0).getAccount());Intent intent = new Intent(AddFriendsActivity.this,FriendInfoActivity.class);intent.putExtra("nimUserInfo", param.get(0));startActivityForResult(intent, 0);} else {mTvResult.setText("未搜索到用户");}}@Overridepublic void onFailed(int code) {Log.i(TAG, "code: " + code);loadingUtils.dismiss();}@Overridepublic void onException(Throwable exception) {loadingUtils.dismiss();}});}}

好友信息展示

activity_friend_info.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:background="@color/lightgrey"android:orientation="vertical"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="44dp"android:background="@color/deepskyblue"android:gravity="center_vertical"android:orientation="horizontal"><LinearLayoutandroid:id="@+id/ll_return"android:layout_width="44sp"android:layout_height="44sp"android:gravity="center_vertical"><ImageViewandroid:layout_width="24sp"android:layout_height="24sp"android:layout_marginStart="20dp"android:contentDescription="@string/tv_icon_des"android:src="@drawable/return1" /></LinearLayout></RelativeLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="80dp"android:layout_marginTop="20dp"android:background="@color/white"android:gravity="center_vertical"android:orientation="horizontal"><ImageViewandroid:id="@+id/iv_head_photo"android:layout_width="60dp"android:layout_height="60dp"android:layout_marginStart="10dp"android:layout_marginEnd="10dp"android:contentDescription="@string/tv_icon_des"android:src="@drawable/test" /><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="60dp"android:layout_gravity="center_vertical"android:orientation="vertical"><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="30dp"android:layout_gravity="center_vertical"android:orientation="horizontal"><TextViewandroid:id="@+id/tv_nickname"android:layout_width="wrap_content"android:layout_height="fill_parent"android:gravity="center_vertical"android:textColor="@color/black" /><ImageViewandroid:id="@+id/iv_sex"android:layout_width="16dp"android:layout_height="16dp"android:layout_marginStart="10dp"android:layout_marginEnd="10dp"android:layout_marginTop="7dp"android:contentDescription="@string/tv_icon_des"android:src="@drawable/girl" /></LinearLayout><TextViewandroid:id="@+id/tv_address"android:layout_width="wrap_content"android:layout_height="30dp"android:gravity="center_vertical"android:textColor="@color/grey" /></LinearLayout></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="40dp"android:background="@color/white"android:orientation="horizontal"android:layout_marginTop="1dp"android:gravity="center_vertical"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginStart="10dp"android:text="@string/tv_sign"android:textColor="@color/black2"/><TextViewandroid:id="@+id/tv_sign"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginStart="10dp"android:text="@string/tv_unfilled"android:textColor="@color/grey"/></LinearLayout><Buttonandroid:id="@+id/btn_add_friend"android:layout_width="match_parent"android:layout_height="50dp"android:background="@color/white"android:layout_marginTop="10dp"android:text="@string/tv_add_friend"android:textColor="@color/deepskyblue"/><Buttonandroid:id="@+id/btn_send_message"android:layout_width="match_parent"android:layout_height="50dp"android:background="@color/white"android:layout_marginTop="10dp"android:text="@string/btn_send_message"android:textColor="@color/deepskyblue"/></LinearLayout><RelativeLayoutandroid:id="@+id/rl_loading"android:layout_width="150dp"android:layout_height="150dp"android:layout_gravity="center"android:background="@drawable/shape_label_clarity_black"><com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/pb_loading"style="@style/SpinKitView.Large.Circle"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"app:SpinKit_Color="@color/white" /><TextViewandroid:id="@+id/tv_loading_text"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/pb_loading"android:layout_centerHorizontal="true"android:textColor="@color/white" /></RelativeLayout></FrameLayout>

FriendInfoActivity

package heath.com.chat.friend;import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;import com.flyco.animation.BaseAnimatorSet;
import com.flyco.animation.BounceEnter.BounceTopEnter;
import com.flyco.animation.SlideExit.SlideBottomExit;
import com.flyco.dialog.listener.OnBtnClickL;
import com.flyco.dialog.widget.NormalDialog;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.friend.FriendService;
import com.netease.nimlib.sdk.friend.constant.VerifyType;
import com.netease.nimlib.sdk.friend.model.AddFriendData;
import com.netease.nimlib.sdk.uinfo.constant.GenderEnum;
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;import org.json.JSONObject;import java.util.HashMap;
import java.util.Map;import heath.com.chat.BaseActivity;
import heath.com.chat.LoginActivity;
import heath.com.chat.OKhttp.IHttpClient;
import heath.com.chat.OKhttp.IRequest;
import heath.com.chat.OKhttp.IResponse;
import heath.com.chat.OKhttp.impl.OkHttpClientImpl;
import heath.com.chat.OKhttp.impl.RequestImpl;
import heath.com.chat.R;
import heath.com.chat.utils.Common;
import heath.com.chat.utils.LoadingUtils;
import heath.com.chat.utils.ThreadUtils;public class FriendInfoActivity extends BaseActivity implements View.OnClickListener {private LinearLayout mLlReturn;private ImageView mIvHeadPhoto;private TextView mTvNickname;private ImageView mIvSex;private TextView mTvAddress;private TextView mTvSign;private Button mBtnAddFriend;private Button mBtnSendMessage;private NimUserInfo nimUserInfo;protected LoadingUtils loadingUtils;private BaseAnimatorSet mBasIn;private BaseAnimatorSet mBasOut;private LoginInfo loginInfo;private String TAG = "friend";@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_friend_info);initView();initListener();init();}private void initView() {mLlReturn = this.findViewById(R.id.ll_return);mIvHeadPhoto = this.findViewById(R.id.iv_head_photo);mTvNickname = this.findViewById(R.id.tv_nickname);mIvSex = this.findViewById(R.id.iv_sex);mTvAddress = this.findViewById(R.id.tv_address);mTvSign = this.findViewById(R.id.tv_sign);mBtnAddFriend = this.findViewById(R.id.btn_add_friend);mBtnSendMessage = this.findViewById(R.id.btn_send_message);}private void initListener() {mBtnAddFriend.setOnClickListener(this);mBtnSendMessage.setOnClickListener(this);mLlReturn.setOnClickListener(this);}private void init() {Intent intent = getIntent();nimUserInfo = (NimUserInfo) intent.getSerializableExtra("nimUserInfo");loginInfo = (LoginInfo) aCache.getAsObject("loginInfo");loadingUtils = new LoadingUtils(FriendInfoActivity.this, "添加好友...");mBasIn = new BounceTopEnter();mBasOut = new SlideBottomExit();loadingUtils.creat();if (nimUserInfo.getAccount().equals(loginInfo.getAccount())){mBtnAddFriend.setVisibility(View.GONE);mBtnSendMessage.setVisibility(View.GONE);}else{boolean isMyFriend = NIMClient.getService(FriendService.class).isMyFriend(nimUserInfo.getAccount());Log.i(TAG, "isMyFriend: "+isMyFriend);if (isMyFriend) {mBtnAddFriend.setVisibility(View.GONE);mBtnSendMessage.setVisibility(View.VISIBLE);}else {mBtnAddFriend.setVisibility(View.VISIBLE);mBtnSendMessage.setVisibility(View.GONE);}}if (nimUserInfo.getName() != null) {mTvNickname.setText(nimUserInfo.getName());}if (nimUserInfo.getSignature() != null) {mTvSign.setText(nimUserInfo.getSignature());}GenderEnum genderEnum = nimUserInfo.getGenderEnum();switch (genderEnum) {case MALE:mIvSex.setImageResource(R.drawable.boy);break;case FEMALE:mIvSex.setImageResource(R.drawable.girl);break;case UNKNOWN:mIvSex.setImageResource(R.drawable.unknown);break;default:mIvSex.setImageResource(R.drawable.unknown);break;}}@Overridepublic void onClick(View v) {switch (v.getId()) {default:break;case R.id.btn_add_friend:loadingUtils.show();addFriend();break;case R.id.btn_send_message:break;case R.id.ll_return:finish();break;}}private void addFriend() {final VerifyType verifyType = VerifyType.DIRECT_ADD; // DIRECT_ADD 直接加对方为好友;VERIFY_REQUEST 发起好友验证请求String msg = "好友请求附言";NIMClient.getService(FriendService.class).addFriend(new AddFriendData(nimUserInfo.getAccount(), verifyType, msg)).setCallback(new RequestCallback<Void>() {@Overridepublic void onSuccess(Void param) {loadingUtils.dismiss();NormalDialogOneBtn("添加好友成功", 200);}@Overridepublic void onFailed(int code) {loadingUtils.dismiss();NormalDialogOneBtn("添加好友失敗", 414);}@Overridepublic void onException(Throwable exception) {loadingUtils.dismiss();NormalDialogOneBtn("添加好友失敗", 500);}});}private void NormalDialogOneBtn(String msg, int code) {final NormalDialog dialog = new NormalDialog(this);dialog.content(msg)//.btnNum(1).btnText("确定")//.showAnim(mBasIn)//.dismissAnim(mBasOut)//.show();dialog.setOnBtnClickL(new OnBtnClickL() {@Overridepublic void onBtnClick() {dialog.dismiss();if (code == 200) {finish();}}});}
}

使用aadapter来好友列表显示

item_friend.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="60dp"android:orientation="horizontal"android:gravity="center_vertical"android:background="@color/white"><ImageViewandroid:id="@+id/iv_head_photo"android:layout_width="40dp"android:layout_height="40dp"android:layout_marginTop="10dp"android:layout_marginBottom="10dp"android:layout_marginStart="10dp"android:layout_marginEnd="10dp"android:contentDescription="@string/tv_icon"android:src="@drawable/test"/><TextViewandroid:id="@+id/tv_nickname"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="18sp"android:textColor="@color/black2"/></LinearLayout>

FriendAdapter.java

package heath.com.chat.adapter;import android.app.Activity;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;import java.util.Collections;
import java.util.List;import heath.com.chat.R;public class FriendAdapter extends RecyclerView.Adapter<FriendHolder> {private List<NimUserInfo> listdata;private Activity context;private LayoutInflater mInflater;public interface OnItemClickListener {void onItemClick(View view, int position);}private OnItemClickListener mOnItemClickListener;public void setOnItemClickListener(OnItemClickListener listener) {this.mOnItemClickListener = listener;}public FriendAdapter(Activity context, List<NimUserInfo> listdata) {this.context = context;this.listdata = listdata;mInflater = LayoutInflater.from(context);}@NonNull@Overridepublic FriendHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {View convertView = mInflater.inflate(R.layout.item_friend, viewGroup, false);FriendHolder viewHolder = new FriendHolder(convertView);return viewHolder;}@Overridepublic void onBindViewHolder(@NonNull final FriendHolder holder, int position) {
//        if (listdata.get(position).getUserInfo().getIcon() != null && !listdata.get(position).getUserInfo().getIcon().equals("null")) {
//            ImageUitl imageUitl = new ImageUitl(BaseActivity.cache);
//            imageUitl.asyncloadImage(holder.mIvHeadPhoto, Common.HTTP_ADDRESS + Common.USER_FOLDER_PATH + "/" + listdata.get(position).getUserInfo().getIcon());
//        }if (listdata.get(position).getName() != null) {holder.mTvNickname.setText(listdata.get(position).getName());}if (mOnItemClickListener != null) {holder.itemView.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {int layoutPosition = holder.getLayoutPosition();mOnItemClickListener.onItemClick(holder.itemView, layoutPosition);}});}}@Overridepublic int getItemCount() {return listdata.size();}public void setData(int position, List<NimUserInfo> list) {Collections.reverse(list);for (NimUserInfo friendBean : list) {listdata.add(position, friendBean);notifyItemInserted(position);}}}class FriendHolder extends RecyclerView.ViewHolder {ImageView mIvHeadPhoto;TextView mTvNickname;FriendHolder(@NonNull View itemView) {super(itemView);mIvHeadPhoto = itemView.findViewById(R.id.iv_head_photo);mTvNickname = itemView.findViewById(R.id.tv_nickname);}
}

项目下载地址:https://download.csdn.net/download/qq_32090185/11122479

下一章介绍发送消息(文本)

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 埋线双眼皮看的到线条

    ...

    2024/4/21 14:32:14
  2. 埋线埋线双眼皮看到有线头

    ...

    2024/4/21 14:32:13
  3. 埋线双眼皮开眼角恢复

    ...

    2024/4/20 15:37:05
  4. 埋线双眼皮开线的感觉

    ...

    2024/4/21 14:32:11
  5. 埋线双眼皮经常摸线

    ...

    2024/4/25 3:08:47
  6. Web应用的组件化开发(一)

    基本思路 1. 为什么要做组件化&#xff1f; 无论前端也好&#xff0c;后端也好&#xff0c;都是整个软件体系的一部分。软件产品也是产品&#xff0c;它的研发过程也必然是有其目的。绝大多数软件产品是追逐利润的&#xff0c;在产品目标确定的情况下&#xff0c;成本有两个途径…...

    2024/4/20 15:22:13
  7. 关于前端开发框架杂谈

    说明&#xff1a;以下关于前端框架的分类及介绍仅代表个人观点&#xff0c;如果不对之处&#xff0c;望大家谅解和指正。 一、html/css Pure.css&#xff1a;美国雅虎公司出品的一组轻量级、响应式纯css模块&#xff0c;适用于任何Web项目。SUI Mobile&#xff1a;SUI Mobile…...

    2024/4/20 15:22:12
  8. [原]Webpack 3 + AngularJS1.* + Bootstrap 4 + Mapbox-gl

    直接上步骤 一、创建项目 1. 使用VSCode建立项目目录结构如下&#xff1a; 文档结构 wabg ├── http │ ├── app.js │ ├── controllers │ │ └── index.js │ ├── directives │ │ └── index.js │ ├── services │ │ └── inde…...

    2024/4/20 15:22:09
  9. 用Angule Cli创建Angular项目

    Angular4.0来了&#xff0c;更小&#xff0c;更快&#xff0c;改动少 接下来为Angular4.0准备环境和学会使用Angular cli项目 1.环境准备&#xff1a; 1&#xff09;在开始工作之前我们必须设置好开发环境 如果你的机器上还没有安装Node.js和npm&#xff0c;请安装他们 &#x…...

    2024/4/20 15:22:08
  10. 埋线双眼皮禁止吃什么

    ...

    2024/4/20 15:22:06
  11. 埋线双眼皮紧的消肿慢

    ...

    2024/4/20 15:22:05
  12. 埋线双眼皮结痂怎么办

    ...

    2024/4/20 15:22:10
  13. 埋线双眼皮结痂多久掉

    ...

    2024/4/20 15:22:10
  14. 埋线双眼皮几天上班

    ...

    2024/4/21 14:32:09
  15. 【教程】InstallShield使用完全教程

    InstallShieldInstallshield是一个强大和易于使用,用于解决Windows软件安装包开发的制作工具。用它可以以传统MSI方式和虚拟格式,自动化地封装、捆绑和包装你的产品。IntallShield能使你的用户在决定何时何地何方式管理和部署你的应用程序时,得到一个最时尚舒畅的安装体验。…...

    2024/4/21 14:32:09
  16. angular2 学习笔记 ( unit test 单元测试 )

    更新 2018-06-03 spy object 当组件或则服务有对其它服务依赖的时候&#xff0c;我们通常会把这些依赖写成 spy 或则叫 fake. 为什么这样做的呢 &#xff1f; 主要的原因是我们不应该依赖具体的代码&#xff0c;假设具体的代码错了&#xff0c;我们这个服务也会跟着报错. 所…...

    2024/4/21 14:32:07
  17. [译] JavaScript 单元测试框架:Jasmine, Mocha, AVA, Tape 和 Jest 的比较

    原文地址&#xff1a;JavaScript unit testing frameworks: Comparing Jasmine, Mocha, AVA, Tape and Jest原文作者&#xff1a;Ben Harding译文出自&#xff1a;掘金翻译计划本文永久链接&#xff1a;github.com/xitu/gold-m…译者&#xff1a;ClarenceC校对者&#xff1a;de…...

    2024/4/21 14:32:06
  18. 一步一步实现现代前端单元测试

    2年前写过一篇文章用Karma和QUnit做前端自动单元测试&#xff0c;只是大概讲解了 karma 如何使用&#xff0c;针对的测试情况是传统的页面模式。本文中题目中【现代】两字表明了这篇文章对比之前的最大不同&#xff0c;最近几年随着SPA(Single Page Application) 技术和各种组件…...

    2024/4/21 14:32:05
  19. 自动化测试框架[各自动化测试框架大比拼]

    Cypress与Selenium/WebDriver Selenium/WebDriver架构 它基于Client/Server架构设计&#xff0c;其架构图如下所示 Language Bindings/Client 也叫做ClientLibrary&#xff0c;它是Selenium框架的一系列jar文件&#xff0c;可以使用不同的编程语言编写&#xff0c;也正因为…...

    2024/4/21 14:32:04
  20. installshield使用教程

    从Visual Studio 2012开始,微软就把自家原来的安装与部署工具彻底废掉了,转而让大家去安装使用第三方的打包工具“InstallShield Limited Edition for Visual Studio”,注意这个版本是免费的,只需要邮件注册下,就会有要注册码。虽然不知道微软这是何用意,但是既然他叫我们…...

    2024/4/21 14:32:03

最新文章

  1. vscode中用node的终端安装模块

    1 安装模块 在控制台输入 npm install crypto-js 创建好了会多几个文件 crypto-js是我们刚刚装的包&#xff0c;用于hash算法和aes des算法 2 package.json文件的作用 当我们把node-modules删了&#xff0c;或者是新建一个文件后我们不用把这个node-modules拷贝过去 在控制台…...

    2024/4/27 8:56:13
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 蓝桥杯 - 受伤的皇后

    解题思路&#xff1a; 递归 回溯&#xff08;n皇后问题的变种&#xff09; 在 N 皇后问题的解决方案中&#xff0c;我们是从棋盘的顶部向底部逐行放置皇后的&#xff0c;这意味着在任何给定时间&#xff0c;所有未来的行&#xff08;即当前行之下的所有行&#xff09;都还没…...

    2024/4/23 22:35:42
  4. 记 SpringBoot 使用@RequestBody 接收不到参数

    POST请求&#xff0c;前端传的参数名字跟后端规定的参数一样。但是通过RequestBody注解接收的参数始终为NULL&#xff01; //实体类中属性没有用驼峰命名 private String SubscribeID; /*** 标题*/ private String Title;解决方案&#xff1a; 1、字段上使用JsonProperty(valu…...

    2024/4/25 20:36:30
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/26 18:09:39
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/26 20:12:18
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/26 23:05:52
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/27 4:00:35
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/25 18:39:22
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/25 18:39:22
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/26 21:56:58
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/25 16:48:44
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/26 16:00:35
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/25 18:39:16
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/25 18:39:16
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/26 19:03:37
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/26 22:01:59
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/25 18:39:14
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/26 23:04:58
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/25 2:10:52
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/25 18:39:00
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/26 19:46:12
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/25 18:38:58
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/27 8:32:30
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57