Skip to content

Commit

Permalink
增加代码块
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeterry committed Feb 2, 2017
1 parent 89f3b47 commit e815d0b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Config in xml:

![show](showUI/show3.gif)</br>
Use it in your own code:</br>
1.setTitle(String title):Set the CoordinatorTabLayout's title.</br>
2.setupWithViewPager(ViewPager viewPager):To link the two together.</br>
3.setImageArray(int[] imageArray):Set the image array of the header according to the number of tabs and pass it to the control.</br>
1.`setTitle(String title)`:Set the CoordinatorTabLayout's title.</br>
2.`setupWithViewPager(ViewPager viewPager)`:To link the two together.</br>
3.`setImageArray(int[] imageArray)`:Set the image array of the header according to the number of tabs and pass it to the control.</br>
```
//Add the fragment to the viewpager
initFragments();
Expand All @@ -74,7 +74,7 @@ Finish, enjoy it.

![show](showUI/show2.gif)

setImageArray(int[] imageArray, int[] colorArray):Set the color array to use for the content scrim for each tab.
`setImageArray(int[] imageArray, int[] colorArray)`:Set the color array to use for the content scrim for each tab.
```
mColorArray = new int[]{
android.R.color.holo_blue_light,
Expand All @@ -85,7 +85,7 @@ setImageArray(int[] imageArray, int[] colorArray):Set the color array to use for
```

###set back enable
setBackEnable(Boolean canBack):To enable the Up button for an activity that has a parent activity.
`setBackEnable(Boolean canBack)`:To enable the Up button for an activity that has a parent activity.
```
@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -103,16 +103,16 @@ setBackEnable(Boolean canBack):To enable the Up button for an activity that has
```

###Gets the child control
getActionBar():get the ActionBar
getTabLayout():get the TabLayout
`getActionBar()`:get the ActionBar<br/>
`getTabLayout()`:get the TabLayout

[More code](https://github.com/hugeterry/CoordinatorTabLayout/blob/master/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/MainActivity.java)


##Attributes
- app:contentScrim -> color.Defaults to ?attr/colorPrimary
- app:tabIndicatorColor -> color.
- app:tabTextColor -> color.
- `app:contentScrim` -> color.Defaults to ?attr/colorPrimary
- `app:tabIndicatorColor` -> color.
- `app:tabTextColor` -> color.

##Demo
[http://fir.im/ctlayout](http://fir.im/ctlayout)
Expand Down
20 changes: 10 additions & 10 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ dependencies {

![show](showUI/show3.gif)</br>
在使用它的界面添加以下设置:</br>
1.setTitle(String title):设置Toolbar标题</br>
2.setupWithViewPager(ViewPager viewPager):将写好的viewpager设置到该控件当中</br>
3.setImageArray(int[] imageArray):根据tab数量设置好头部的图片数组,并传到该控件当中
1.`setTitle(String title)`:设置Toolbar标题</br>
2.`setupWithViewPager(ViewPager viewPager)`:将写好的viewpager设置到该控件当中</br>
3.`setImageArray(int[] imageArray)`:根据tab数量设置好头部的图片数组,并传到该控件当中
```
//构建写好的fragment加入到viewpager中
initFragments();
Expand All @@ -72,7 +72,7 @@ dependencies {

![show](showUI/show2.gif)

setImageArray(int[] imageArray, int[] colorArray):如果你想要有头部折叠后的颜色变化,可将之前设置好的图片数组以及根据tab数量设置的颜色数组传到该控件当中
`setImageArray(int[] imageArray, int[] colorArray)`:如果你想要有头部折叠后的颜色变化,可将之前设置好的图片数组以及根据tab数量设置的颜色数组传到该控件当中
```
mColorArray = new int[]{
android.R.color.holo_blue_light,
Expand All @@ -84,7 +84,7 @@ setImageArray(int[] imageArray, int[] colorArray):如果你想要有头部折叠

###添加返回

setBackEnable(Boolean canBack):设置Toolbar的返回按钮
`setBackEnable(Boolean canBack)`:设置Toolbar的返回按钮
```
@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -103,17 +103,17 @@ setBackEnable(Boolean canBack):设置Toolbar的返回按钮

###获取子控件

getActionBar():获取该组件中的ActionBar
getTabLayout():获取该组件中的TabLayout
`getActionBar()`:获取该组件中的ActionBar
`getTabLayout()`:获取该组件中的TabLayout

[更多代码](https://github.com/hugeterry/CoordinatorTabLayout/blob/master/sample/src/main/java/cn/hugeterry/coordinatortablayoutdemo/MainActivity.java)


##属性

- app:contentScrim -> color.默认为?attr/colorPrimary
- app:tabIndicatorColor -> color.
- app:tabTextColor -> color.
- `app:contentScrim` -> color.默认为?attr/colorPrimary
- `app:tabIndicatorColor` -> color.
- `app:tabTextColor` -> color.

##Demo
[http://fir.im/ctlayout](http://fir.im/ctlayout)
Expand Down

0 comments on commit e815d0b

Please sign in to comment.