Commit d420e653cd0656e8ef01593c53a0b833661b01d6

Authored by 陈硕
2 parents 6a02bd92 0b036bf6

解决冲突

app/src/main/java/com/cnlive/gundam/main/ui/fragment/ConfigFragment.java
... ... @@ -8,6 +8,7 @@ import android.support.v4.app.Fragment;
8 8 import android.view.LayoutInflater;
9 9 import android.view.View;
10 10 import android.view.ViewGroup;
  11 +import android.widget.TextView;
11 12  
12 13 import com.bumptech.glide.Glide;
13 14 import com.cnlive.gundam.R;
... ... @@ -47,6 +48,8 @@ public class ConfigFragment extends Fragment implements View.OnClickListener {
47 48 }
48 49  
49 50 private void initUI() {
  51 + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle);
  52 + if (titleText != null) titleText.setText("我 的");
50 53 binding.configHeader.setOnClickListener(this);
51 54 binding.message.setOnClickListener(this);
52 55 }
... ...
app/src/main/java/com/cnlive/gundam/main/ui/fragment/HomeFragment.java
... ... @@ -9,6 +9,7 @@ import android.support.v7.widget.LinearLayoutManager;
9 9 import android.view.LayoutInflater;
10 10 import android.view.View;
11 11 import android.view.ViewGroup;
  12 +import android.widget.TextView;
12 13 import android.widget.Toast;
13 14  
14 15 import com.cnlive.gundam.BR;
... ... @@ -60,6 +61,8 @@ public class HomeFragment extends Fragment implements SwipeRefreshLayout.OnRefre
60 61 @Override
61 62 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
62 63 super.onViewCreated(view, savedInstanceState);
  64 + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle);
  65 + if (titleText != null) titleText.setText("点播列表");
63 66 loadData();
64 67 }
65 68  
... ...
app/src/main/java/com/cnlive/gundam/main/ui/fragment/LiveFragment.java
... ... @@ -8,6 +8,7 @@ import android.support.v7.widget.LinearLayoutManager;
8 8 import android.view.LayoutInflater;
9 9 import android.view.View;
10 10 import android.view.ViewGroup;
  11 +import android.widget.TextView;
11 12  
12 13 import com.cnlive.gundam.BR;
13 14 import com.cnlive.gundam.R;
... ... @@ -42,6 +43,8 @@ public class LiveFragment extends Fragment implements DataBindingAdapter.OnAdapt
42 43 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
43 44 super.onViewCreated(view, savedInstanceState);
44 45 initData();
  46 + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle);
  47 + if (titleText != null) titleText.setText("直播列表");
45 48 binding.setListAdapter(adapter = new DataBindingAdapter(getActivity(), R.layout.layout_item_video_list, BR.program));
46 49 binding.setLayoutManager(new LinearLayoutManager(getActivity()));
47 50 adapter.updateItems(programs);
... ...
app/src/main/java/com/cnlive/gundam/main/ui/fragment/UGCListFragment.java
... ... @@ -9,6 +9,7 @@ import android.support.v7.widget.LinearLayoutManager;
9 9 import android.view.LayoutInflater;
10 10 import android.view.View;
11 11 import android.view.ViewGroup;
  12 +import android.widget.TextView;
12 13 import android.widget.Toast;
13 14  
14 15 import com.cnlive.gundam.BR;
... ... @@ -60,6 +61,8 @@ public class UGCListFragment extends Fragment implements SwipeRefreshLayout.OnRe
60 61 @Override
61 62 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
62 63 super.onViewCreated(view, savedInstanceState);
  64 + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle);
  65 + if (titleText != null) titleText.setText("ugc列表");
63 66 loadData();
64 67 }
65 68  
... ...
app/src/main/java/com/cnlive/gundam/video/view/BaseVideoView.java
... ... @@ -49,7 +49,7 @@ public abstract class BaseVideoView extends RelativeLayout implements
49 49 protected static boolean isLive;
50 50 //记录当前视频是否能播
51 51 protected boolean canPlay = true;
52   - //记录当前视频状态是否结束
  52 + //记录当前视频状态是否结束,结束后就不再播
53 53 protected boolean isStatusEnd = false;
54 54 //本地缓存数据工具类
55 55 private SharedPreferencesHelper sharedPreferencesHelper;
... ... @@ -328,11 +328,13 @@ public abstract class BaseVideoView extends RelativeLayout implements
328 328 break;
329 329 case IVideoStatus.MEDIA_STATUS_END:
330 330 //直播结束
331   - canPlay = false;
332   - isPlay = false;
333   - isStatusEnd = true;
334   - binding.videoView.release();
335   - binding.infoView.show(PlayerInfoView.SHOW_UGC_LIVE_STATUS, getContext().getString(R.string.player_status_end));
  331 + if (!isStatusEnd) {
  332 + canPlay = false;
  333 + isPlay = false;
  334 + isStatusEnd = true;
  335 + binding.videoView.release();
  336 + binding.infoView.show(PlayerInfoView.SHOW_UGC_LIVE_STATUS, getContext().getString(R.string.player_status_end));
  337 + }
336 338 break;
337 339 }
338 340  
... ...
app/src/main/res/drawable-xxhdpi/toolbar_bg.9.png 0 → 100644

94 Bytes

app/src/main/res/layout/fragment_active_list.xml
... ... @@ -21,7 +21,12 @@
21 21 android:layout_height="match_parent"
22 22 android:fitsSystemWindows="true">
23 23  
  24 + <include
  25 + android:id="@+id/toolbarLayout"
  26 + layout="@layout/layout_actionbar"/>
  27 +
24 28 <android.support.v4.widget.SwipeRefreshLayout
  29 + android:layout_below="@+id/toolbarLayout"
25 30 android:id="@+id/contentView"
26 31 android:layout_width="match_parent"
27 32 android:layout_height="match_parent">
... ...
app/src/main/res/layout/layout_actionbar.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +
  3 +<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
  4 + android:id="@+id/toolbar"
  5 + xmlns:tools="http://schemas.android.com/tools"
  6 + android:layout_width="match_parent"
  7 + android:layout_height="?attr/actionBarSize"
  8 + android:theme="@style/ThemeOverlay.AppCompat.Light"
  9 + android:background="@drawable/toolbar_bg"
  10 + tools:visibility="visible">
  11 +
  12 +
  13 + <TextView
  14 + android:id="@+id/toolbarTitle"
  15 + style="@style/ActionbarTitleStyle"
  16 + android:layout_width="wrap_content"
  17 + android:layout_height="wrap_content"
  18 + android:layout_gravity="center"
  19 + android:lines="1"
  20 + tools:text="here is title"/>
  21 +
  22 +</android.support.v7.widget.Toolbar>
0 23 \ No newline at end of file
... ...
app/src/main/res/layout/layout_actionbar_back.xml
... ... @@ -8,7 +8,7 @@
8 8 android:layout_height="?attr/actionBarSize"
9 9 android:theme="@style/ThemeOverlay.AppCompat.Light"
10 10 app:contentInsetEnd="?attr/actionBarSize"
11   - android:background="@android:color/white"
  11 + android:background="@drawable/toolbar_bg"
12 12 android:visibility="gone"
13 13 tools:visibility="visible">
14 14  
... ...