Commit dcb12a4f66144e51a17bc617f43a128fac2bdb00
1 parent
4003f582
修改页面
Showing
11 changed files
with
54 additions
and
29 deletions
app/src/main/java/com/cnlive/gundam/main/ui/fragment/ConfigFragment.java
| @@ -8,6 +8,7 @@ import android.support.v4.app.Fragment; | @@ -8,6 +8,7 @@ import android.support.v4.app.Fragment; | ||
| 8 | import android.view.LayoutInflater; | 8 | import android.view.LayoutInflater; |
| 9 | import android.view.View; | 9 | import android.view.View; |
| 10 | import android.view.ViewGroup; | 10 | import android.view.ViewGroup; |
| 11 | +import android.widget.TextView; | ||
| 11 | 12 | ||
| 12 | import com.bumptech.glide.Glide; | 13 | import com.bumptech.glide.Glide; |
| 13 | import com.cnlive.gundam.R; | 14 | import com.cnlive.gundam.R; |
| @@ -47,6 +48,8 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | @@ -47,6 +48,8 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { | ||
| 47 | } | 48 | } |
| 48 | 49 | ||
| 49 | private void initUI() { | 50 | private void initUI() { |
| 51 | + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | ||
| 52 | + if (titleText != null) titleText.setText("我 的"); | ||
| 50 | binding.configHeader.setOnClickListener(this); | 53 | binding.configHeader.setOnClickListener(this); |
| 51 | binding.message.setOnClickListener(this); | 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,6 +9,7 @@ import android.support.v7.widget.LinearLayoutManager; | ||
| 9 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
| 10 | import android.view.View; | 10 | import android.view.View; |
| 11 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
| 12 | +import android.widget.TextView; | ||
| 12 | import android.widget.Toast; | 13 | import android.widget.Toast; |
| 13 | 14 | ||
| 14 | import com.cnlive.gundam.BR; | 15 | import com.cnlive.gundam.BR; |
| @@ -60,6 +61,8 @@ public class HomeFragment extends Fragment implements SwipeRefreshLayout.OnRefre | @@ -60,6 +61,8 @@ public class HomeFragment extends Fragment implements SwipeRefreshLayout.OnRefre | ||
| 60 | @Override | 61 | @Override |
| 61 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 62 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 62 | super.onViewCreated(view, savedInstanceState); | 63 | super.onViewCreated(view, savedInstanceState); |
| 64 | + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | ||
| 65 | + if (titleText != null) titleText.setText("点播列表"); | ||
| 63 | loadData(); | 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,6 +8,7 @@ import android.support.v7.widget.LinearLayoutManager; | ||
| 8 | import android.view.LayoutInflater; | 8 | import android.view.LayoutInflater; |
| 9 | import android.view.View; | 9 | import android.view.View; |
| 10 | import android.view.ViewGroup; | 10 | import android.view.ViewGroup; |
| 11 | +import android.widget.TextView; | ||
| 11 | 12 | ||
| 12 | import com.cnlive.gundam.BR; | 13 | import com.cnlive.gundam.BR; |
| 13 | import com.cnlive.gundam.R; | 14 | import com.cnlive.gundam.R; |
| @@ -42,6 +43,8 @@ public class LiveFragment extends Fragment implements DataBindingAdapter.OnAdapt | @@ -42,6 +43,8 @@ public class LiveFragment extends Fragment implements DataBindingAdapter.OnAdapt | ||
| 42 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 43 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 43 | super.onViewCreated(view, savedInstanceState); | 44 | super.onViewCreated(view, savedInstanceState); |
| 44 | initData(); | 45 | initData(); |
| 46 | + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | ||
| 47 | + if (titleText != null) titleText.setText("直播列表"); | ||
| 45 | binding.setListAdapter(adapter = new DataBindingAdapter(getActivity(), R.layout.layout_item_video_list, BR.program)); | 48 | binding.setListAdapter(adapter = new DataBindingAdapter(getActivity(), R.layout.layout_item_video_list, BR.program)); |
| 46 | binding.setLayoutManager(new LinearLayoutManager(getActivity())); | 49 | binding.setLayoutManager(new LinearLayoutManager(getActivity())); |
| 47 | adapter.updateItems(programs); | 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,6 +9,7 @@ import android.support.v7.widget.LinearLayoutManager; | ||
| 9 | import android.view.LayoutInflater; | 9 | import android.view.LayoutInflater; |
| 10 | import android.view.View; | 10 | import android.view.View; |
| 11 | import android.view.ViewGroup; | 11 | import android.view.ViewGroup; |
| 12 | +import android.widget.TextView; | ||
| 12 | import android.widget.Toast; | 13 | import android.widget.Toast; |
| 13 | 14 | ||
| 14 | import com.cnlive.gundam.BR; | 15 | import com.cnlive.gundam.BR; |
| @@ -60,6 +61,8 @@ public class UGCListFragment extends Fragment implements SwipeRefreshLayout.OnRe | @@ -60,6 +61,8 @@ public class UGCListFragment extends Fragment implements SwipeRefreshLayout.OnRe | ||
| 60 | @Override | 61 | @Override |
| 61 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | 62 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 62 | super.onViewCreated(view, savedInstanceState); | 63 | super.onViewCreated(view, savedInstanceState); |
| 64 | + TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | ||
| 65 | + if (titleText != null) titleText.setText("ugc列表"); | ||
| 63 | loadData(); | 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,7 +49,7 @@ 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 | - //记录当前视频状态是否结束 | 52 | + //记录当前视频状态是否结束,结束后就不再播 |
| 53 | protected boolean isStatusEnd = false; | 53 | protected boolean isStatusEnd = false; |
| 54 | //本地缓存数据工具类 | 54 | //本地缓存数据工具类 |
| 55 | private SharedPreferencesHelper sharedPreferencesHelper; | 55 | private SharedPreferencesHelper sharedPreferencesHelper; |
| @@ -328,11 +328,13 @@ public abstract class BaseVideoView extends RelativeLayout implements | @@ -328,11 +328,13 @@ public abstract class BaseVideoView extends RelativeLayout implements | ||
| 328 | break; | 328 | break; |
| 329 | case IVideoStatus.MEDIA_STATUS_END: | 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 | break; | 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
| @@ -19,7 +19,12 @@ | @@ -19,7 +19,12 @@ | ||
| 19 | android:layout_height="match_parent" | 19 | android:layout_height="match_parent" |
| 20 | android:fitsSystemWindows="true"> | 20 | android:fitsSystemWindows="true"> |
| 21 | 21 | ||
| 22 | + <include | ||
| 23 | + android:id="@+id/toolbarLayout" | ||
| 24 | + layout="@layout/layout_actionbar"/> | ||
| 25 | + | ||
| 22 | <android.support.v4.widget.SwipeRefreshLayout | 26 | <android.support.v4.widget.SwipeRefreshLayout |
| 27 | + android:layout_below="@+id/toolbarLayout" | ||
| 23 | android:id="@+id/contentView" | 28 | android:id="@+id/contentView" |
| 24 | android:layout_width="match_parent" | 29 | android:layout_width="match_parent" |
| 25 | android:layout_height="match_parent"> | 30 | android:layout_height="match_parent"> |
app/src/main/res/layout/fragment_live.xml
| @@ -21,7 +21,12 @@ | @@ -21,7 +21,12 @@ | ||
| 21 | android:layout_width="match_parent" | 21 | android:layout_width="match_parent" |
| 22 | android:layout_height="match_parent"> | 22 | android:layout_height="match_parent"> |
| 23 | 23 | ||
| 24 | + <include | ||
| 25 | + android:id="@+id/toolbarLayout" | ||
| 26 | + layout="@layout/layout_actionbar"/> | ||
| 27 | + | ||
| 24 | <android.support.v7.widget.RecyclerView | 28 | <android.support.v7.widget.RecyclerView |
| 29 | + android:layout_below="@+id/toolbarLayout" | ||
| 25 | android:id="@+id/recyclerView" | 30 | android:id="@+id/recyclerView" |
| 26 | android:layout_width="match_parent" | 31 | android:layout_width="match_parent" |
| 27 | android:layout_height="match_parent" | 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 | \ No newline at end of file | 23 | \ No newline at end of file |
app/src/main/res/layout/layout_actionbar_back.xml
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | android:layout_height="?attr/actionBarSize" | 8 | android:layout_height="?attr/actionBarSize" |
| 9 | android:theme="@style/ThemeOverlay.AppCompat.Light" | 9 | android:theme="@style/ThemeOverlay.AppCompat.Light" |
| 10 | app:contentInsetEnd="?attr/actionBarSize" | 10 | app:contentInsetEnd="?attr/actionBarSize" |
| 11 | - android:background="@android:color/white" | 11 | + android:background="@drawable/toolbar_bg" |
| 12 | android:visibility="gone" | 12 | android:visibility="gone" |
| 13 | tools:visibility="visible"> | 13 | tools:visibility="visible"> |
| 14 | 14 |
app/src/main/res/layout/user_fragment.xml
| @@ -9,28 +9,7 @@ | @@ -9,28 +9,7 @@ | ||
| 9 | android:layout_height="match_parent" | 9 | android:layout_height="match_parent" |
| 10 | android:orientation="vertical"> | 10 | android:orientation="vertical"> |
| 11 | 11 | ||
| 12 | - <RelativeLayout | ||
| 13 | - android:layout_width="match_parent" | ||
| 14 | - android:layout_height="48dp"> | ||
| 15 | - | ||
| 16 | - <TextView | ||
| 17 | - android:layout_width="wrap_content" | ||
| 18 | - android:layout_height="wrap_content" | ||
| 19 | - android:layout_centerInParent="true" | ||
| 20 | - android:singleLine="true" | ||
| 21 | - android:text="我的" | ||
| 22 | - android:textColor="@color/config_black_color" | ||
| 23 | - android:textSize="22sp" /> | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - </RelativeLayout> | ||
| 27 | - | ||
| 28 | - <View | ||
| 29 | - android:layout_width="match_parent" | ||
| 30 | - android:layout_height="1px" | ||
| 31 | - android:layout_marginBottom="@dimen/_20px" | ||
| 32 | - android:background="@color/gray_line_color" /> | ||
| 33 | - | 12 | + <include layout="@layout/layout_actionbar"/> |
| 34 | 13 | ||
| 35 | <RelativeLayout | 14 | <RelativeLayout |
| 36 | android:id="@+id/config_header" | 15 | android:id="@+id/config_header" |