All Projects → SiberiaDante → Titlelayout

SiberiaDante / Titlelayout

Licence: apache-2.0
多功能、通用的、可在布局或者使用Java代码实现标题栏; 支持沉浸式状态栏; 支持标题栏单击、双击;支持左侧返回按钮不需要手动实现页面返回; 支持左侧按钮,中间标题,右边按钮点击 左侧支持图片+文字、单独图片、单独文字;右侧支持单独图片、单独文字等。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Titlelayout

Androidnavigation
A library managing navigation, nested Fragment, StatusBar, Toolbar for Android
Stars: ✭ 636 (+576.6%)
Mutual labels:  toolbar
Easyandroid
一个完整基于kotlin的安卓开发框架,采用了mvvm设计模式。涵盖了: 1、基于retrofit2封装的通过kotlin协程实现的网络框架 2、基于阿里开源router修改的api-router实现项目模块化 3、基于glide的图片加载缓存框架 4、基于room实现的往来数据缓存加载 5、基于step实现的数据异步提交 6、基于PreferenceHolder实现的本地数据快速存储 7、基于mlist实现的简单复杂列表的快速开发扩展 8、定制的toolbar可以自适应异形屏,挖孔屏,水滴屏等等。。 本框架几乎涵盖了开发所需的所有模块组件。简单fork之后就可以基于框架快速开发。
Stars: ✭ 33 (-64.89%)
Mutual labels:  toolbar
Nativescript Keyboard Toolbar
⌨️🛠Add a customizable toolbar on top of the soft keyboard
Stars: ✭ 66 (-29.79%)
Mutual labels:  toolbar
Materialdesignsamples
Material Design 系列控件samples,讲了Material Design 系列新控件的使用方法和一些场景示例,使用详情请看对应博客,持续更新中...
Stars: ✭ 900 (+857.45%)
Mutual labels:  toolbar
Findergo
🐢 Open terminal quickly from Finder
Stars: ✭ 862 (+817.02%)
Mutual labels:  toolbar
Debuguisystem
Create a runtime menu system with buttons and windows for debugging in one line of code.
Stars: ✭ 48 (-48.94%)
Mutual labels:  toolbar
Toolbar
Awesome autolayout Toolbar. Toolbar is a library for iOS. You can easily create chat InputBar.
Stars: ✭ 458 (+387.23%)
Mutual labels:  toolbar
Titlebarview
【2.0.0以后版本由UIWidget维护,不做更新】}Android 一个支持Android 4.4以上版本沉浸式及半透明状态栏效果的标题栏控件.支持文xml及java代码设置众多自定义属性;实现MIUI V6、Flyme 4.0、Android 6.0以上状态栏文字颜色切换;支持设置主/副标题跑马灯效果;可设置左边文字/图片、中间主、副标题、右边文字/图片;支持Java代码添加左边、中间、右边 View
Stars: ✭ 74 (-21.28%)
Mutual labels:  toolbar
Awesomebar
Just beautiful
Stars: ✭ 870 (+825.53%)
Mutual labels:  toolbar
Tc Material Design
Série de artigos sobre o Material Design Android
Stars: ✭ 64 (-31.91%)
Mutual labels:  toolbar
Android Animated Menu Items
The example Android project of animated menu items in toolbar
Stars: ✭ 923 (+881.91%)
Mutual labels:  toolbar
Wsl Windows Toolbar Launcher
Adds linux GUI application menu to a windows toolbar
Stars: ✭ 918 (+876.6%)
Mutual labels:  toolbar
React Native Collapsible Toolbar
Pure JS based collapsible toolbar for react native on Android and iOS
Stars: ✭ 50 (-46.81%)
Mutual labels:  toolbar
Multiline Collapsingtoolbar
A modified CollapsingToolbarLayout that can deal with multiline titles
Stars: ✭ 767 (+715.96%)
Mutual labels:  toolbar
Materialviewpager
A Material Design ViewPager easy to use library
Stars: ✭ 8,224 (+8648.94%)
Mutual labels:  toolbar
Bubbletab
Put some bubble in your tabs and give your apps a supa fresh style !
Stars: ✭ 537 (+471.28%)
Mutual labels:  toolbar
Titlebar
Android 标题栏框架,从此布局属性不用记
Stars: ✭ 980 (+942.55%)
Mutual labels:  toolbar
Appearancenavigationcontroller
Example with advanced configuration of the navigation controller's appearance
Stars: ✭ 91 (-3.19%)
Mutual labels:  toolbar
Materialdesign
Material Design 控件集合。ConstraintLayout、NestedScrollView、Toolbar、TabLayout、TextInputLayout。。。
Stars: ✭ 68 (-27.66%)
Mutual labels:  toolbar
Leaflet Geoman
🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
Stars: ✭ 1,088 (+1057.45%)
Mutual labels:  toolbar

TitleLayout

多功能、通用的、可在布局或者使用Java代码实现标题栏;支持沉浸式状态栏,支持左侧返回按钮(不需要手动实现页面返回),左侧支持图片+文字、图片、文字;右侧支持图片、文字等。

堆码不易,star支持,万分感谢

欢迎关注:

博客园:http://www.cnblogs.com/shen-hua/

   compile 'com.github.SiberiaDante:TitleLayout:----'//使用 AndroidUtilLib 库时 不需要再重复依赖此库,参考改文档使用即可

图片

在布局中使用:

<com.siberiadante.titlelayoutlib.TitleBarLayout
        android:id="@+id/title_layout_one"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        dante:d_is_back_view="true"
        dante:d_is_immersive_state_bar="true"
        dante:d_left_image="@mipmap/back_gray"
        dante:d_left_image_padding_start="10dp"
        dante:d_left_image_width="30dp"
        dante:d_left_text="测试"
        dante:d_left_text_style="normal"
        dante:d_left_text_color="@color/black"
        dante:d_left_text_padding_start="10dp"
        dante:d_left_text_size="14sp"
        dante:d_line_height="1px"
        dante:d_right_text="举报"
        dante:d_right_text_size="14sp"
        dante:d_right_text_style="normal"
        dante:d_right_text_color="@color/white"
        dante:d_title_size="18sp"
        dante:d_title_style="mormal"
        dante:d_title_text="这里是标题"
        dante:d_title_color="@color/black"
        dante:d_subtitle_size="11sp"
        dante:d_subtitle_style="mormal"
        dante:d_subtitle_text="这里是副标题"
        dante:d_subtitle_color="@color/gray"
        dante:d_title_layout_background="@color/red"
        dante:d_title_layout_height="45dp"/>

使用Java代码:

  TitleBarLayout titleBarLayout = (TitleBarLayout) findViewById(R.id.title_layout);
        titleBarLayout.setTitleClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LogUtil.d("title 被点击了");
            }
        });
        //设置Titlesize
        titleBarLayout.setTitleSize(30);
        //一键设置标题样式
        titleBarLayout.setTitleStyle("我是标题", 18, ContextCompat.getColor(this, R.color.action_sheet_blue));
        titleBarLayout.setRightImageClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LogUtil.d("右边图片被点击了");
            }
        });

重点说明:

  • 若左侧文字或者按钮为返回键,只需要布局中使用如下代码即可:
    dante:d_is_back_view="true"
    
    或者Java代码中
    titleLayout.setIsLeftBackView(true)
    
    无须在设置onClickListener,this.finish等;如有特殊需要,可设置属性为false,实现方法:
    setLeftClickListener(OnClickListener listener)
    
  • 若项目中使用了沉浸式状态栏,则需要在布局中
    dante:d_is_immersive_state_bar="true"
    
  • 设置页面为沉浸式状态栏方法:
     ScreenUtil.setStatusTranslucent(this);
    

其他属性说明

xml中的属性:

xml属性 属性说明
d_left_image 左边图片资源
d_left_image_width 左边图片宽(高为匹配父布局)
d_left_image_padding_start 左边图片左边距(默认10dp)
d_left_image_padding_end 左边图片右边距(默认10dp)
d_left_text 左边文字资源
d_left_text_size 左边文字大小(默认16SP)
d_left_text_color 左边文字颜色(默认黑色)
d_left_text_style 设置文字style(normal|bold|italic)
d_left_text_padding_start 左边文字左边距(默认10dp)
d_left_text_padding_end 左边文字右边距(默认10dp)
d_title_text 中间标题文字资源
d_title_size 中间标题文字大小(默认18SP)
d_title_color 中间标题文字颜色(默认黑色)
d_title_style 设置文字style(normal|bold|italic)
d_subtitle_text 中间副标题文字资源
d_subtitle_size 中间副标题文字大小(默认12SP)
d_subtitle_color 中间副标题文字颜色(默认黑色)
d_subtitle_style 设置文字style(normal|bold|italic)
d_right_text 右边文字资源
d_right_text_color 右边文字颜色
d_right_text_size 右边文字大小(默认16sp)
d_right_text_style 设置文字style(normal|bold|italic)
d_right_text_padding_end 右边文字距离右边距
d_right_text_padding_start 右边文字距离左边距
d_right_image 右边图片资源
d_right_image_width 右边图片宽度,高度为匹配父布局
d_right_image_padding_end 右边图片距离右边距
d_right_image_padding_start 右边图片距离左边距
d_line_height 标题栏底部横线高度(默认1px,建议单位使用px)
d_line_background 标题栏底部横线背景颜色(默认黑色)
d_title_layout_height 标题栏整体高度(默认45dp)
d_title_layout_background 标题栏整体背景颜色
d_is_back_view 左侧文字和图片是否为返回键,若是返回键,则自带返回前一页面功能
d_is_immersive_state_bar 是否是沉浸式状态栏,默认false,(为true时标题栏高度包含状态栏高度)

Java 代码中

Java代码方法 Java代码方法说明
setTitle(CharSequence title) 设置标题资源
setTitleSize(int titleSize) 设置标题字体大小
setTitleColor(int titleColor) 设置标题字体颜色
setTitleStyle(String title, int titleSize, int titleColor) 设置标题资源、文字大小、文字颜色
setSubTitle(CharSequence title) 设置副标题资源
setSubTitleSize(int titleSize) 设置副标题字体大小
setSubTitleColor(int titleColor) 设置副标题字体颜色
setSubTitleStyle(String title, int titleSize, int titleColor) 设置副标题资源、文字大小、文字颜色
setLeftText(String leftText) 设置左侧文字
setLeftTextSize(int leftTextSize) 设置左侧文字大小
setLeftTextColor(int leftTextColor) 设置左侧文字颜色
setLeftStyle(String leftText, int leftTextSize, int leftTextColor) 设置左侧文字、文字大小、文字颜色
setRightText(String rightText) 设置右侧文字
setRightTextSize(int rightTextSize) 设置右侧文字大小
setRightTextColor(int rightTextColor) 设置右侧文字颜色
setTitleClickListener(OnClickListener listener) 标题点击监听
setTitleClickListener(OnMultiTouchListener listener) 设置标题单击/双击事件
setLeftClickListener(OnClickListener listener) 左侧文字和按钮点击监听
setRightTextClickListener(OnClickListener listener) 右侧文字点击监听
setRightImageClickListener(OnClickListener listener) 右侧按钮点击监听
setIsLeftBackView(boolean isLeftBackView) 设置左侧文字和按钮是否为返回按钮
setIsHaveLine(boolean haveLine) 设置标题栏底部是否有分割线
setLeftBackViewVisible 设置左侧图标显示隐藏
setLeftTextViewVisible 设置左侧文字显示隐藏
setRightTextViewVisible 设置右侧文字显示隐藏
setRightImageViewVisible 设置右侧图标显示隐藏
setTitleVisible 设置标题显示隐藏
setSubTitleVisible 设置副标题显示隐藏
setTitleLayoutBackground 设置标题栏背景颜色

问题

  • 设置字体颜色失真,请使用:ContextCompat.getColor(this,R.color.red)

更新优化说明

  • v1.1.4
    • 增加标题栏双击事件、单击事件回调setTitleClickListener(OnMultiTouchListener listener)
    • 修复丢失的右边图片点击事件
    • 修复设置左右图片Padding造成的问题
  • v1.1.3:(2018-08-01发布)
    • 增加动态设置标题栏背景颜色
    • 增加设置左右视图是否可以点击
  • v1.1.0:
    • 增加支持Java代码设置所有控件显示隐藏
  • v1.0.9:
    • 增加支持动态设置左侧和右侧图标功能
    • 增加未初始化时UnsupportedOperationException异常提示
  • v1.0.4
    • 修复bug
    • 支持设置文字style(normal|bold|italic)
  • v1.0.2
    • 增加支持副标题功能
    • 优化标题过长显示问题
  • v1.0.1
    • 多功能、通用的、可在布局或者使用Java代码实现标题栏;
    • 支持沉浸式状态栏;
    • 支持左侧返回按钮不需要手动实现页面返回;
    • 支持左侧按钮,中间标题,右边按钮点击
    • 左侧支持图片+文字、单独图片、单独文字;右侧支持单独图片、单独文字等。
    • 多功能、通用的、可在布局或者使用Java代码实现标题栏;
    • 支持沉浸式状态栏,支持左侧返回按钮(不需要手动实现页面返回),左侧支持图片+文字、图片、文字;右侧支持图片、文字等。
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].