Giter Site home page Giter Site logo

android-titlebar's People

Contributors

coolbreezes avatar helloxkk avatar wuhenzhizao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-titlebar's Issues

clone项目,xml不能预览

直接clone的项目,在xml里面不能预览该控件,我不知道是不是只有我是这样,还是说这个库本来就这样。

关于布局报错以及在使用了ViewPager+Fragment的Activity中无法监听点击事件的问题

不知道是不是AS的版本问题,我用的3.0.1版本,您的titlebar代码都会报错:Turn off custom view rendering sandboxExec access not allowed during rendering (getprop)。不过这并不影响正常使用。
另一个是使用了ViewPager+Fragment的Activity中无法监听点击事件的问题:我测试的手机是android 8.0的小米6手机。主要的布局是这样的:
<com.wuhenzhizao.titlebar.widget.CommonTitleBar />
<android.support.v4.view.ViewPager/> //这里用的是您的activity_lauch.xml里的代码
<android.support.design.widget.BottomNavigationView/>
如果把titlebar放进每个fragment对应的子布局里的话,可以监听到右边的textview的点击事件,中间的还是会失灵。
以上的只是我的个人所见,感谢您的代码。

沉浸式标题栏问题

当设置为沉浸式标题栏时,标题栏文字不能自动上下居中,并且有留白空间

titlebar:fillStatusBar="true"
titlebar:statusBarColor="@color/black"
<com.wuhenzhizao.titlebar.widget.CommonTitleBar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        titlebar:titleBarColor="@color/white"
        titlebar:fillStatusBar="true"
        titlebar:statusBarColor="@color/black"
        titlebar:showBottomLine="true"
        titlebar:bottomLineColor="@color/colorWave"
        titlebar:centerType="textView"
        titlebar:centerSearchRightType="delete"
        titlebar:centerText="总数(0)"
        titlebar:centerTextColor="@color/black"
        titlebar:rightType="imageButton"
        titlebar:rightImageResource="@drawable/comm_titlebar_search_normal" />
  • 红色框内是不能自动填充位置,只能用颜色覆盖,文字不能上下居中。

1111

代码设置各种type接口??

请问怎么在代码里设置各种type接口? 和CoordinatorLayout一起使用 导致CoordinatorLayout滑动隐藏控件失效 还有能否控制不用沉浸式

能否再次封装或者拓展

能否将大部分由xml定义的属性开成protected呢?这样在需要大量重复titlebar的时候可以直接继承一个新类而不是复制粘贴大量xml代码,可拓展性更强

类型转换异常啊,大佬。

java.lang.ClassCastException: com.android.layoutlib.bridge.android.BridgeContext cannot be cast to 

android.content.ContextWrapper   at 

com.wuhenzhizao.titlebar.widget.CommonTitleBar.getWindow(CommonTitleBar.java:645)   at 

com.wuhenzhizao.titlebar.widget.CommonTitleBar.setUpImmersionTitleBar(CommonTitleBar.java:627) 

  at com.wuhenzhizao.titlebar.widget.CommonTitleBar.onAttachedToWindow(CommonTitleBar.java:623) 

  at android.view.View.dispatchAttachedToWindow(View.java:17445)   at 

android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)   at 

android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3333)   at 

android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3333)   at 

android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3333)   at 

android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42) Copy stack to clipboard   Tip: Try to refresh the layout.

在布局的时候出现了这个是咋回事?

部分机型号,屏幕始终填充不满

作者你好,使用你这个titbar后屏幕底部始终有个白底,白底的高度就是状态栏的高度。
目前魅蓝 m3,金立m6上会出现这个问题。系统版本都是5.0的,请提示下处理思路。

SmartTabLayout into Center has tab overlapping with right or left customviews

Dear Sir,
Thanks so much for this great library...
When using SmartTablayout into center which have 4 tabs images , and using right customview with 2 buttons , images are overlapping , as per attached screenshot. Do you have any recommendations ?

非常感谢这个伟大的图书馆......
当SmartTablayout使用具有4个选项卡图像的中心,并使用具有2个按钮的右侧自定义视图时,图像重叠,如附加的屏幕截图所示。你有什么建议 ?
device-2019-01-31-213251

希望可以设置出现跑马灯字数

目前跑马灯是根据屏幕宽度实现的,如果左侧右侧view过宽,中间标题就会覆盖两侧view,希望能自己设置出现跑马灯的时机。感谢作者

关于centerText的设置

请问,有没有提供动态设置centerText的函数,发现好像只能在xml中通过titlebar:centerText="string" 设置

在某些手机下且使用沉浸标题模式下,底部会有一个高度=状态栏高度的白条。

一、条件

1、沉浸模式下
2、 红米1s(miui8.5) 和oppo A37m(ColorOS3.0)Android5.1下
3、界面有ScrollView下内嵌有EditText。

Activity 设置:android:windowSoftInputMode="stateHidden|adjustResize"
已经调用
@OverRide
public void onAttachedToWindow() {
super.onAttachedToWindow();
KeyboardConflictCompat.assistWindow(getWindow());
}

二、现象

当进入界面时,界面底部出现白条,高度=状态栏高度

调试发现:

KeyboardConflictCompat.KeyboardConflictCompat() 方法里面
代码
contentHeight = mChildOfContent.getHeight();

假设手机 h=1280px。
在出问题的机型里面,contentHeight = h - statusHeight

没有出现白条的手机,contentHeight = h

我把代码改为:
mChildOfContent.getRootView().getHeight();
都正常。

原因可能某些机型ROM有问题。

我在小米2s(MIUI9.2) 及其它厂商手机上(测试了10手机左右),未见有此现象。

actionbar setcustomview后高度只有一半

ActionBar mActionBar = getSupportActionBar();
View actionbarView =getLayoutInflater().inflate(R.layout.title,null);
// ActionBar.LayoutParams layoutParams =new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT,
// ActionBar.LayoutParams.MATCH_PARENT);
ActionBar.LayoutParams layoutParams =new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT,
ActionBar.LayoutParams.MATCH_PARENT);
layoutParams.gravity = Gravity.CENTER_HORIZONTAL |Gravity.CENTER_HORIZONTAL;
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setDisplayShowCustomEnabled(true);
mActionBar.setDisplayShowTitleEnabled(false);
mActionBar.setCustomView(actionbarView, layoutParams);
Toolbar parent =(Toolbar) actionbarView.getParent();
parent.setContentInsetsAbsolute(0,0);

怎么使用?直接拷贝?

作者你好!我偶然间发现这个标题栏,感觉非常好用,感谢您开源出这个东西。但是我阅读了readme,发现您并没有提供使用方式,例如gradle的compile。请问这是直接下载源码拷贝?我感觉这是比较麻烦的,还希望作者能够明确给出使用方式。再次万分感谢!

请问在Android4.4中如何使用

demo如果在Android4.4中运行,报错java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

尝试修复:将v19/styles.xml中的AppTheme定义从parent="android:Theme.Holo.Light.NoActionBar.TranslucentDecor"改成parent="AppTheme.Base",运行以后发现titlebar直接顶着头部,没有留出statusbar的高度空间。
当然fitsSystemWindows=true以后可以解决这个问题,但是对其他版本又会造成影响。

请问如何处理?

软键盘弹出时会把TitleBar顶上去,和状态栏重合?

如下布局,EditText包含在ScrollView中,但弹出软键盘时同样把TitleBar顶上去了?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout>
    <com.wuhenzhizao.titlebar.widget.CommonTitleBar/>
    <ScrollView>
            ...
            <EditText>
            ....
    </<ScrollView>
</LinearLayout>

请问为什么可以设置状态栏的颜色

群主,看了您的源码,有个地方不是很明白,
在处理沉浸式的时候,viewStatusBarFill 布局是如何放到状态栏上面呢,
放到状态栏上面的布局为什么不会影响状态栏的显示呢

if (fillStatusBar && supportStatusBarLightMode) {
int statusBarHeight = AppUtils.getStatusBarHeight(context);
viewStatusBarFill = new View(context);
viewStatusBarFill.setId(AppUtils.generateViewId());
viewStatusBarFill.setBackgroundColor(statusBarColor);
LayoutParams statusBarParams = new LayoutParams(MATCH_PARENT, statusBarHeight);
statusBarParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
addView(viewStatusBarFill, statusBarParams);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.