|
@@ -28,6 +28,7 @@ import android.widget.Toast;
|
|
|
import com.xplora.xpchat.R;
|
|
|
import com.xplora.xpchat.adapter.RecyclerAdapter;
|
|
|
import com.xplora.xpchat.adapter.ViewPagerAdapter;
|
|
|
+import com.xplora.xpchat.fragment.BaseActionFragment;
|
|
|
import com.xplora.xpchat.fragment.ChatWifiFragment;
|
|
|
import com.xplora.xpchat.fragment.PhotoFragment;
|
|
|
import com.xplora.xpchat.fragment.ChatDownloadingFragment;
|
|
@@ -67,6 +68,7 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
|
|
|
private MediaPlayerUtils mPlayManager = null;
|
|
|
private MediaRecorderUtils mRecordManager = null;
|
|
|
private DatabaseUtils mDatabaseUtil = null;
|
|
|
+ private BaseActionFragment mActionFragment = null;
|
|
|
|
|
|
private ContactContentObserver mContactObserver = null;
|
|
|
private ChatContentObserver mChatObserver = null;
|
|
@@ -591,9 +593,9 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
|
|
|
} else {
|
|
|
//已读
|
|
|
action2Read(bean);
|
|
|
- PhotoFragment photoFragment = PhotoFragment.newInstance(this);
|
|
|
- photoFragment.setItemInfo(position, bean);
|
|
|
- photoFragment.show(this.getFragmentManager(), Constant.PACKAGE_NAME);
|
|
|
+ mActionFragment = PhotoFragment.newInstance(this);
|
|
|
+ mActionFragment.setItemInfo(position, bean);
|
|
|
+ mActionFragment.show(this.getFragmentManager(), Constant.PACKAGE_NAME);
|
|
|
}
|
|
|
break;
|
|
|
case Constant.MESSAGE_TYPE_VIDEO:
|
|
@@ -613,9 +615,9 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
|
|
|
}
|
|
|
//已读
|
|
|
action2Read(bean);
|
|
|
- VideoFragment videoFragment = VideoFragment.newInstance(this);
|
|
|
- videoFragment.setItemInfo(position, bean);
|
|
|
- videoFragment.show(this.getFragmentManager(), Constant.PACKAGE_NAME);
|
|
|
+ mActionFragment = VideoFragment.newInstance(this);
|
|
|
+ mActionFragment.setItemInfo(position, bean);
|
|
|
+ mActionFragment.show(this.getFragmentManager(), Constant.PACKAGE_NAME);
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
@@ -904,15 +906,35 @@ public class PagerActivity extends BaseActivity implements Listener.PlayListener
|
|
|
|
|
|
@Override
|
|
|
public void onShareFile(int position, MessageBean bean) {
|
|
|
- mShareMemberBean = bean;
|
|
|
+ mShareMemberBean = DataManager.createSendMessageBean(mChatType, mChatUserId, bean.type, 0, bean.filePath, "", "", bean.videoPath, "");;
|
|
|
Intent intent = new Intent(this, MemberShareActivity.class);
|
|
|
startActivityForResult(intent, Constant.REQUEST_CODE_SHARE);
|
|
|
}
|
|
|
|
|
|
- public void onShareFileCallback(Intent data) {
|
|
|
+ public void onShareFileCallback(Intent intent) {
|
|
|
if (mShareMemberBean == null)
|
|
|
return;
|
|
|
|
|
|
+ //关闭弹框
|
|
|
+ if (mActionFragment != null) {
|
|
|
+ mActionFragment.dismissAllowingStateLoss();
|
|
|
+ mActionFragment = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ //重新配置联系人信息
|
|
|
+ mChatType = intent.getIntExtra(Constant.EXTRA_CHAT_TYPE, 0);
|
|
|
+ mChatId = intent.getLongExtra(Constant.EXTRA_CHAT_ID, 0);
|
|
|
+ mChatUserId = intent.getStringExtra(Constant.EXTRA_CHAT_USER_ID);
|
|
|
+
|
|
|
+ //拉取新联系人聊天信息
|
|
|
+ DataManager.instance().clearMessageList();
|
|
|
+ loadFromMessageDB();
|
|
|
+
|
|
|
+ //分享信息
|
|
|
+ sendMessage(mShareMemberBean, 10);
|
|
|
+
|
|
|
+ //通知拉取当前联系人最新消息
|
|
|
+ checkLastMessage();
|
|
|
}
|
|
|
|
|
|
@Override
|