@Override protected void handleUiMessage(Message msg) { // TODO Auto-generated method stub super.handleUiMessage(msg); swipeRefresh.setRefreshing(false); mAdapter.setIsIniting(false); RequestBaseResponse response = (RequestBaseResponse) msg.obj; switch (msg.what) { case GET_ALBUM_ITEM_LIST: if (response.isSuccess) { // 获取成功 AlbumPhotoItem[] itemList = (AlbumPhotoItem[]) response.body; notifyData(itemList); } else { // 请求失败 if (getActivity() != null) { Toast.makeText( getActivity(), getResources().getString(R.string.album_photolist_update_error), Toast.LENGTH_LONG) .show(); } } break; default: break; } }
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { // TODO Auto-generated method stub super.onActivityCreated(savedInstanceState); mLiveChatManager = LiveChatManager.getInstance(); mLiveChatManager.RegisterMagicIconListener(this); mMagicIconConfig = mLiveChatManager.GetMagicIconConfigItem(); if (mMagicIconConfig == null) { // 本地无配置,调用接口获取或更新 mProgress.setVisibility(View.VISIBLE); mLiveChatManager.GetMagicIconConfig(); } else { updateView(); } }
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { // TODO Auto-generated method stub super.onActivityCreated(savedInstanceState); albumId = getActivity().getIntent().getExtras().getString(AlbumDetailActivity.INPUT_ALBUM_ID); albumName = getActivity().getIntent().getExtras().getString(AlbumDetailActivity.INPUT_ALBUM_NAME); mAlbumItemList = new ArrayList<AlbumPhoto>(); mAlbumPhotoList = new ArrayList<AlbumPhotoItem>(); unReviewItems = new ArrayList<AlbumPhotoItem>(); pastItems = new ArrayList<AlbumPhotoItem>(); editItems = new ArrayList<AlbumPhotoItem>(); rejectItems = new ArrayList<AlbumPhotoItem>(); mAdapter = new AlbumPhotoAdapter(mContext, albumId, albumName, mAlbumItemList, mAlbumPhotoList); mAdapter.setIsIniting(true); sgvTheme.setAdapter(mAdapter); QueryAlbumItem(); // 查询相册item }
@Override protected void handleUiMessage(Message msg) { // TODO Auto-generated method stub super.handleUiMessage(msg); switch (msg.what) { case GET_MAGICICON_CALLBACK: mProgress.setVisibility(View.GONE); if (msg.arg1 == 1) { // 小高表请求成功 MagicIconConfig item = (MagicIconConfig) msg.obj; if (item != null) { if (mMagicIconConfig == null) { // 本地无数据或者数据更新时,刷新界面 mMagicIconConfig = mLiveChatManager.GetMagicIconConfigItem(); updateView(); } } } break; default: break; } }
@Override public void onDetach() { // TODO Auto-generated method stub super.onDetach(); mLiveChatManager.UnregisterMagicIconListener(this); }