Last active
          January 13, 2021 23:14 
        
      - 
      
- 
        Save indraAsLesmana/640d083598e535d8b001f71f2a5e0d5d to your computer and use it in GitHub Desktop. 
    Add dinamic buttom margin, when scrren in immersive mode/fullscreen
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | private fun setDinamicAdsMarginFullscreenMode() { | |
| val bottomMargin = getNavigationBarHeight(this, resources.configuration.orientation) | |
| if (adView?.layoutParams is MarginLayoutParams) { | |
| (adView?.layoutParams as MarginLayoutParams).setMargins( | |
| 0, | |
| top, | |
| 0, | |
| bottomMargin | |
| ) | |
| adView?.requestLayout() | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment