Commit 2fe6316b4c532fa87120e0c81556cd552942e0e1
Merge branch 'master' of bj.gitlab.cnlive.com:cnlive-team/CNLiveApp
Showing
19 changed files
with
122 additions
and
146 deletions
app/src/main/java/com/cnlive/gundam/main/ui/fragment/UGCListFragment.java
| @@ -6,7 +6,6 @@ import android.support.annotation.Nullable; | @@ -6,7 +6,6 @@ import android.support.annotation.Nullable; | ||
| 6 | import android.support.v4.app.Fragment; | 6 | import android.support.v4.app.Fragment; |
| 7 | import android.support.v4.widget.SwipeRefreshLayout; | 7 | import android.support.v4.widget.SwipeRefreshLayout; |
| 8 | import android.support.v7.widget.LinearLayoutManager; | 8 | import android.support.v7.widget.LinearLayoutManager; |
| 9 | -import android.util.Log; | ||
| 10 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
| 11 | import android.view.View; | 10 | import android.view.View; |
| 12 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
| @@ -14,11 +13,11 @@ import android.widget.Toast; | @@ -14,11 +13,11 @@ import android.widget.Toast; | ||
| 14 | 13 | ||
| 15 | import com.cnlive.gundam.BR; | 14 | import com.cnlive.gundam.BR; |
| 16 | import com.cnlive.gundam.R; | 15 | import com.cnlive.gundam.R; |
| 16 | +import com.cnlive.gundam.data.network.RetrofitUtil; | ||
| 17 | +import com.cnlive.gundam.data.network.util.SignUtil; | ||
| 17 | import com.cnlive.gundam.databinding.FragmentActiveListBinding; | 18 | import com.cnlive.gundam.databinding.FragmentActiveListBinding; |
| 18 | import com.cnlive.gundam.main.model.ActiveInfo; | 19 | import com.cnlive.gundam.main.model.ActiveInfo; |
| 19 | import com.cnlive.gundam.main.model.ActiveListModel; | 20 | import com.cnlive.gundam.main.model.ActiveListModel; |
| 20 | -import com.cnlive.gundam.data.network.RetrofitUtil; | ||
| 21 | -import com.cnlive.gundam.data.network.util.SignUtil; | ||
| 22 | import com.cnlive.gundam.main.ui.adapter.DataBindingAdapter; | 21 | import com.cnlive.gundam.main.ui.adapter.DataBindingAdapter; |
| 23 | import com.cnlive.gundam.main.utils.ActivityJumpUtil; | 22 | import com.cnlive.gundam.main.utils.ActivityJumpUtil; |
| 24 | import com.cnlive.libs.util.Config; | 23 | import com.cnlive.libs.util.Config; |
| @@ -92,7 +91,6 @@ public class UGCListFragment extends Fragment implements SwipeRefreshLayout.OnRe | @@ -92,7 +91,6 @@ public class UGCListFragment extends Fragment implements SwipeRefreshLayout.OnRe | ||
| 92 | 91 | ||
| 93 | @Override | 92 | @Override |
| 94 | public void onResponse(Call<ActiveListModel> call, Response<ActiveListModel> response) { | 93 | public void onResponse(Call<ActiveListModel> call, Response<ActiveListModel> response) { |
| 95 | - Log.e("11111111111111", "onResponse: "+call.request().toString() ); | ||
| 96 | binding.contentView.setRefreshing(false); | 94 | binding.contentView.setRefreshing(false); |
| 97 | if (response.isSuccessful()) { | 95 | if (response.isSuccessful()) { |
| 98 | ActiveListModel model = response.body(); | 96 | ActiveListModel model = response.body(); |
app/src/main/java/com/cnlive/gundam/stream/ui/activity/StreamActivity.java
| @@ -29,6 +29,7 @@ import com.cnlive.gundam.stream.model.ShowView; | @@ -29,6 +29,7 @@ import com.cnlive.gundam.stream.model.ShowView; | ||
| 29 | import com.cnlive.gundam.stream.ui.adapter.SimpleAdapter; | 29 | import com.cnlive.gundam.stream.ui.adapter.SimpleAdapter; |
| 30 | import com.cnlive.gundam.stream.util.ChatConnect; | 30 | import com.cnlive.gundam.stream.util.ChatConnect; |
| 31 | import com.cnlive.gundam.stream.util.TimerUtil; | 31 | import com.cnlive.gundam.stream.util.TimerUtil; |
| 32 | +import com.cnlive.gundam.video.model.CNMessageModle; | ||
| 32 | import com.cnlive.libs.stream.base.IStreamer; | 33 | import com.cnlive.libs.stream.base.IStreamer; |
| 33 | import com.cnlive.libs.stream.model.ActivityConfig; | 34 | import com.cnlive.libs.stream.model.ActivityConfig; |
| 34 | import com.cnlive.libs.stream.model.Filters; | 35 | import com.cnlive.libs.stream.model.Filters; |
| @@ -39,9 +40,6 @@ import com.cnlive.libs.util.chat.model.CNMessage; | @@ -39,9 +40,6 @@ import com.cnlive.libs.util.chat.model.CNMessage; | ||
| 39 | import com.cnlive.libs.util.chat.model.CNUserInfo; | 40 | import com.cnlive.libs.util.chat.model.CNUserInfo; |
| 40 | import com.google.gson.Gson; | 41 | import com.google.gson.Gson; |
| 41 | 42 | ||
| 42 | -import org.json.JSONException; | ||
| 43 | -import org.json.JSONObject; | ||
| 44 | - | ||
| 45 | import java.util.ArrayList; | 43 | import java.util.ArrayList; |
| 46 | import java.util.List; | 44 | import java.util.List; |
| 47 | 45 | ||
| @@ -107,7 +105,6 @@ public class StreamActivity extends BaseStreamActivity implements ChatConnect.Ch | @@ -107,7 +105,6 @@ public class StreamActivity extends BaseStreamActivity implements ChatConnect.Ch | ||
| 107 | binding.setIsShow(showView); | 105 | binding.setIsShow(showView); |
| 108 | binding.chatRecyclerView.setLayoutManager(new LinearLayoutManager(this)); | 106 | binding.chatRecyclerView.setLayoutManager(new LinearLayoutManager(this)); |
| 109 | chatItemList = new ArrayList<>(); | 107 | chatItemList = new ArrayList<>(); |
| 110 | - | ||
| 111 | timerUtil = new TimerUtil(this); | 108 | timerUtil = new TimerUtil(this); |
| 112 | 109 | ||
| 113 | accelerometerSensor = new AccelerometerSensor(this); | 110 | accelerometerSensor = new AccelerometerSensor(this); |
| @@ -135,7 +132,7 @@ public class StreamActivity extends BaseStreamActivity implements ChatConnect.Ch | @@ -135,7 +132,7 @@ public class StreamActivity extends BaseStreamActivity implements ChatConnect.Ch | ||
| 135 | ExtensionModel extensionModel = new ExtensionModel(channelName, coverImgUrl); | 132 | ExtensionModel extensionModel = new ExtensionModel(channelName, coverImgUrl); |
| 136 | extensions = new Gson().toJson(extensionModel); | 133 | extensions = new Gson().toJson(extensionModel); |
| 137 | 134 | ||
| 138 | - roomId = activityId; | 135 | + roomId = channelId; |
| 139 | } | 136 | } |
| 140 | 137 | ||
| 141 | public void onClick(View view) { | 138 | public void onClick(View view) { |
| @@ -409,24 +406,29 @@ public class StreamActivity extends BaseStreamActivity implements ChatConnect.Ch | @@ -409,24 +406,29 @@ public class StreamActivity extends BaseStreamActivity implements ChatConnect.Ch | ||
| 409 | @Override | 406 | @Override |
| 410 | public void onChatState(int what) { | 407 | public void onChatState(int what) { |
| 411 | 408 | ||
| 409 | + | ||
| 412 | } | 410 | } |
| 413 | 411 | ||
| 414 | @Override | 412 | @Override |
| 415 | public void onChatMessage(CNMessage cnMessage) { | 413 | public void onChatMessage(CNMessage cnMessage) { |
| 416 | - //// TODO: 5/23/2017 Recyclerview添加数据 | ||
| 417 | - String headUrl = cnMessage.getUserInfo().getHeadUrl() == null ? "" : cnMessage.getUserInfo().getHeadUrl(); | ||
| 418 | - String userName = cnMessage.getUserInfo().getUserName() == null ? "" : cnMessage.getUserInfo().getUserName(); | ||
| 419 | - String content = null; | ||
| 420 | try { | 414 | try { |
| 421 | - content = cnMessage.getContent() == null ? "" : (String) new JSONObject(cnMessage.getContent()).get("message"); | ||
| 422 | - } catch (JSONException e) { | 415 | + Gson gson = new Gson(); |
| 416 | + CNMessageModle cnMessageModle = gson.fromJson(cnMessage.getContent(), CNMessageModle.class); | ||
| 417 | + String messagecontent = cnMessageModle.getMessage().getContent(); | ||
| 418 | + String messageType = cnMessageModle.getType(); | ||
| 419 | + if (messageType.equals("giftType")) { | ||
| 420 | + chatItemList.add(new ChatItem(cnMessage.getUserInfo().getHeadUrl(), cnMessage.getUserInfo().getUserName(), "送了" + messagecontent)); | ||
| 421 | + } else if (messageType.equals("chatRoom")) { | ||
| 422 | + chatItemList.add(new ChatItem(cnMessage.getUserInfo().getHeadUrl(), cnMessage.getUserInfo().getUserName(), messagecontent)); | ||
| 423 | + | ||
| 424 | + } else if (messageType.equals("joinType")) { | ||
| 425 | + chatItemList.add(new ChatItem(cnMessage.getUserInfo().getHeadUrl(), cnMessage.getUserInfo().getUserName(), "加入")); | ||
| 426 | + } | ||
| 427 | + } catch (Exception e) { | ||
| 423 | e.printStackTrace(); | 428 | e.printStackTrace(); |
| 424 | } | 429 | } |
| 425 | - ChatItem chatItem = new ChatItem(headUrl, userName, content); | ||
| 426 | - chatItemList.add(chatItem); | ||
| 427 | chatAdapter = new SimpleAdapter(this, chatItemList, R.layout.item_chat, com.cnlive.gundam.BR.chat); | 430 | chatAdapter = new SimpleAdapter(this, chatItemList, R.layout.item_chat, com.cnlive.gundam.BR.chat); |
| 428 | binding.setChatAdapter(chatAdapter); | 431 | binding.setChatAdapter(chatAdapter); |
| 429 | - | ||
| 430 | } | 432 | } |
| 431 | 433 | ||
| 432 | private void getOnlinePerson() { | 434 | private void getOnlinePerson() { |
app/src/main/java/com/cnlive/gundam/video/fragment/PlayerLiveFragment.java
| @@ -50,7 +50,8 @@ public class PlayerLiveFragment extends Fragment implements PlayerAccelerometerS | @@ -50,7 +50,8 @@ public class PlayerLiveFragment extends Fragment implements PlayerAccelerometerS | ||
| 50 | @Override | 50 | @Override |
| 51 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | 51 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 52 | binding = DataBindingUtil.inflate(inflater, R.layout.fragment_player_live, container, false); | 52 | binding = DataBindingUtil.inflate(inflater, R.layout.fragment_player_live, container, false); |
| 53 | - getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.contentLayout, ChatRoomFragment.newInstance(), "chatRoomFragment").commit(); | 53 | + program = (VideoListProgram) getArguments().getSerializable("program"); |
| 54 | + getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.contentLayout, ChatRoomFragment.newInstance(program.getChannelId()), "chatRoomFragment").commit(); | ||
| 54 | return binding.getRoot(); | 55 | return binding.getRoot(); |
| 55 | } | 56 | } |
| 56 | 57 |
app/src/main/java/com/cnlive/gundam/video/fragment/PlayerUgcLiveFragment.java
| @@ -16,7 +16,7 @@ import android.widget.Toast; | @@ -16,7 +16,7 @@ import android.widget.Toast; | ||
| 16 | import com.cnlive.gundam.R; | 16 | import com.cnlive.gundam.R; |
| 17 | import com.cnlive.gundam.databinding.FragmentPlayerUgcLiveBinding; | 17 | import com.cnlive.gundam.databinding.FragmentPlayerUgcLiveBinding; |
| 18 | import com.cnlive.gundam.main.model.VideoListProgram; | 18 | import com.cnlive.gundam.main.model.VideoListProgram; |
| 19 | -import com.cnlive.gundam.video.fragment.chat.UgcLiveChatFragment; | 19 | +import com.cnlive.gundam.video.fragment.chat.ChatRoomFragment; |
| 20 | import com.cnlive.gundam.video.model.VideoModel; | 20 | import com.cnlive.gundam.video.model.VideoModel; |
| 21 | import com.cnlive.gundam.video.utils.PlayerUtils; | 21 | import com.cnlive.gundam.video.utils.PlayerUtils; |
| 22 | import com.cnlive.gundam.video.view.BaseVideoView; | 22 | import com.cnlive.gundam.video.view.BaseVideoView; |
| @@ -57,8 +57,8 @@ public class PlayerUgcLiveFragment extends Fragment implements BaseVideoView.OnU | @@ -57,8 +57,8 @@ public class PlayerUgcLiveFragment extends Fragment implements BaseVideoView.OnU | ||
| 57 | @Override | 57 | @Override |
| 58 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | 58 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 59 | binding = DataBindingUtil.inflate(inflater, R.layout.fragment_player_ugc_live, container, false); | 59 | binding = DataBindingUtil.inflate(inflater, R.layout.fragment_player_ugc_live, container, false); |
| 60 | - getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.contentLayout, UgcLiveChatFragment.newInstance(), "ugcLiveChatFragment").commit(); | ||
| 61 | initData(); | 60 | initData(); |
| 61 | + getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.contentLayout, ChatRoomFragment.newInstance(id), "chatRoomFragment").commit(); | ||
| 62 | return binding.getRoot(); | 62 | return binding.getRoot(); |
| 63 | } | 63 | } |
| 64 | 64 |
app/src/main/java/com/cnlive/gundam/video/fragment/chat/ChatRoomFragment.java
| @@ -8,7 +8,6 @@ import android.support.v4.app.Fragment; | @@ -8,7 +8,6 @@ import android.support.v4.app.Fragment; | ||
| 8 | import android.support.v7.widget.GridLayoutManager; | 8 | import android.support.v7.widget.GridLayoutManager; |
| 9 | import android.support.v7.widget.OrientationHelper; | 9 | import android.support.v7.widget.OrientationHelper; |
| 10 | import android.support.v7.widget.SwitchCompat; | 10 | import android.support.v7.widget.SwitchCompat; |
| 11 | -import android.util.Log; | ||
| 12 | import android.view.LayoutInflater; | 11 | import android.view.LayoutInflater; |
| 13 | import android.view.View; | 12 | import android.view.View; |
| 14 | import android.view.ViewGroup; | 13 | import android.view.ViewGroup; |
| @@ -48,14 +47,15 @@ public class ChatRoomFragment extends Fragment implements InputUtil.SendCallback | @@ -48,14 +47,15 @@ public class ChatRoomFragment extends Fragment implements InputUtil.SendCallback | ||
| 48 | private FragmentChatBinding fragmentChatBinding; | 47 | private FragmentChatBinding fragmentChatBinding; |
| 49 | private ArrayList<GiftModle> giftArray; | 48 | private ArrayList<GiftModle> giftArray; |
| 50 | private CommonAdapter<MessageContent> messageContentCommonAdapter; | 49 | private CommonAdapter<MessageContent> messageContentCommonAdapter; |
| 51 | - private String roomId = "ChatRoom06"; | ||
| 52 | private MessageContentInfo messageContentInfo; | 50 | private MessageContentInfo messageContentInfo; |
| 53 | public SwitchCompat switchCompatBottom; | 51 | public SwitchCompat switchCompatBottom; |
| 54 | private BarrageLayout barrageLayout; | 52 | private BarrageLayout barrageLayout; |
| 53 | + private String roomId; | ||
| 55 | 54 | ||
| 56 | 55 | ||
| 57 | - public static ChatRoomFragment newInstance() { | 56 | + public static ChatRoomFragment newInstance(String id ) { |
| 58 | Bundle args = new Bundle(); | 57 | Bundle args = new Bundle(); |
| 58 | + args.putString("roomID",id); | ||
| 59 | ChatRoomFragment fragment = new ChatRoomFragment(); | 59 | ChatRoomFragment fragment = new ChatRoomFragment(); |
| 60 | fragment.setArguments(args); | 60 | fragment.setArguments(args); |
| 61 | return fragment; | 61 | return fragment; |
| @@ -66,6 +66,7 @@ public class ChatRoomFragment extends Fragment implements InputUtil.SendCallback | @@ -66,6 +66,7 @@ public class ChatRoomFragment extends Fragment implements InputUtil.SendCallback | ||
| 66 | @Override | 66 | @Override |
| 67 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | 67 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| 68 | fragmentChatBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_chat, container, false); | 68 | fragmentChatBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_chat, container, false); |
| 69 | + roomId = getArguments().getString("roomID"); | ||
| 69 | return fragmentChatBinding.getRoot(); | 70 | return fragmentChatBinding.getRoot(); |
| 70 | 71 | ||
| 71 | } | 72 | } |
| @@ -140,7 +141,6 @@ public class ChatRoomFragment extends Fragment implements InputUtil.SendCallback | @@ -140,7 +141,6 @@ public class ChatRoomFragment extends Fragment implements InputUtil.SendCallback | ||
| 140 | @Override | 141 | @Override |
| 141 | public void onDestroy() { | 142 | public void onDestroy() { |
| 142 | super.onDestroy(); | 143 | super.onDestroy(); |
| 143 | - Log.v("fdfsfaf","dfasdfsafdfadf"); | ||
| 144 | ChatUtil.disconnect(false); | 144 | ChatUtil.disconnect(false); |
| 145 | } | 145 | } |
| 146 | 146 |
app/src/main/java/com/cnlive/gundam/video/fragment/chat/MessageContentInfo.java
| @@ -3,7 +3,6 @@ package com.cnlive.gundam.video.fragment.chat; | @@ -3,7 +3,6 @@ package com.cnlive.gundam.video.fragment.chat; | ||
| 3 | import android.content.Context; | 3 | import android.content.Context; |
| 4 | import android.os.Handler; | 4 | import android.os.Handler; |
| 5 | import android.text.TextUtils; | 5 | import android.text.TextUtils; |
| 6 | -import android.util.Log; | ||
| 7 | 6 | ||
| 8 | import com.cnlive.gundam.user.auth.UserService; | 7 | import com.cnlive.gundam.user.auth.UserService; |
| 9 | import com.cnlive.gundam.video.barrage.BarrageBaseMessage; | 8 | import com.cnlive.gundam.video.barrage.BarrageBaseMessage; |
| @@ -34,19 +33,19 @@ public class MessageContentInfo { | @@ -34,19 +33,19 @@ public class MessageContentInfo { | ||
| 34 | private Context mContext; | 33 | private Context mContext; |
| 35 | private SendAndRecevieSucessCall mSendAndRecevieSucessCall; | 34 | private SendAndRecevieSucessCall mSendAndRecevieSucessCall; |
| 36 | private String roomId; | 35 | private String roomId; |
| 37 | - private BarrageLayout barrageLayout; | 36 | + private BarrageLayout barrageLayout; |
| 38 | private String JoinType = "joinType"; | 37 | private String JoinType = "joinType"; |
| 39 | - private String ChatRoom ="chatRoom"; | ||
| 40 | - private String giftType = "giftType"; | 38 | + private String ChatRoom = "chatRoom"; |
| 39 | + private String giftType = "giftType"; | ||
| 41 | 40 | ||
| 42 | 41 | ||
| 43 | - public void setOnReceiveAndSendListener(BarrageLayout barrageLayout,String roomID, Context context, SendAndRecevieSucessCall sendAndRecevieSucessCall) { | 42 | + public void setOnReceiveAndSendListener(BarrageLayout barrageLayout, String roomID, Context context, SendAndRecevieSucessCall sendAndRecevieSucessCall) { |
| 44 | this.roomId = roomID; | 43 | this.roomId = roomID; |
| 45 | this.mContext = context; | 44 | this.mContext = context; |
| 46 | this.mSendAndRecevieSucessCall = sendAndRecevieSucessCall; | 45 | this.mSendAndRecevieSucessCall = sendAndRecevieSucessCall; |
| 47 | mHandler = new Handler(); | 46 | mHandler = new Handler(); |
| 48 | messageContentArrayList = new ArrayList<>(); | 47 | messageContentArrayList = new ArrayList<>(); |
| 49 | - this.barrageLayout =barrageLayout; | 48 | + this.barrageLayout = barrageLayout; |
| 50 | initListener(); | 49 | initListener(); |
| 51 | 50 | ||
| 52 | } | 51 | } |
| @@ -66,12 +65,9 @@ public class MessageContentInfo { | @@ -66,12 +65,9 @@ public class MessageContentInfo { | ||
| 66 | 65 | ||
| 67 | Gson gson = new Gson(); | 66 | Gson gson = new Gson(); |
| 68 | CNMessageModle cnMessageModle = gson.fromJson(message.getContent(), CNMessageModle.class); | 67 | CNMessageModle cnMessageModle = gson.fromJson(message.getContent(), CNMessageModle.class); |
| 69 | - String messagecontent =cnMessageModle.getMessage().getContent(); | 68 | + String messagecontent = cnMessageModle.getMessage().getContent(); |
| 70 | String messageType = cnMessageModle.getType(); | 69 | String messageType = cnMessageModle.getType(); |
| 71 | - | ||
| 72 | - | ||
| 73 | if (messageType.equals(giftType)) { | 70 | if (messageType.equals(giftType)) { |
| 74 | - | ||
| 75 | barrageLayout.addMessage(new BarrageBaseMessage(message.getUserInfo().getUserName(), "送了" + messagecontent, "")); | 71 | barrageLayout.addMessage(new BarrageBaseMessage(message.getUserInfo().getUserName(), "送了" + messagecontent, "")); |
| 76 | messageContentArrayList.add(new MessageContent(message.getUserInfo().getUserName(), ": 送了" + messagecontent, message.getUserInfo().getHeadUrl(), true)); | 72 | messageContentArrayList.add(new MessageContent(message.getUserInfo().getUserName(), ": 送了" + messagecontent, message.getUserInfo().getHeadUrl(), true)); |
| 77 | } else if (messageType.equals(ChatRoom)) { | 73 | } else if (messageType.equals(ChatRoom)) { |
| @@ -79,11 +75,9 @@ public class MessageContentInfo { | @@ -79,11 +75,9 @@ public class MessageContentInfo { | ||
| 79 | messageContentArrayList.add(new MessageContent(message.getUserInfo().getUserName(), messagecontent + " :", message.getUserInfo().getHeadUrl(), false)); | 75 | messageContentArrayList.add(new MessageContent(message.getUserInfo().getUserName(), messagecontent + " :", message.getUserInfo().getHeadUrl(), false)); |
| 80 | } else { | 76 | } else { |
| 81 | messageContentArrayList.add(new MessageContent(message.getUserInfo().getUserName(), " :" + messagecontent, message.getUserInfo().getHeadUrl(), true)); | 77 | messageContentArrayList.add(new MessageContent(message.getUserInfo().getUserName(), " :" + messagecontent, message.getUserInfo().getHeadUrl(), true)); |
| 82 | - | ||
| 83 | } | 78 | } |
| 84 | barrageLayout.addMessage(new BarrageBaseMessage(message.getUserInfo().getUserName(), messagecontent, "")); | 79 | barrageLayout.addMessage(new BarrageBaseMessage(message.getUserInfo().getUserName(), messagecontent, "")); |
| 85 | 80 | ||
| 86 | - | ||
| 87 | } else if (messageType.equals(JoinType)) { | 81 | } else if (messageType.equals(JoinType)) { |
| 88 | String userName = message.getUserInfo().getUserName(); | 82 | String userName = message.getUserInfo().getUserName(); |
| 89 | if (TextUtils.isEmpty(userName)) { | 83 | if (TextUtils.isEmpty(userName)) { |
| @@ -123,7 +117,7 @@ public class MessageContentInfo { | @@ -123,7 +117,7 @@ public class MessageContentInfo { | ||
| 123 | 117 | ||
| 124 | Gson gson = new Gson(); | 118 | Gson gson = new Gson(); |
| 125 | CNMessageModle cnMessageModle = gson.fromJson(message.getContent(), CNMessageModle.class); | 119 | CNMessageModle cnMessageModle = gson.fromJson(message.getContent(), CNMessageModle.class); |
| 126 | - String messagecontent =cnMessageModle.getMessage().getContent(); | 120 | + String messagecontent = cnMessageModle.getMessage().getContent(); |
| 127 | String messageType = cnMessageModle.getType(); | 121 | String messageType = cnMessageModle.getType(); |
| 128 | 122 | ||
| 129 | 123 | ||
| @@ -152,14 +146,13 @@ public class MessageContentInfo { | @@ -152,14 +146,13 @@ public class MessageContentInfo { | ||
| 152 | onConnectListener = new IChat.OnConnectListener() { | 146 | onConnectListener = new IChat.OnConnectListener() { |
| 153 | @Override | 147 | @Override |
| 154 | public void onTokenIncorrect(String s) { | 148 | public void onTokenIncorrect(String s) { |
| 155 | - | ||
| 156 | } | 149 | } |
| 157 | 150 | ||
| 158 | @Override | 151 | @Override |
| 159 | public void onSuccess(String s) { | 152 | public void onSuccess(String s) { |
| 160 | joinChatRoom(); | 153 | joinChatRoom(); |
| 161 | 154 | ||
| 162 | - } | 155 | + } |
| 163 | 156 | ||
| 164 | 157 | ||
| 165 | @Override | 158 | @Override |
| @@ -175,10 +168,9 @@ public class MessageContentInfo { | @@ -175,10 +168,9 @@ public class MessageContentInfo { | ||
| 175 | ChatUtil.joinChatRoom(roomId, 0, new IChat.OnOperationListener() { | 168 | ChatUtil.joinChatRoom(roomId, 0, new IChat.OnOperationListener() { |
| 176 | @Override | 169 | @Override |
| 177 | public void onSuccess(int what, String extra) { | 170 | public void onSuccess(int what, String extra) { |
| 178 | - CNMessageModle cnMessageModle = new CNMessageModle(JoinType,new MessageInfo("","","","","")); | ||
| 179 | - Gson gson2=new Gson(); | ||
| 180 | - String obj2=gson2.toJson(cnMessageModle); | ||
| 181 | - Log.v("dfsd",obj2); | 171 | + CNMessageModle cnMessageModle = new CNMessageModle(JoinType, new MessageInfo("", "", "", "", "")); |
| 172 | + Gson gson2 = new Gson(); | ||
| 173 | + String obj2 = gson2.toJson(cnMessageModle); | ||
| 182 | ChatUtil.sendMessage(IChat.CHATROOM, roomId, obj2, onSendMessageListener); | 174 | ChatUtil.sendMessage(IChat.CHATROOM, roomId, obj2, onSendMessageListener); |
| 183 | } | 175 | } |
| 184 | 176 | ||
| @@ -196,5 +188,4 @@ public class MessageContentInfo { | @@ -196,5 +188,4 @@ public class MessageContentInfo { | ||
| 196 | } | 188 | } |
| 197 | 189 | ||
| 198 | 190 | ||
| 199 | - | ||
| 200 | } | 191 | } |
app/src/main/java/com/cnlive/gundam/video/fragment/chat/UgcLiveChatFragment.java deleted
100644 → 0
| 1 | -package com.cnlive.gundam.video.fragment.chat; | ||
| 2 | - | ||
| 3 | -import android.os.Bundle; | ||
| 4 | -import android.support.annotation.Nullable; | ||
| 5 | -import android.support.v7.widget.SwitchCompat; | ||
| 6 | -import android.view.LayoutInflater; | ||
| 7 | -import android.view.View; | ||
| 8 | -import android.view.ViewGroup; | ||
| 9 | - | ||
| 10 | -import com.cnlive.gundam.R; | ||
| 11 | -import com.cnlive.gundam.video.view.PlayerControllerView; | ||
| 12 | - | ||
| 13 | -/** | ||
| 14 | - * @author 陈硕 | ||
| 15 | - * @time 2017/6/29 19:36 | ||
| 16 | - * @desc ${TODD} | ||
| 17 | - */ | ||
| 18 | -public class UgcLiveChatFragment extends ChatRoomFragment { | ||
| 19 | - | ||
| 20 | - public static UgcLiveChatFragment newInstance() { | ||
| 21 | - Bundle args = new Bundle(); | ||
| 22 | - UgcLiveChatFragment fragment = new UgcLiveChatFragment(); | ||
| 23 | - fragment.setArguments(args); | ||
| 24 | - return fragment; | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - @Nullable | ||
| 28 | - @Override | ||
| 29 | - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { | ||
| 30 | - return super.onCreateView(inflater, container, savedInstanceState); | ||
| 31 | - } | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - @Override | ||
| 35 | - public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | ||
| 36 | - super.onViewCreated(view, savedInstanceState); | ||
| 37 | - PlayerControllerView viewById = getActivity().findViewById(R.id.controllerView); | ||
| 38 | - viewById.setonswitchCompatChangeListene(new PlayerControllerView.SwitchCompatChangeListener() { | ||
| 39 | - @Override | ||
| 40 | - public void onSwitchCompatChange(SwitchCompat barrageTop) { | ||
| 41 | - barrageTop.setVisibility(View.INVISIBLE); | ||
| 42 | - } | ||
| 43 | - }); | ||
| 44 | - } | ||
| 45 | -} |
app/src/main/java/com/cnlive/gundam/video/view/BaseVideoView.java
| @@ -49,6 +49,8 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -49,6 +49,8 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 49 | protected static boolean isLive; | 49 | protected static boolean isLive; |
| 50 | //记录当前视频是否能播 | 50 | //记录当前视频是否能播 |
| 51 | protected boolean canPlay = true; | 51 | protected boolean canPlay = true; |
| 52 | + //记录当前视频状态是否结束 | ||
| 53 | + protected boolean isStatusEnd = false; | ||
| 52 | //本地缓存数据工具类 | 54 | //本地缓存数据工具类 |
| 53 | private SharedPreferencesHelper sharedPreferencesHelper; | 55 | private SharedPreferencesHelper sharedPreferencesHelper; |
| 54 | //播放进度保存至本地缓存的标识前缀 | 56 | //播放进度保存至本地缓存的标识前缀 |
| @@ -108,7 +110,7 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -108,7 +110,7 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 108 | if (Build.VERSION.SDK_INT >= 23) { | 110 | if (Build.VERSION.SDK_INT >= 23) { |
| 109 | int checkCallPhonePermission = ContextCompat.checkSelfPermission(getContext(), Manifest.permission.READ_PHONE_STATE); | 111 | int checkCallPhonePermission = ContextCompat.checkSelfPermission(getContext(), Manifest.permission.READ_PHONE_STATE); |
| 110 | if (checkCallPhonePermission != PackageManager.PERMISSION_GRANTED) { | 112 | if (checkCallPhonePermission != PackageManager.PERMISSION_GRANTED) { |
| 111 | - if(ugcLivePermissionListener != null) | 113 | + if (ugcLivePermissionListener != null) |
| 112 | ugcLivePermissionListener.onShouldRequestPermission(); | 114 | ugcLivePermissionListener.onShouldRequestPermission(); |
| 113 | } else { | 115 | } else { |
| 114 | addUgcLiveStatus(); | 116 | addUgcLiveStatus(); |
| @@ -133,14 +135,14 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -133,14 +135,14 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 133 | /** | 135 | /** |
| 134 | * 设置UGC LIVE的直播状态监听 | 136 | * 设置UGC LIVE的直播状态监听 |
| 135 | */ | 137 | */ |
| 136 | - public void setUgcLiveStatusPermissionListener(OnUgcLiveStatusPermissionListener l){ | 138 | + public void setUgcLiveStatusPermissionListener(OnUgcLiveStatusPermissionListener l) { |
| 137 | ugcLivePermissionListener = l; | 139 | ugcLivePermissionListener = l; |
| 138 | } | 140 | } |
| 139 | 141 | ||
| 140 | /** | 142 | /** |
| 141 | * 添加UGC LIVE的直播状态监听 | 143 | * 添加UGC LIVE的直播状态监听 |
| 142 | */ | 144 | */ |
| 143 | - public void addUgcLiveStatus(){ | 145 | + public void addUgcLiveStatus() { |
| 144 | VideoStatusUtil.setOnVideoPlayStatusCallback(mOnVideoStatusCallback); | 146 | VideoStatusUtil.setOnVideoPlayStatusCallback(mOnVideoStatusCallback); |
| 145 | VideoStatusUtil.init(videoModel.getId()); | 147 | VideoStatusUtil.init(videoModel.getId()); |
| 146 | } | 148 | } |
| @@ -213,7 +215,6 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -213,7 +215,6 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 213 | * @param rate | 215 | * @param rate |
| 214 | */ | 216 | */ |
| 215 | public void switchVideoRate(String rate) { | 217 | public void switchVideoRate(String rate) { |
| 216 | - //TODO 换成无缝切换 | ||
| 217 | curRate = rate; | 218 | curRate = rate; |
| 218 | if (binding.controllerView != null) | 219 | if (binding.controllerView != null) |
| 219 | binding.controllerView.setSwitchRateType(PlayerControllerView.SWITCH_RATE_START, curRate); | 220 | binding.controllerView.setSwitchRateType(PlayerControllerView.SWITCH_RATE_START, curRate); |
| @@ -252,7 +253,7 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -252,7 +253,7 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 252 | isPrepareSeek = true; | 253 | isPrepareSeek = true; |
| 253 | iMediaPlayer.seekTo(curPlayPosition); | 254 | iMediaPlayer.seekTo(curPlayPosition); |
| 254 | } else { | 255 | } else { |
| 255 | - if (canPlay && !iMediaPlayer.getPlayState()) { | 256 | + if (!iMediaPlayer.getPlayState()) { |
| 256 | setPlayState(true); | 257 | setPlayState(true); |
| 257 | isPlay = true; | 258 | isPlay = true; |
| 258 | } | 259 | } |
| @@ -310,22 +311,27 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -310,22 +311,27 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 310 | switch (status) { | 311 | switch (status) { |
| 311 | case IVideoStatus.MEDIA_STATUS_LIVING: | 312 | case IVideoStatus.MEDIA_STATUS_LIVING: |
| 312 | //直播中' | 313 | //直播中' |
| 313 | - canPlay = true; | ||
| 314 | - if (!binding.videoView.getPlayState()) { | ||
| 315 | - binding.videoView.reload(); | ||
| 316 | - binding.infoView.show(PlayerInfoView.SHOW_BUFFERING); | 314 | + if (!isStatusEnd) { |
| 315 | + canPlay = true; | ||
| 316 | + isPlay = true; | ||
| 317 | + setPlayState(true); | ||
| 317 | } | 318 | } |
| 318 | break; | 319 | break; |
| 319 | case IVideoStatus.MEDIA_STATUS_LEAVE: | 320 | case IVideoStatus.MEDIA_STATUS_LEAVE: |
| 320 | //主播暂时离开 | 321 | //主播暂时离开 |
| 321 | - canPlay = false; | ||
| 322 | - binding.videoView.stop(); | ||
| 323 | - binding.infoView.show(PlayerInfoView.SHOW_UGC_LIVE_STATUS, getContext().getString(R.string.player_status_leave)); | 322 | + if (!isStatusEnd) { |
| 323 | + canPlay = false; | ||
| 324 | + isPlay = false; | ||
| 325 | + setPlayState(false); | ||
| 326 | + binding.infoView.show(PlayerInfoView.SHOW_UGC_LIVE_STATUS, getContext().getString(R.string.player_status_leave)); | ||
| 327 | + } | ||
| 324 | break; | 328 | break; |
| 325 | case IVideoStatus.MEDIA_STATUS_END: | 329 | case IVideoStatus.MEDIA_STATUS_END: |
| 326 | //直播结束 | 330 | //直播结束 |
| 327 | canPlay = false; | 331 | canPlay = false; |
| 328 | - binding.videoView.stop(); | 332 | + isPlay = false; |
| 333 | + isStatusEnd = true; | ||
| 334 | + binding.videoView.release(); | ||
| 329 | binding.infoView.show(PlayerInfoView.SHOW_UGC_LIVE_STATUS, getContext().getString(R.string.player_status_end)); | 335 | binding.infoView.show(PlayerInfoView.SHOW_UGC_LIVE_STATUS, getContext().getString(R.string.player_status_end)); |
| 330 | break; | 336 | break; |
| 331 | } | 337 | } |
| @@ -344,7 +350,7 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -344,7 +350,7 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 344 | } | 350 | } |
| 345 | 351 | ||
| 346 | //ugc live 监听直播状态得需要android.permission.READ_PHONE_STATE | 352 | //ugc live 监听直播状态得需要android.permission.READ_PHONE_STATE |
| 347 | - public interface OnUgcLiveStatusPermissionListener{ | 353 | + public interface OnUgcLiveStatusPermissionListener { |
| 348 | void onShouldRequestPermission(); | 354 | void onShouldRequestPermission(); |
| 349 | } | 355 | } |
| 350 | } | 356 | } |
app/src/main/res/layout/fragment_player_ugc_live.xml
| @@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
| 17 | 17 | ||
| 18 | <com.cnlive.libs.video.barrage.BarrageLayout | 18 | <com.cnlive.libs.video.barrage.BarrageLayout |
| 19 | android:id="@+id/private_message" | 19 | android:id="@+id/private_message" |
| 20 | + android:layout_marginTop="50dp" | ||
| 20 | android:layout_width="match_parent" | 21 | android:layout_width="match_parent" |
| 21 | android:layout_height="wrap_content"/> | 22 | android:layout_height="wrap_content"/> |
| 22 | 23 |
app/src/main/res/layout/layout_player_controller_live_l.xml
| @@ -144,7 +144,7 @@ | @@ -144,7 +144,7 @@ | ||
| 144 | <RelativeLayout | 144 | <RelativeLayout |
| 145 | android:id="@+id/bottomLayout" | 145 | android:id="@+id/bottomLayout" |
| 146 | android:layout_width="match_parent" | 146 | android:layout_width="match_parent" |
| 147 | - android:layout_height="wrap_content" | 147 | + android:layout_height="40dp" |
| 148 | android:background="#44000000" | 148 | android:background="#44000000" |
| 149 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> | 149 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> |
| 150 | 150 | ||
| @@ -152,33 +152,43 @@ | @@ -152,33 +152,43 @@ | ||
| 152 | android:id="@+id/playBtn" | 152 | android:id="@+id/playBtn" |
| 153 | android:layout_width="30dp" | 153 | android:layout_width="30dp" |
| 154 | android:layout_height="30dp" | 154 | android:layout_height="30dp" |
| 155 | + android:layout_centerVertical="true" | ||
| 155 | android:layout_marginRight="5dp" | 156 | android:layout_marginRight="5dp" |
| 157 | + android:layout_marginLeft="10dp" | ||
| 156 | android:onClick="@{playerControllerView.onClick}" | 158 | android:onClick="@{playerControllerView.onClick}" |
| 157 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> | 159 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> |
| 158 | 160 | ||
| 159 | - <TextView | ||
| 160 | - android:id="@+id/rate" | 161 | + <RelativeLayout |
| 161 | android:layout_width="wrap_content" | 162 | android:layout_width="wrap_content" |
| 162 | - android:layout_height="wrap_content" | ||
| 163 | - android:layout_alignParentRight="true" | ||
| 164 | - android:layout_centerVertical="true" | ||
| 165 | - android:layout_marginRight="10dp" | ||
| 166 | - android:onClick="@{playerControllerView.onClick}" | ||
| 167 | - android:text="@{VideoRateUtil.getRateText(rateType.get())}" | ||
| 168 | - android:textColor="@android:color/white" | ||
| 169 | - android:visibility="@{hasRate.get() ? View.VISIBLE : View.GONE}" /> | 163 | + android:layout_height="match_parent" |
| 164 | + android:layout_alignParentRight="true"> | ||
| 170 | 165 | ||
| 171 | - <android.support.v7.widget.SwitchCompat | ||
| 172 | - android:id="@+id/barrage_top" | ||
| 173 | - android:layout_width="wrap_content" | ||
| 174 | - android:layout_height="wrap_content" | ||
| 175 | - android:layout_centerVertical="true" | ||
| 176 | - android:background="@null" | ||
| 177 | - android:textIsSelectable="false" | ||
| 178 | - android:layout_alignParentRight="true" | ||
| 179 | - android:thumb="@drawable/switch_thumb" | ||
| 180 | - app:switchMinWidth="30dp" | ||
| 181 | - app:track="@drawable/switch_track" /> | 166 | + <TextView |
| 167 | + android:id="@+id/rate" | ||
| 168 | + android:layout_width="wrap_content" | ||
| 169 | + android:layout_height="wrap_content" | ||
| 170 | + android:layout_alignParentRight="true" | ||
| 171 | + android:layout_centerVertical="true" | ||
| 172 | + android:layout_marginRight="10dp" | ||
| 173 | + android:onClick="@{playerControllerView.onClick}" | ||
| 174 | + android:text="@{VideoRateUtil.getRateText(rateType.get())}" | ||
| 175 | + android:textColor="@android:color/white" | ||
| 176 | + android:visibility="@{hasRate.get() ? View.VISIBLE : View.GONE}" /> | ||
| 177 | + | ||
| 178 | + <android.support.v7.widget.SwitchCompat | ||
| 179 | + android:id="@+id/barrage_top" | ||
| 180 | + android:layout_width="wrap_content" | ||
| 181 | + android:layout_height="wrap_content" | ||
| 182 | + android:layout_centerVertical="true" | ||
| 183 | + android:background="@null" | ||
| 184 | + android:textIsSelectable="false" | ||
| 185 | + android:layout_marginRight="10dp" | ||
| 186 | + android:layout_toLeftOf="@+id/rate" | ||
| 187 | + android:thumb="@drawable/switch_thumb" | ||
| 188 | + app:switchMinWidth="15dp" | ||
| 189 | + app:track="@drawable/switch_track" /> | ||
| 190 | + | ||
| 191 | + </RelativeLayout> | ||
| 182 | 192 | ||
| 183 | </RelativeLayout> | 193 | </RelativeLayout> |
| 184 | 194 |
app/src/main/res/layout/layout_player_controller_live_p.xml
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | <RelativeLayout | 52 | <RelativeLayout |
| 53 | android:id="@+id/bottomLayout" | 53 | android:id="@+id/bottomLayout" |
| 54 | android:layout_width="match_parent" | 54 | android:layout_width="match_parent" |
| 55 | - android:layout_height="wrap_content" | 55 | + android:layout_height="40dp" |
| 56 | android:background="#44000000" | 56 | android:background="#44000000" |
| 57 | android:layout_alignParentBottom="true" | 57 | android:layout_alignParentBottom="true" |
| 58 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> | 58 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> |
| @@ -62,15 +62,17 @@ | @@ -62,15 +62,17 @@ | ||
| 62 | android:layout_width="30dp" | 62 | android:layout_width="30dp" |
| 63 | android:layout_height="30dp" | 63 | android:layout_height="30dp" |
| 64 | android:layout_marginRight="5dp" | 64 | android:layout_marginRight="5dp" |
| 65 | + android:layout_marginLeft="10dp" | ||
| 66 | + android:layout_centerVertical="true" | ||
| 65 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" | 67 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" |
| 66 | android:onClick="@{playerControllerView.onClick}"/> | 68 | android:onClick="@{playerControllerView.onClick}"/> |
| 67 | 69 | ||
| 68 | - | ||
| 69 | - | ||
| 70 | <ImageView | 70 | <ImageView |
| 71 | android:id="@+id/fullScreen" | 71 | android:id="@+id/fullScreen" |
| 72 | - android:layout_width="30dp" | ||
| 73 | - android:layout_height="30dp" | 72 | + android:layout_width="25dp" |
| 73 | + android:layout_height="25dp" | ||
| 74 | + android:layout_centerVertical="true" | ||
| 75 | + android:layout_marginRight="10dp" | ||
| 74 | android:src="@drawable/player_full_screen" | 76 | android:src="@drawable/player_full_screen" |
| 75 | android:layout_alignParentRight="true" | 77 | android:layout_alignParentRight="true" |
| 76 | android:onClick="@{playerControllerView.onClick}"/> | 78 | android:onClick="@{playerControllerView.onClick}"/> |
app/src/main/res/layout/layout_player_controller_ugc_live_l.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | - xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| 4 | - > | 3 | + xmlns:app="http://schemas.android.com/apk/res-auto"> |
| 5 | 4 | ||
| 6 | <data> | 5 | <data> |
| 7 | 6 | ||
| @@ -9,7 +8,7 @@ | @@ -9,7 +8,7 @@ | ||
| 9 | 8 | ||
| 10 | <import type="android.databinding.ObservableBoolean" /> | 9 | <import type="android.databinding.ObservableBoolean" /> |
| 11 | 10 | ||
| 12 | - <import type="com.cnlive.gundam.video.view.PlayerControllerView"/> | 11 | + <import type="com.cnlive.gundam.video.view.PlayerControllerView" /> |
| 13 | 12 | ||
| 14 | <import type="android.view.View" /> | 13 | <import type="android.view.View" /> |
| 15 | 14 | ||
| @@ -27,7 +26,7 @@ | @@ -27,7 +26,7 @@ | ||
| 27 | 26 | ||
| 28 | <variable | 27 | <variable |
| 29 | name="playerControllerView" | 28 | name="playerControllerView" |
| 30 | - type="PlayerControllerView"/> | 29 | + type="PlayerControllerView" /> |
| 31 | 30 | ||
| 32 | </data> | 31 | </data> |
| 33 | 32 | ||
| @@ -47,8 +46,8 @@ | @@ -47,8 +46,8 @@ | ||
| 47 | android:layout_width="30dp" | 46 | android:layout_width="30dp" |
| 48 | android:layout_height="30dp" | 47 | android:layout_height="30dp" |
| 49 | android:layout_marginLeft="10dp" | 48 | android:layout_marginLeft="10dp" |
| 50 | - android:src="@drawable/player_back" | ||
| 51 | - android:onClick="@{playerControllerView.onClick}"/> | 49 | + android:onClick="@{playerControllerView.onClick}" |
| 50 | + android:src="@drawable/player_back" /> | ||
| 52 | 51 | ||
| 53 | <TextView | 52 | <TextView |
| 54 | android:id="@+id/title" | 53 | android:id="@+id/title" |
| @@ -75,9 +74,8 @@ | @@ -75,9 +74,8 @@ | ||
| 75 | android:layout_height="30dp" | 74 | android:layout_height="30dp" |
| 76 | android:layout_marginRight="5dp" | 75 | android:layout_marginRight="5dp" |
| 77 | android:onClick="@{playerControllerView.onClick}" | 76 | android:onClick="@{playerControllerView.onClick}" |
| 78 | - android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> | ||
| 79 | - | ||
| 80 | - | 77 | + android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" |
| 78 | + android:visibility="gone" /> | ||
| 81 | 79 | ||
| 82 | </RelativeLayout> | 80 | </RelativeLayout> |
| 83 | 81 |
app/src/main/res/layout/layout_player_controller_ugc_live_p.xml
| @@ -63,6 +63,7 @@ | @@ -63,6 +63,7 @@ | ||
| 63 | android:layout_width="30dp" | 63 | android:layout_width="30dp" |
| 64 | android:layout_height="30dp" | 64 | android:layout_height="30dp" |
| 65 | android:layout_marginRight="5dp" | 65 | android:layout_marginRight="5dp" |
| 66 | + android:visibility="gone" | ||
| 66 | android:onClick="@{playerControllerView.onClick}" | 67 | android:onClick="@{playerControllerView.onClick}" |
| 67 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}"/> | 68 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}"/> |
| 68 | 69 |
app/src/main/res/layout/layout_player_controller_ugc_vod_l.xml
| @@ -92,6 +92,7 @@ | @@ -92,6 +92,7 @@ | ||
| 92 | android:layout_width="30dp" | 92 | android:layout_width="30dp" |
| 93 | android:layout_height="30dp" | 93 | android:layout_height="30dp" |
| 94 | android:layout_marginRight="5dp" | 94 | android:layout_marginRight="5dp" |
| 95 | + android:layout_marginLeft="10dp" | ||
| 95 | android:onClick="@{playerControllerView.onClick}" | 96 | android:onClick="@{playerControllerView.onClick}" |
| 96 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> | 97 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> |
| 97 | 98 |
app/src/main/res/layout/layout_player_controller_ugc_vod_p.xml
| @@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
| 60 | <RelativeLayout | 60 | <RelativeLayout |
| 61 | android:id="@+id/bottomLayout" | 61 | android:id="@+id/bottomLayout" |
| 62 | android:layout_width="match_parent" | 62 | android:layout_width="match_parent" |
| 63 | - android:layout_height="wrap_content" | 63 | + android:layout_height="40dp" |
| 64 | android:background="#44000000" | 64 | android:background="#44000000" |
| 65 | android:layout_alignParentBottom="true" | 65 | android:layout_alignParentBottom="true" |
| 66 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> | 66 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> |
| @@ -70,6 +70,8 @@ | @@ -70,6 +70,8 @@ | ||
| 70 | android:layout_width="30dp" | 70 | android:layout_width="30dp" |
| 71 | android:layout_height="30dp" | 71 | android:layout_height="30dp" |
| 72 | android:layout_marginRight="5dp" | 72 | android:layout_marginRight="5dp" |
| 73 | + android:layout_marginLeft="10dp" | ||
| 74 | + android:layout_centerVertical="true" | ||
| 73 | android:onClick="@{playerControllerView.onClick}" | 75 | android:onClick="@{playerControllerView.onClick}" |
| 74 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}"/> | 76 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}"/> |
| 75 | 77 |
app/src/main/res/layout/layout_player_controller_vod_l.xml
| @@ -179,6 +179,7 @@ | @@ -179,6 +179,7 @@ | ||
| 179 | android:layout_width="30dp" | 179 | android:layout_width="30dp" |
| 180 | android:layout_height="30dp" | 180 | android:layout_height="30dp" |
| 181 | android:layout_marginRight="5dp" | 181 | android:layout_marginRight="5dp" |
| 182 | + android:layout_marginLeft="10dp" | ||
| 182 | android:onClick="@{playerControllerView.onClick}" | 183 | android:onClick="@{playerControllerView.onClick}" |
| 183 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> | 184 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" /> |
| 184 | 185 |
app/src/main/res/layout/layout_player_controller_vod_p.xml
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | <RelativeLayout | 61 | <RelativeLayout |
| 62 | android:id="@+id/bottomLayout" | 62 | android:id="@+id/bottomLayout" |
| 63 | android:layout_width="match_parent" | 63 | android:layout_width="match_parent" |
| 64 | - android:layout_height="wrap_content" | 64 | + android:layout_height="40dp" |
| 65 | android:background="#44000000" | 65 | android:background="#44000000" |
| 66 | android:layout_alignParentBottom="true" | 66 | android:layout_alignParentBottom="true" |
| 67 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> | 67 | android:visibility="@{showController.get() ? View.VISIBLE : View.GONE}"> |
| @@ -71,8 +71,10 @@ | @@ -71,8 +71,10 @@ | ||
| 71 | android:layout_width="30dp" | 71 | android:layout_width="30dp" |
| 72 | android:layout_height="30dp" | 72 | android:layout_height="30dp" |
| 73 | android:layout_marginRight="5dp" | 73 | android:layout_marginRight="5dp" |
| 74 | + android:layout_marginLeft="10dp" | ||
| 74 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" | 75 | android:src="@{isPlay ? @drawable/player_play : @drawable/player_pause}" |
| 75 | - android:onClick="@{playerControllerView.onClick}"/> | 76 | + android:onClick="@{playerControllerView.onClick}" |
| 77 | + android:layout_centerVertical="true"/> | ||
| 76 | 78 | ||
| 77 | <TextView | 79 | <TextView |
| 78 | android:id="@+id/curTime" | 80 | android:id="@+id/curTime" |
| @@ -106,10 +108,12 @@ | @@ -106,10 +108,12 @@ | ||
| 106 | 108 | ||
| 107 | <ImageView | 109 | <ImageView |
| 108 | android:id="@+id/fullScreen" | 110 | android:id="@+id/fullScreen" |
| 109 | - android:layout_width="30dp" | ||
| 110 | - android:layout_height="30dp" | 111 | + android:layout_width="25dp" |
| 112 | + android:layout_height="25dp" | ||
| 111 | android:src="@drawable/player_full_screen" | 113 | android:src="@drawable/player_full_screen" |
| 112 | android:layout_alignParentRight="true" | 114 | android:layout_alignParentRight="true" |
| 115 | + android:layout_centerVertical="true" | ||
| 116 | + android:layout_marginRight="10dp" | ||
| 113 | android:onClick="@{playerControllerView.onClick}"/> | 117 | android:onClick="@{playerControllerView.onClick}"/> |
| 114 | 118 | ||
| 115 | </RelativeLayout> | 119 | </RelativeLayout> |
app/src/main/res/layout/layout_player_ugc_info.xml
| @@ -168,13 +168,14 @@ | @@ -168,13 +168,14 @@ | ||
| 168 | android:layout_height="match_parent" | 168 | android:layout_height="match_parent" |
| 169 | android:visibility="@{showType.get() == PlayerInfoView.SHOW_UGC_LIVE_STATUS ? View.VISIBLE : View.GONE}" | 169 | android:visibility="@{showType.get() == PlayerInfoView.SHOW_UGC_LIVE_STATUS ? View.VISIBLE : View.GONE}" |
| 170 | tools:visibility="gone" | 170 | tools:visibility="gone" |
| 171 | - android:background="#000000"> | 171 | + android:background="@color/play_status_bg"> |
| 172 | 172 | ||
| 173 | <TextView | 173 | <TextView |
| 174 | android:layout_width="wrap_content" | 174 | android:layout_width="wrap_content" |
| 175 | android:layout_height="wrap_content" | 175 | android:layout_height="wrap_content" |
| 176 | android:text="@{statusMsg.get()}" | 176 | android:text="@{statusMsg.get()}" |
| 177 | android:gravity="center" | 177 | android:gravity="center" |
| 178 | + android:background="@drawable/player_btn_bg" | ||
| 178 | android:textColor="@android:color/white" | 179 | android:textColor="@android:color/white" |
| 179 | android:layout_centerInParent="true"/> | 180 | android:layout_centerInParent="true"/> |
| 180 | 181 |
app/src/main/res/values/colors.xml