Android Question How to call "setStatusBarColor" with Reflection

Discussion in 'Android Questions' started by cb56, Feb 26, 2015.

Similar threads

B4A Question StatusBar Color.
B4A Code Snippet Theme Colors
B4A Example AppCompat with ToolBar - minimal example
B4A Question [SOLVED] Change StatusBar icon color
B4A Code Snippet Set Status bar colors
  1. cb56

    cb56 Member Licensed User

    Last edited: Feb 26, 2015
    KZero likes this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    This code calls this API:
    Dim jo As JavaObject
    It didn't do anything when I test it.
    Alexander Stolte and amir lotfi like this.
  3. DonManfred

    DonManfred Expert Licensed User

    The flow is more than just that.
    first it get getIdentifier("config_enableTranslucentDecor", "bool"
    then it
    get the bool to know whether the statusbar and navbar are translucent
    int[] attrs = {android.R.attr.windowTranslucentStatus, android.R.attr.windowTranslucentNavigation};
                    TypedArray a = app.context.obtainStyledAttributes(attrs);
                        mStatusBarAvailable = a.getBoolean(0, false);
                        mNavBarAvailable = a.getBoolean(1, false);
                    } finally {
    WindowManager.LayoutParams winParams = win.getAttributes();
                    // check window flags
                    int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
    if ((winParams.flags & bits) != 0) {
                        mStatusBarAvailable = 
                    bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
                    if ((winParams.flags & bits) != 0) {
                        mNavBarAvailable = true;
    and in last step it adds a view to the viewgroup
    private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
          mStatusBarTintView = new 
          LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
          params.gravity = 
    if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
              params.rightMargin = mConfig.getNavigationBarWidth();
    All this are NOT WORKING code-snippets from a librarywrapper whih does not work... I always stuck in the last point....

    But yesterday i got the MaskedImageView running... Maybe it helps here too what i did to get it work yesterday. The issue is similar...
  4. cb56

    cb56 Member Licensed User

    It works with Material Theme.

    Nea likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice