Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A AndroidSlidingUpPanel
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 267
    • Issues 267
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 34
    • Merge requests 34
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Umano: News Read To You
  • AndroidSlidingUpPanel
  • Issues
  • #558
Closed
Open
Issue created Oct 21, 2015 by Administrator@rootContributor

Panel Overlaps Status Bar When Activity Has A Translucent Status Bar Theme

Created by: rabyunghwa

Hey. My activity(which has a fragment) has a translucent status bar theme. The problem is inside this fragment when tapped, the panel would slide all the way up to overlap the status bar. So how to solve this so that when expanded, the panel would still appear right below the status bar? What I have tried so far is to dynamically change the system window flags in onPanelExpanded() and onPanelCollapsed() by setting and clearing the translucent ones. But this approach has some issues. The activity would be pushed down below the status bar. I've also tried setting the anchor point. But still there is a problem. Here is the code snippet:

        @Override
        public void onPanelExpanded(View panel) {
            Log.i(TAG, "onPanelExpanded");
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                Window w = getWindow(); // in Activity's onCreate() for instance
                w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            }
        }

        @Override
        public void onPanelCollapsed(View panel) {
            Log.i(TAG, "onPanelCollapsed");
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                Window w = getWindow(); // in Activity's onCreate() for instance
                w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            }

        }

screenshot_2015-10-21-17-55-18 screenshot_2 screenshot_1

Assignee
Assign to
Time tracking