Skip to content

Commit

Permalink
新增:将TabLayout合并至UIWidget
Browse files Browse the repository at this point in the history
优化:删除无用lib
  • Loading branch information
[email protected] authored and [email protected] committed Aug 7, 2019
1 parent ca12978 commit 1ca609f
Show file tree
Hide file tree
Showing 62 changed files with 5,031 additions and 63 deletions.
88 changes: 83 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ allprojects {

```
dependencies {
//implementation 'com.github.AriesHoo.UIWidget:widget-core:3.2.19'
//implementation 'com.github.AriesHoo.UIWidget:widget-alert:3.2.19'
//implementation 'com.github.AriesHoo.UIWidget:widget-collapsing:3.2.19'
//implementation 'com.github.AriesHoo.UIWidget:widget-core:3.2.20'
//implementation 'com.github.AriesHoo.UIWidget:widget-alert:3.2.20'
//implementation 'com.github.AriesHoo.UIWidget:widget-collapsing:3.2.20'
//implementation 'com.github.AriesHoo.UIWidget:tab-layout:3.2.20'
implementation 'com.github.AriesHoo.UIWidget:widget-core:${LATEST_VERSION}'
implementation 'com.github.AriesHoo.UIWidget:widget-alert:${LATEST_VERSION}'
implementation 'com.github.AriesHoo.UIWidget:widget-collapsing:${LATEST_VERSION}'
implementation 'com.github.AriesHoo.UIWidget:tab-layout:${LATEST_VERSION}'
}
```

Expand Down Expand Up @@ -81,7 +83,8 @@ dependencies {
<artifactId>widget-core</artifactId>
<artifactId>widget-collapsing</artifactId>
<artifactId>widget-alert</artifactId>
<version>3.2.10</version>
<artifactId>tab-layout</artifactId>
<version>3.2.20</version>
</dependency>
```

Expand Down Expand Up @@ -173,6 +176,14 @@ dependencies {

## 录屏预览

TabLayout

![](https://github.com/AriesHoo/UIWidget/blob/dev/screenshot/common.gif)

![](https://github.com/AriesHoo/UIWidget/blob/dev/screenshot/sliding.gif)

![](https://github.com/AriesHoo/UIWidget/blob/dev/screenshot/segment.gif)

刘海屏适配

![](https://github.com/AriesHoo/UIWidget/blob/dev/screenshot/Notch.gif)
Expand Down Expand Up @@ -220,7 +231,74 @@ dependencies {
![](https://github.com/AriesHoo/UIWidget/blob/dev/screenshot/keyboard03.gif)

[KeyboardHelper](https://github.com/AriesHoo/UIWidget/blob/dev/widget-core/src/main/java/com/aries/ui/helper/navigation/KeyboardHelper.java)


**TabLayout-FlycoTabLayout 2.1.2版本基础上优化修改的快速创建Tab库** [![](https://img.shields.io/badge/Forked-FlycoTabLayoutV2.1.2-green.svg)](https://github.com/H07000223/FlycoTabLayout)

## 自定义属性

修改了几个参数拼写 删除线标识为原库属性,下一行为修改后属性

|name|format|description|
|:---:|:---:|:---:|
| tl_indicator_color | color |设置显示器颜色
| tl_indicator_height | dimension |设置显示器高度
| tl_indicator_width | dimension |设置显示器固定宽度
| tl_indicator_margin_left | dimension |设置显示器margin,当indicator_width大于0,无效
| tl_indicator_margin_top | dimension |设置显示器margin,当indicator_width大于0,无效
| tl_indicator_margin_right | dimension |设置显示器margin,当indicator_width大于0,无效
| tl_indicator_margin_bottom | dimension |设置显示器margin,当indicator_width大于0,无效
| tl_indicator_corner_radius | dimension |设置显示器圆角弧度
| tl_indicator_gravity | enum |设置显示器上方(TOP)还是下方(BOTTOM),只对常规显示器有用
| tl_indicator_style | enum |设置显示器为常规(NORMAL)或三角形(TRIANGLE)或背景色块(BLOCK)
| tl_underline_color | color |设置下划线颜色
| tl_underline_height | dimension |设置下划线高度
| tl_underline_gravity | enum |设置下划线上方(TOP)还是下方(BOTTOM)
| tl_divider_color | color |设置分割线颜色
| tl_divider_width | dimension |设置分割线宽度
| tl_divider_padding |dimension| 设置分割线的paddingTop和paddingBottom
| tl_tab_padding |dimension| 设置tab的paddingLeft和paddingRight
| tl_tab_space_equal |boolean| 设置tab大小等分
| tl_tab_width |dimension| 设置tab固定大小
| ~~tl_textsize~~ |~~dimension~~| ~~设置字体大小~~
| tl_textSize |dimension| 设置字体大小
| tl_textSelectSize |dimension| 设置选中字体大小
| tl_textSelectColor |color| 设置字体选中颜色
| ~~tl_textUnselectColor~~ |~~color~~| ~~设置字体未选中颜色~~
| tl_textUnSelectColor |color| 设置字体未选中颜色
| tl_textBold |boolean| 设置字体加粗
| tl_iconWidth |dimension| 设置icon宽度(仅支持CommonTabLayout)
| tl_iconHeight |dimension|设置icon高度(仅支持CommonTabLayout)
| tl_iconVisible |boolean| 设置icon是否可见(仅支持CommonTabLayout)
| tl_iconGravity |enum| 设置icon显示位置,对应Gravity中常量值,左上右下(仅支持CommonTabLayout)
| tl_iconMargin |dimension| 设置icon与文字间距(仅支持CommonTabLayout)
| tl_indicator_anim_enable |boolean| 设置显示器支持动画(only for CommonTabLayout)
| tl_indicator_anim_duration |integer| 设置显示器动画时间(only for CommonTabLayout)
| tl_indicator_bounce_enable |boolean| 设置显示器支持动画回弹效果(only for CommonTabLayout)
| tl_indicator_width_equal_title |boolean| 设置显示器与标题一样长(only for SlidingTabLayout)

## 自定义属性java代码调用

仅自定义属性通过代理类设置其它如setCurrentTab 还是原来调用模式不变

tab.getDelegate()
.setXXX()
.setYYY();


```
mTabLayout.getDelegate()
.setTextSelectColor(ContextCompat.getColor(mContext, R.color.colorTabTextSelect))
.setTextUnSelectColor(ContextCompat.getColor(mContext, R.color.colorTabTextUnSelect))
.setUnderlineColor(ContextCompat.getColor(mContext, R.color.colorTabUnderline))
.setTextSize(TypedValue.COMPLEX_UNIT_PX, mContext.getResources().getDimensionPixelSize(R.dimen.dp_tab_text_size))
.setUnderlineGravity(Gravity.TOP)
.setUnderlineHeight(mContext.getResources().getDimension(R.dimen.dp_tab_underline))
.setIconMargin(mContext.getResources().getDimensionPixelSize(R.dimen.dp_tab_margin))
.setIconWidth(mContext.getResources().getDimensionPixelSize(R.dimen.dp_tab_icon))
.setIconHeight(mContext.getResources().getDimensionPixelSize(R.dimen.dp_tab_icon))
//设置指示器高度为0
.setIndicatorHeight(0);
```

**UIAlertDialog属性控制**

Expand Down
Binary file modified apk/sample.apk
Binary file not shown.
13 changes: 8 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ dependencies {
implementation project(':widget-collapsing')
//UIAlertView
implementation project(':widget-alert')
//TabLayout
implementation project(':tab-layout')

// implementation 'com.github.AriesHoo.UIWidget:widget-core:3.2.19'
// implementation 'com.github.AriesHoo.UIWidget:widget-alert:3.2.19'
// implementation 'com.github.AriesHoo.UIWidget:widget-collapsing:3.2.19'
// implementation 'com.github.AriesHoo.UIWidget:widget-core:3.2.20'
// implementation 'com.github.AriesHoo.UIWidget:widget-alert:3.2.20'
// implementation 'com.github.AriesHoo.UIWidget:widget-collapsing:3.2.20'
// implementation 'com.github.AriesHoo.UIWidget:tab-layout:3.2.20'

//图片加载
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.45-androidx'
Expand All @@ -81,8 +84,8 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
implementation 'androidx.multidex:multidex:2.0.0+'
implementation 'com.tencent.bugly:crashreport:2.8.6.0'
//快速Tab库
implementation 'com.github.AriesHoo:TabLayout:1.0.5'
//滑动返回Activity
implementation 'com.github.ParfoisMeng:SlideBack:1.0.6'
//页面事件交互
implementation 'org.simple:androideventbus:1.0.5.1'
}
15 changes: 13 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,19 @@
android:name=".module.status.StatusViewHelperActivity"
android:label="StatusViewHelper示例"/>
<activity
android:name=".module.navigation.NavigationViewHelperActivity"
android:label="NavigationViewHelper示例"/>
android:name=".module.tab.SimpleTabActivity"
android:label="TabLayout示例"/>
<activity
android:name=".module.tab.CommonTabActivity"
android:label="CommonTabLayout示例"/>
<activity
android:name=".module.tab.SlidingTabActivity"
android:label="SlidingTabLayout示例"/>
<activity
android:name=".module.tab.SegmentTabActivity"
android:label="SegmentTabLayout示例"/>
<activity
android:name=".module.tab.EventBusActivity"/>
<activity
android:name=".WebViewActivity"
android:configChanges="locale|layoutDirection|mcc|mnc|orientation|screenSize"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/aries/ui/widget/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.aries.ui.widget.demo.module.loading.LoadingActivity;
import com.aries.ui.widget.demo.module.radius.RadiusActivity;
import com.aries.ui.widget.demo.module.status.StatusViewHelperActivity;
import com.aries.ui.widget.demo.module.tab.SimpleTabActivity;
import com.aries.ui.widget.demo.module.title.TitleActivity;
import com.aries.ui.widget.demo.module.title.TitleEditActivity;
import com.aries.ui.widget.demo.util.SizeUtil;
Expand Down Expand Up @@ -124,6 +125,7 @@ public void onClick(View v) {
}
});
List<WidgetEntity> list = new ArrayList<>();
list.add(new WidgetEntity("TabLayout", "快速创建Tab控件包括CommonTabLayout、SlidingTabLayout及SegmentTabLayout三种类型Tab", SimpleTabActivity.class));
list.add(new WidgetEntity("StatusViewHelper", "支持顶部自定义标题栏沉浸效果帮助类。", StatusViewHelperActivity.class));
list.add(new WidgetEntity("KeyboardHelper", "解决软键盘遮住底部输入框问题帮助类。", TitleEditActivity.class));
list.add(new WidgetEntity("TitleBarView", "一款支持沉浸状态栏效果设置的ToolBar控件:支持xml设置是否沉浸、主标题及副标题、左边文字及icon、右边文字及icon、下划线;支持添加左边、中间及右边view方便扩展。", TitleActivity.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import android.view.MotionEvent;
import android.view.View;

import androidx.annotation.LayoutRes;
import androidx.appcompat.app.AppCompatActivity;

import com.aries.ui.helper.navigation.KeyboardHelper;
import com.aries.ui.helper.navigation.NavigationBarUtil;
import com.aries.ui.helper.navigation.NavigationViewHelper;
Expand All @@ -21,8 +24,8 @@
import com.aries.ui.widget.demo.util.AppUtil;
import com.aries.ui.widget.demo.util.SizeUtil;

import androidx.annotation.LayoutRes;
import androidx.appcompat.app.AppCompatActivity;
import org.simple.eventbus.EventBus;

import butterknife.ButterKnife;
import butterknife.Unbinder;

Expand Down Expand Up @@ -79,6 +82,7 @@ protected void beforeInitView() {
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.i("getSystemUiVisibility", getWindow().getDecorView().getSystemUiVisibility() + ";window:" + getWindow());
EventBus.getDefault().register(this);
super.onCreate(savedInstanceState);
Log.i("savedInstanceState", "savedInstanceState:" + savedInstanceState);
Log.d(TAG, "lifecycle_onCreate");
Expand Down Expand Up @@ -156,6 +160,7 @@ public void startActivity(Class<? extends Activity> activity) {

@Override
protected void onDestroy() {
EventBus.getDefault().unregister(this);
super.onDestroy();
Log.d(TAG, "lifecycle_onDestroy_isFinishing" + isFinishing());
if (mUnBinder != null) {
Expand Down
Loading

0 comments on commit 1ca609f

Please sign in to comment.