Commit 268e991abd9dfa165f08a217d0aab4a55023cb91
1 parent
d420e653
修改标题栏
Showing
8 changed files
with
41 additions
and
74 deletions
app/src/main/java/com/cnlive/gundam/main/ui/fragment/ConfigFragment.java
| ... | ... | @@ -20,6 +20,7 @@ import com.cnlive.gundam.user.auth.UserService; |
| 20 | 20 | import com.cnlive.gundam.user.model.User; |
| 21 | 21 | |
| 22 | 22 | |
| 23 | + | |
| 23 | 24 | /** |
| 24 | 25 | * Created by xiansong on 2017/6/27. |
| 25 | 26 | */ |
| ... | ... | @@ -48,7 +49,7 @@ public class ConfigFragment extends Fragment implements View.OnClickListener { |
| 48 | 49 | } |
| 49 | 50 | |
| 50 | 51 | private void initUI() { |
| 51 | - TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | |
| 52 | + TextView titleText = binding.getRoot().findViewById(R.id.toobar_tv); | |
| 52 | 53 | if (titleText != null) titleText.setText("我 的"); |
| 53 | 54 | binding.configHeader.setOnClickListener(this); |
| 54 | 55 | binding.message.setOnClickListener(this); | ... | ... |
app/src/main/java/com/cnlive/gundam/main/ui/fragment/HomeFragment.java
| ... | ... | @@ -61,7 +61,7 @@ public class HomeFragment extends Fragment implements SwipeRefreshLayout.OnRefre |
| 61 | 61 | @Override |
| 62 | 62 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 63 | 63 | super.onViewCreated(view, savedInstanceState); |
| 64 | - TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | |
| 64 | + TextView titleText = binding.getRoot().findViewById(R.id.toobar_tv); | |
| 65 | 65 | if (titleText != null) titleText.setText("点播列表"); |
| 66 | 66 | loadData(); |
| 67 | 67 | } | ... | ... |
app/src/main/java/com/cnlive/gundam/main/ui/fragment/LiveFragment.java
| ... | ... | @@ -43,7 +43,7 @@ public class LiveFragment extends Fragment implements DataBindingAdapter.OnAdapt |
| 43 | 43 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 44 | 44 | super.onViewCreated(view, savedInstanceState); |
| 45 | 45 | initData(); |
| 46 | - TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | |
| 46 | + TextView titleText = binding.getRoot().findViewById(R.id.toobar_tv); | |
| 47 | 47 | if (titleText != null) titleText.setText("直播列表"); |
| 48 | 48 | binding.setListAdapter(adapter = new DataBindingAdapter(getActivity(), R.layout.layout_item_video_list, BR.program)); |
| 49 | 49 | binding.setLayoutManager(new LinearLayoutManager(getActivity())); | ... | ... |
app/src/main/java/com/cnlive/gundam/main/ui/fragment/UGCListFragment.java
| ... | ... | @@ -61,7 +61,7 @@ public class UGCListFragment extends Fragment implements SwipeRefreshLayout.OnRe |
| 61 | 61 | @Override |
| 62 | 62 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { |
| 63 | 63 | super.onViewCreated(view, savedInstanceState); |
| 64 | - TextView titleText = binding.getRoot().findViewById(R.id.toolbarTitle); | |
| 64 | + TextView titleText = binding.getRoot().findViewById(R.id.toobar_tv); | |
| 65 | 65 | if (titleText != null) titleText.setText("ugc列表"); |
| 66 | 66 | loadData(); |
| 67 | 67 | } | ... | ... |
app/src/main/res/layout/fragment_active_list.xml
| ... | ... | @@ -21,12 +21,8 @@ |
| 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 | 25 | <android.support.v4.widget.SwipeRefreshLayout |
| 29 | - android:layout_below="@+id/toolbarLayout" | |
| 30 | 26 | android:id="@+id/contentView" |
| 31 | 27 | android:layout_width="match_parent" |
| 32 | 28 | android:layout_height="match_parent"> |
| ... | ... | @@ -35,28 +31,9 @@ |
| 35 | 31 | android:layout_width="match_parent" |
| 36 | 32 | android:layout_height="match_parent"> |
| 37 | 33 | |
| 38 | - <RelativeLayout | |
| 34 | + <include | |
| 39 | 35 | android:id="@+id/toobar" |
| 40 | - android:layout_width="match_parent" | |
| 41 | - android:layout_height="wrap_content"> | |
| 42 | - | |
| 43 | - <TextView | |
| 44 | - android:id="@+id/toobar_tv" | |
| 45 | - android:layout_width="wrap_content" | |
| 46 | - android:layout_height="wrap_content" | |
| 47 | - android:layout_centerInParent="true" | |
| 48 | - android:singleLine="true" | |
| 49 | - android:text="直播" | |
| 50 | - android:textColor="@color/config_black_color" | |
| 51 | - android:textSize="22sp" /> | |
| 52 | - | |
| 53 | - <View | |
| 54 | - android:layout_width="match_parent" | |
| 55 | - android:layout_height="1px" | |
| 56 | - android:layout_marginBottom="@dimen/_20px" | |
| 57 | - android:background="@color/gray_line_color" /> | |
| 58 | - </RelativeLayout> | |
| 59 | - | |
| 36 | + layout="@layout/item_toolbar" /> | |
| 60 | 37 | |
| 61 | 38 | <android.support.v7.widget.RecyclerView |
| 62 | 39 | android:id="@+id/recyclerView" | ... | ... |
app/src/main/res/layout/fragment_live.xml
| ... | ... | @@ -21,27 +21,9 @@ |
| 21 | 21 | android:layout_width="match_parent" |
| 22 | 22 | android:layout_height="match_parent"> |
| 23 | 23 | |
| 24 | - <RelativeLayout | |
| 24 | + <include | |
| 25 | 25 | android:id="@+id/toobar" |
| 26 | - android:layout_width="match_parent" | |
| 27 | - android:layout_height="wrap_content"> | |
| 28 | - | |
| 29 | - <TextView | |
| 30 | - android:id="@+id/toobar_tv" | |
| 31 | - android:layout_width="wrap_content" | |
| 32 | - android:layout_height="wrap_content" | |
| 33 | - android:layout_centerInParent="true" | |
| 34 | - android:singleLine="true" | |
| 35 | - android:text="电视台" | |
| 36 | - android:textColor="@color/config_black_color" | |
| 37 | - android:textSize="22sp" /> | |
| 38 | - | |
| 39 | - <View | |
| 40 | - android:layout_width="match_parent" | |
| 41 | - android:layout_height="1px" | |
| 42 | - android:layout_marginBottom="@dimen/_20px" | |
| 43 | - android:background="@color/gray_line_color" /> | |
| 44 | - </RelativeLayout> | |
| 26 | + layout="@layout/item_toolbar" /> | |
| 45 | 27 | |
| 46 | 28 | <android.support.v7.widget.RecyclerView |
| 47 | 29 | android:id="@+id/recyclerView" | ... | ... |
app/src/main/res/layout/item_toolbar.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | + > | |
| 4 | + | |
| 5 | + <RelativeLayout | |
| 6 | + android:id="@+id/toobar" | |
| 7 | + android:layout_width="match_parent" | |
| 8 | + android:layout_height="wrap_content"> | |
| 9 | + | |
| 10 | + <TextView | |
| 11 | + android:id="@+id/toobar_tv" | |
| 12 | + android:layout_width="wrap_content" | |
| 13 | + android:layout_height="wrap_content" | |
| 14 | + android:layout_centerInParent="true" | |
| 15 | + android:singleLine="true" | |
| 16 | + android:text="" | |
| 17 | + android:textColor="@color/config_black_color" | |
| 18 | + android:textSize="22sp" /> | |
| 19 | + | |
| 20 | + <View | |
| 21 | + android:layout_width="match_parent" | |
| 22 | + android:layout_height="1px" | |
| 23 | + android:layout_marginBottom="@dimen/_20px" | |
| 24 | + android:background="@color/gray_line_color" /> | |
| 25 | + </RelativeLayout> | |
| 26 | + | |
| 27 | +</layout> | |
| 0 | 28 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/user_fragment.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | |
| 3 | 3 | <layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 4 | - xmlns:cn="http://schemas.android.com/apk/res-auto" | |
| 5 | - > | |
| 4 | + xmlns:cn="http://schemas.android.com/apk/res-auto"> | |
| 6 | 5 | |
| 7 | 6 | <LinearLayout |
| 8 | 7 | android:layout_width="match_parent" |
| 9 | 8 | android:layout_height="match_parent" |
| 10 | 9 | android:orientation="vertical"> |
| 11 | 10 | |
| 12 | - <RelativeLayout | |
| 11 | + <include | |
| 13 | 12 | android:id="@+id/toobar" |
| 14 | - android:layout_width="match_parent" | |
| 15 | - android:layout_height="wrap_content"> | |
| 16 | - | |
| 17 | - <TextView | |
| 18 | - android:id="@+id/toobar_tv" | |
| 19 | - android:layout_width="wrap_content" | |
| 20 | - android:layout_height="wrap_content" | |
| 21 | - android:layout_centerInParent="true" | |
| 22 | - android:singleLine="true" | |
| 23 | - android:text="我的" | |
| 24 | - android:textColor="@color/config_black_color" | |
| 25 | - android:textSize="22sp" /> | |
| 26 | - | |
| 27 | - <View | |
| 28 | - android:layout_width="match_parent" | |
| 29 | - android:layout_height="1px" | |
| 30 | - android:layout_marginBottom="@dimen/_20px" | |
| 31 | - android:background="@color/gray_line_color" /> | |
| 32 | - </RelativeLayout> | |
| 33 | - | |
| 13 | + layout="@layout/item_toolbar" /> | |
| 34 | 14 | |
| 35 | 15 | <RelativeLayout |
| 36 | 16 | android:id="@+id/config_header" |
| ... | ... | @@ -46,8 +26,8 @@ |
| 46 | 26 | android:layout_centerVertical="true" |
| 47 | 27 | android:layout_marginLeft="11dp" |
| 48 | 28 | android:layout_marginRight="16dp" |
| 49 | - cn:border_color="@android:color/transparent" | |
| 50 | - android:src="@drawable/cnlive_user_header" /> | |
| 29 | + android:src="@drawable/cnlive_user_header" | |
| 30 | + cn:border_color="@android:color/transparent" /> | |
| 51 | 31 | |
| 52 | 32 | <LinearLayout |
| 53 | 33 | android:layout_width="wrap_content" | ... | ... |