[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": ".idea/codeStyles/Project.xml",
    "content": "<component name=\"ProjectCodeStyleConfiguration\">\n  <code_scheme name=\"Project\" version=\"173\">\n    <codeStyleSettings language=\"XML\">\n      <indentOptions>\n        <option name=\"CONTINUATION_INDENT_SIZE\" value=\"4\" />\n      </indentOptions>\n      <arrangement>\n        <rules>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>xmlns:android</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>xmlns:.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*:id</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*:name</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>name</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>style</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>^$</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>ANDROID_ATTRIBUTE_ORDER</order>\n            </rule>\n          </section>\n          <section>\n            <rule>\n              <match>\n                <AND>\n                  <NAME>.*</NAME>\n                  <XML_ATTRIBUTE />\n                  <XML_NAMESPACE>.*</XML_NAMESPACE>\n                </AND>\n              </match>\n              <order>BY_NAME</order>\n            </rule>\n          </section>\n        </rules>\n      </arrangement>\n    </codeStyleSettings>\n  </code_scheme>\n</component>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleMigrationSettings\" migrationVersion=\"1\" />\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"testRunner\" value=\"CHOOSE_PER_TEST\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleJvm\" value=\"#GRADLE_LOCAL_JAVA_HOME\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n            <option value=\"$PROJECT_DIR$/translucentparent\" />\n          </set>\n        </option>\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ExternalStorageConfigurationManager\" enabled=\"true\" />\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_17\" default=\"true\" project-jdk-name=\"ms-17\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/GitHub__-StatusNavigationTransparent.iml\" filepath=\"$PROJECT_DIR$/GitHub__-StatusNavigationTransparent.iml\" group=\"StatusNavigationTransparent\" />\n      <module fileurl=\"file://$PROJECT_DIR$/StatusNavigationTransparent.iml\" filepath=\"$PROJECT_DIR$/StatusNavigationTransparent.iml\" group=\"StatusNavigationTransparent\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/StatusNavigationTransparent-app.iml\" filepath=\"$PROJECT_DIR$/app/StatusNavigationTransparent-app.iml\" group=\"StatusNavigationTransparent/app\" />\n      <module fileurl=\"file://$PROJECT_DIR$/translucentparent/StatusNavigationTransparent-translucentparent.iml\" filepath=\"$PROJECT_DIR$/translucentparent/StatusNavigationTransparent-translucentparent.iml\" group=\"StatusNavigationTransparent/translucentparent\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" group=\"StatusNavigationTransparent/app\" />\n      <module fileurl=\"file://$PROJECT_DIR$/translucentparent/translucentparent.iml\" filepath=\"$PROJECT_DIR$/translucentparent/translucentparent.iml\" group=\"StatusNavigationTransparent/translucentparent\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/render.experimental.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RenderSettings\">\n    <option name=\"showDecorations\" value=\"true\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer\" />\n        <option value=\"com.intellij.execution.junit.AllInPackageConfigurationProducer\" />\n        <option value=\"com.intellij.execution.junit.PatternConfigurationProducer\" />\n        <option value=\"com.intellij.execution.junit.TestInClassConfigurationProducer\" />\n        <option value=\"com.intellij.execution.junit.UniqueIdConfigurationProducer\" />\n        <option value=\"com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer\" />\n        <option value=\"org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer\" />\n        <option value=\"org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "\n文章目录\n\nGitHub：https://github.com/AnJiaoDe/StatusNavigationTransparent\n\n使用方法\n\n注意：如果轮子死活下载不下来，说明maven地址有毛病，你需要找到jitpack的官网首页，查看最新的官网地址\n\n注意：记得去gayhub查看最新版本，最新版本最niubility\n\n首先创建全局theme继承Theme.AppCompat.Light.NoActionBar\n\n然后继承StatusNavigationActivity\n\n1. 系统StatusBar填充界面,自定义背景颜色(文字、icon颜色根据StatusBar颜色亮度设置为黑色)\n\n2.系统StatusBar填充界面,自定义背景颜色(文字、icon颜色根据StatusBar颜色亮度设置为白色)\n\n3.系统StatusBar不填充界面,布局添加StatusBarView实现半透明\n\n4.系统StatusBar不填充界面,且半透明于图片之上\n\n5.系统StatusBar不填充界面,且全透明于图片之上\n\n6.系统navigationbar填充界面,自定义颜色\n\n7.系统navigationbar不填充界面,且全透明\n\n8.隐藏statusbar\n\n9.隐藏navigationbar\n\n10.隐藏statusbar、navigationbar，全屏\n\n11.图片预览，切换statusbar、navigationbar的显示\n\nStatusNavigationUtils工具类\n\nStatusNavigationActivity\n\nStatusBarView和系统StatusBar高度一致\n\nNavigationBarView系统NavigationBarView高度一致\n\nScreenUtils\n\n欢迎联系、指正、批评\n\n## [GitHub：https://github.com/AnJiaoDe/StatusNavigationTransparent](https://github.com/AnJiaoDe/StatusNavigationTransparent)\n\n## 使用方法\n1.工程目录下的`build.gradle`中添加代码：\n## 注意：如果轮子死活下载不下来，说明maven地址有毛病，你需要找到jitpack的官网首页，查看最新的官网地址\n\n```java\nallprojects {\n\t\trepositories {\n\t\t\t        maven { url 'https://www.jitpack.io' }\n\t\t}\n\t}\n```\n2.直接在需要使用的模块的build.gradle中添加代码：\n\n## 注意：记得去gayhub查看最新版本，最新版本最niubility\n\n```java\ndependencies {\nimplementation 'com.github.AnJiaoDe:StatusNavigationTransparent:V1.2.4'\n}\n```\n\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006004830409.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NvbmZ1c2luZ19hd2FrZW5pbmc=,size_16,color_FFFFFF,t_70)\n\n\n## 首先创建全局theme继承Theme.AppCompat.Light.NoActionBar\n\n \n```xml\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n    </style>\n```\n\n```xml\n<application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n```\n \n\n## 然后继承StatusNavigationActivity\n 注意：不一定非要继承StatusNavActivity ,可以使用StatusNavigationUtils工具类、StatusBarView和NavigationBarView\n\n\n总之，方法多样灵活\n## 1. 系统StatusBar填充界面,自定义背景颜色(文字、icon颜色根据StatusBar颜色亮度设置为黑色)\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/2020100600534638.png)\n\n\n```java\npublic class Status00Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status00);\n        //此行可不写，默认就是0xfff2f2f2\n        setStatusBarColor(getStatusBarColorDefault());\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n       \n\n## 2.系统StatusBar填充界面,自定义背景颜色(文字、icon颜色根据StatusBar颜色亮度设置为白色)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006005516961.png)\n\n```java\npublic class Status0Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status0);\n        setStatusBarColor(getResources().getColor(R.color.theme));\n    }\n\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 3.系统StatusBar不填充界面,布局添加StatusBarView实现半透明\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006005718949.png)\n\n```java\npublic class Status2Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status2);\n        setStatusBarNoFillAndTransParentHalf();\n    }\n\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n```xml\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\"\n    android:orientation=\"vertical\">\n    <com.cy.translucentparent.StatusBarView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"/>\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:background=\"@color/colorPrimary\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"StatusBar半透明\"\n            android:textColor=\"#ffffff\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"@color/white\"\n        android:orientation=\"vertical\"></LinearLayout>\n</LinearLayout>\n\n```\n\n## 4.系统StatusBar不填充界面,且半透明于图片之上\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006005825571.png)\n\n```java\npublic class Status5Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status5);\n        setStatusBarNoFillAndTransParentHalf();\n        //或者写2行\n//        setStatusBarNoFill();\n//        setStatusBarColor(0x33000000);\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 5.系统StatusBar不填充界面,且全透明于图片之上\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006005912922.png)\n\n```java\npublic class Status6Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status6);\n        setStatusBarNoFillAndTransParent();\n    }\n\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 6.系统navigationbar填充界面,自定义颜色\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006010032268.png)\n\n```java\npublic class Navigation0Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_navigation0);\n        setNavigationBarColor(0xffff0000);\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 7.系统navigationbar不填充界面,且全透明\n模拟器上看起来是半透明，有些手机会有阴影，不必强求，随缘即可\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006010143951.png)\n\n```java\npublic class Navigation2Activity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_nav2);\n        setNavigationBarTransparent();\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 8.隐藏statusbar\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006010602644.gif)\n\n```java\npublic class HideStatusBarActivity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_hide_status_bar);\n        setHideStatusBar();\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 9.隐藏navigationbar\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006010812251.gif)\n\n```java\npublic class HideNavigationBarActivity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_hide_navigation_bar);\n        setHideNavigationBar();\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 10.隐藏statusbar、navigationbar，全屏\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006010930427.gif)\n\n```java\npublic class FullScreenActivity extends StatusNavigationActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_full_screen);\n        setFullScreen();\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n```\n\n## 11.图片预览，切换statusbar、navigationbar的显示\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20201006011103788.gif)\n\n```java\npublic class StatusNavigationSwitchActivity extends StatusNavigationActivity {\n    private boolean fullScreen=false;\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status_navigation_switch);\n        final ViewGroup rl1=findViewById(R.id.rl1);\n        final ViewGroup rl2=findViewById(R.id.rl2);\n        findViewById(R.id.iv).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                fullScreen=!fullScreen;\n                if(fullScreen){\n                    rl1.setVisibility(View.GONE);\n                    rl2.setVisibility(View.GONE);\n                    setHideStatusBar();\n                    setNavigationBarTransparent();\n                }else {\n                    rl1.setVisibility(View.VISIBLE);\n                    rl2.setVisibility(View.VISIBLE);\n                    setClearHideStatusBar();\n                    setStatusBarColor(getStatusBarColorDefault());\n                    setNavigationBarColor(getNavigationBarColorDefault());\n                }\n            }\n        });\n    }\n\n    @Override\n    public void onClick(View v) {\n\n    }\n}\n\n```\n小编提供了贼多工具方便你的使用\n\n## StatusNavigationUtils工具类\n\n```java\npackage com.cy.translucentparent;\n\nimport android.app.Activity;\nimport android.graphics.Color;\nimport android.os.Build;\nimport android.os.ParcelUuid;\nimport android.view.View;\nimport android.view.Window;\nimport android.view.WindowManager;\n\n\n/**\n * Created by lenovo on 2017/4/25.\n */\n\npublic class StatusNavigationUtils {\n\n\n    /**\n     * 状态栏自定义背景颜色,6.0以上可修改状态栏字体颜色，icon颜色\n     *\n     * @param activity\n     * @param color\n     */\n    public static void setStatusBarColor(Activity activity, int color) {\n        Window window = activity.getWindow();\n        //去除statusbar不填充的标志\n        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n        int ui = window.getDecorView().getSystemUiVisibility();\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n            if (isLightColor(color)) {\n                ui |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; //设置状态栏中字体的颜色为黑色\n            } else {\n                ui &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; //设置状态栏中字体颜色为白色\n            }\n        }\n        window.getDecorView().setSystemUiVisibility(ui);\n        window.setStatusBarColor(color);\n    }\n\n    /**\n     * 判断颜色是否为亮色\n     * @param color\n     * @return\n     */\n    public static boolean isLightColor(int color) {\n        double darkness = 1 - (0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color)) / 255;\n        if (darkness < 0.5) {\n            return true; // It's a light color\n        } else {\n            return false; // It's a dark color\n        }\n    }\n\n    /**\n     * * 状态栏不填充，布局会填充到状态栏底部，有些手机有阴影\n     *\n     * @param activity\n     */\n    public static void setStatusBarNoFill(Activity activity) {\n        Window window = activity.getWindow();\n        int ui = window.getDecorView().getSystemUiVisibility();\n        ui |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;\n        window.getDecorView().setSystemUiVisibility(ui);\n    }\n\n    /**\n     * * 导航栏全透明，布局会填充到导航栏底部，有些手机有阴影\n     *\n     * @param activity\n     */\n    public static void setNavigationBarTransparent(Activity activity) {\n        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n    }\n\n    /**设置导航栏颜色，和setNavigationBarTransparent互斥，要么选择自定义导航栏颜色，要么选择导航栏全透明\n     * @param activity\n     * @param color\n     */\n\n    public static void setNavigationBarColor(Activity activity, int color) {\n        Window window = activity.getWindow();\n        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n        int ui = window.getDecorView().getSystemUiVisibility();\n        window.getDecorView().setSystemUiVisibility(ui);\n        window.setNavigationBarColor(color);\n    }\n\n    /**\n     * 隐藏状态栏、导航栏，全屏\n     * @param activity\n     */\n    public static void setFullScreen(Activity activity) {\n        View decorView = activity.getWindow().getDecorView();\n        int ui = decorView.getSystemUiVisibility();\n        ui |=  View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n                | View.SYSTEM_UI_FLAG_FULLSCREEN\n                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n        decorView.setSystemUiVisibility(ui);\n    }\n    /**\n     * 去除隐藏状态栏、导航栏，全屏的标志\n     * @param activity\n     */\n    public static void setClearFullScreen(Activity activity) {\n        View decorView = activity.getWindow().getDecorView();\n        int ui = decorView.getSystemUiVisibility();\n        ui &=  View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n                & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n                & View.SYSTEM_UI_FLAG_FULLSCREEN\n                & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n        decorView.setSystemUiVisibility(ui);\n    }\n\n    /**\n     * 隐藏状态栏\n     * @param activity\n     */\n    public static void setHideStatusBar(Activity activity) {\n        View decorView = activity.getWindow().getDecorView();\n        int ui = decorView.getSystemUiVisibility();\n        ui |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                | View.SYSTEM_UI_FLAG_FULLSCREEN\n                | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n        decorView.setSystemUiVisibility(ui);\n    }\n    /**\n     * 去除隐藏状态栏的标志\n     * @param activity\n     */\n    public static void setClearHideStatusBar(Activity activity) {\n        View decorView = activity.getWindow().getDecorView();\n        int ui = decorView.getSystemUiVisibility();\n        ui &= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                & View.SYSTEM_UI_FLAG_FULLSCREEN\n                & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n        decorView.setSystemUiVisibility(ui);\n    }\n\n    /**\n     * 隐藏导航栏\n     * @param activity\n     */\n    public static void setHideNavigationBar(Activity activity) {\n        View decorView = activity.getWindow().getDecorView();\n        int ui = decorView.getSystemUiVisibility();\n        ui |=View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n        decorView.setSystemUiVisibility(ui);\n    }\n    /**\n     * 去除隐藏导航栏的标志\n     * @param activity\n     */\n    public static void setClearHideNavigationBar(Activity activity) {\n        View decorView = activity.getWindow().getDecorView();\n        int ui = decorView.getSystemUiVisibility();\n        ui &=View.SYSTEM_UI_FLAG_HIDE_NAVIGATION & View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n        decorView.setSystemUiVisibility(ui);\n    }\n}\n\n```\n\n## StatusNavigationActivity\n\n```java\npackage com.cy.translucentparent;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.View;\n\nimport androidx.annotation.Nullable;\nimport androidx.appcompat.app.AppCompatActivity;\n\n\n/**\n * Created by lenovo on 2017/4/25.\n */\n\npublic abstract class StatusNavigationActivity extends AppCompatActivity implements View.OnClickListener {\n\n    @Override\n    protected void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        StatusNavigationUtils.setStatusBarColor(this, getStatusBarColorDefault());\n        StatusNavigationUtils.setNavigationBarColor(this, getNavigationBarColorDefault());\n    }\n    public int getStatusBarColorDefault(){\n        return 0xfff2f2f2;\n    }\n    public int getNavigationBarColorDefault(){\n        return 0xff000000;\n    }\n\n    public void setStatusBarColor(int color) {\n        StatusNavigationUtils.setStatusBarColor(this, color);\n    }\n    public void setNavigationBarColor(int color) {\n        StatusNavigationUtils.setNavigationBarColor(this, color);\n    }\n\n    public void setFullScreen() {\n        StatusNavigationUtils.setFullScreen(this);\n    }\n    public void setClearFullScreen() {\n        StatusNavigationUtils.setClearFullScreen(this);\n    }\n\n    public void setHideStatusBar() {\n        StatusNavigationUtils.setHideStatusBar(this);\n    }\n    public void setClearHideStatusBar() {\n        StatusNavigationUtils.setClearHideStatusBar(this);\n    }\n\n    public void setHideNavigationBar() {\n        StatusNavigationUtils.setHideNavigationBar(this);\n    }\n    public void setClearHideNavigationBar() {\n        StatusNavigationUtils.setClearHideNavigationBar(this);\n    }\n\n    public void setStatusBarNoFill() {\n        StatusNavigationUtils.setStatusBarNoFill(this);\n    }\n\n    public void setStatusBarNoFillAndTransParent() {\n        setStatusBarNoFill();\n        setStatusBarColor(0x00000000);\n    }\n\n    public void setStatusBarNoFillAndTransParentHalf() {\n        setStatusBarNoFill();\n        setStatusBarColor(0x33000000);\n    }\n\n    public  void setNavigationBarTransparent() {\n        StatusNavigationUtils.setNavigationBarTransparent(this);\n    }\n}\n\n```\n\n## StatusBarView和系统StatusBar高度一致\n\n```java\npackage com.cy.translucentparent;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.View;\n\n\n\n/**\n * Created by lenovo on 2017/7/4.\n */\n\npublic class StatusBarView extends View {\n    private Context context;\n    public StatusBarView(Context context) {\n        this(context,null);\n    }\n\n    public StatusBarView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        this.context=context;\n\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(ScreenUtils.getStatusBarHeight(context), MeasureSpec.EXACTLY));\n    }\n}\n\n```\n\n## NavigationBarView系统NavigationBarView高度一致\n\n```java\npackage com.cy.translucentparent;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.View;\n\n\n/**\n * Created by lenovo on 2017/7/4.\n */\n\npublic class NavigationBarView extends View {\n    private Context context;\n    public NavigationBarView(Context context) {\n        this(context,null);\n    }\n\n    public NavigationBarView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        this.context=context;\n\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(ScreenUtils.getNavigationBarHeight(context), MeasureSpec.EXACTLY));\n    }\n}\n\n```\n\n## ScreenUtils\n\n```java\npackage com.cy.translucentparent;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.os.Build;\nimport android.util.DisplayMetrics;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.WindowManager;\n\nimport java.lang.reflect.Method;\n\n/**\n * Created by Administrator on 2018/11/20 0020.\n */\n\npublic class ScreenUtils {\n\n    public static int getStatusBarHeight(Context context) {\n        Resources resources = context.getResources();\n        int resourceId = resources.getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n        return resources.getDimensionPixelSize(resourceId);\n    }\n\n    public static int getNavigationBarHeight(Context context) {\n        Resources resources = context.getResources();\n        int resourceId = resources.getIdentifier(\"navigation_bar_height\", \"dimen\", \"android\");\n        return resources.getDimensionPixelSize(resourceId);\n    }\n\n    public static int getScreenWidth(Context context) {\n\n        DisplayMetrics displayMetrics = new DisplayMetrics();\n\n        WindowManager wm = (WindowManager) context.getSystemService(\"window\");\n        if (Build.VERSION.SDK_INT <= 17) {\n            wm.getDefaultDisplay().getMetrics(displayMetrics);\n        } else {\n            wm.getDefaultDisplay().getRealMetrics(displayMetrics);\n        }\n        return displayMetrics.widthPixels;\n    }\n\n    public static int getScreenHeight(Context context) {\n        DisplayMetrics displayMetrics = new DisplayMetrics();\n\n        WindowManager wm = (WindowManager) context.getSystemService(\"window\");\n        if (Build.VERSION.SDK_INT <= 17) {\n            wm.getDefaultDisplay().getMetrics(displayMetrics);\n        } else {\n            wm.getDefaultDisplay().getRealMetrics(displayMetrics);\n        }\n        return displayMetrics.heightPixels;\n    }\n\n    public static int setYStart(Context context, float y) {\n\n//        if (isGroove(context)) {\n\n        return (int) (y * getScreenHeight(context)) + getStatusBarHeight(context);\n//        } else {\n//            return (int) (y * getScreenHeight(context));\n//\n//\n//        }\n    }\n\n    /**\n     * 获取当前界面可视区域的高度\n     *\n     * @param activity\n     * @return\n     */\n    public static int getVisibleFrameHeight(Activity activity) {\n        Rect r = new Rect();\n        //获取当前界面可视部分\n        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);\n\n//        if (isGroove(activity)) {\n\n//            return r.bottom - r.top - getStatusBarHeight(activity);\n//        } else {\n        return r.bottom - r.top;\n//\n//        }\n    }\n\n    /**\n     * 获取当前界面可视区域的宽度\n     *\n     * @param activity\n     * @return\n     */\n    public static int getVisibleFrameWidth(Activity activity) {\n        Rect r = new Rect();\n        //获取当前界面可视部分\n        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);\n        return r.right - r.left;\n    }\n}\n\n\n```\n\n## 欢迎联系、指正、批评\n\n\n\nGithub:[https://github.com/AnJiaoDe](https://github.com/AnJiaoDe)\n\n简书：[https://www.jianshu.com/u/b8159d455c69](https://www.jianshu.com/u/b8159d455c69)\n\nCSDN：[https://blog.csdn.net/confusing_awakening](https://blog.csdn.net/confusing_awakening)\n\nffmpeg入门教程:[https://www.jianshu.com/p/042c7847bd8a](https://www.jianshu.com/p/042c7847bd8a)\n\n\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\napply plugin: 'org.jetbrains.kotlin.android'\n\nandroid {\n    compileSdkVersion 34\n    namespace 'com.cy.statusnavigationtrans'\n    defaultConfig {\n        minSdkVersion 21\n        targetSdkVersion 33\n        applicationId \"com.cy.statusnavigationtrans\"\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n//指定jdk版本\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n}\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'androidx.appcompat:appcompat:1.7.0'\n    implementation 'androidx.activity:activity:1.8.0'\n    api project(':translucentparent')\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:\\AndroidSDK/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/androidTest/java/com/cy/statusnavigationtrans/ExampleInstrumentedTest.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.cy.statusnavigationtrans\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.cy.statusnavigationtrans\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".BaseSwitchActivity\"></activity>\n        <activity android:name=\".HideNavigationBarActivity\" />\n        <activity android:name=\".HideStatusBarActivity\" />\n        <activity android:name=\".FullScreenActivity\" />\n        <activity android:name=\".Navigation0Activity\" />\n        <activity android:name=\".Status00Activity\" />\n        <activity android:name=\".Status0Activity\" />\n        <activity android:name=\".MainActivity\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <activity android:name=\".Status2Activity\" />\n        <activity android:name=\".Status5Activity\" />\n        <activity android:name=\".Status6Activity\" />\n        <activity android:name=\".Navigation1Activity\" />\n        <activity android:name=\".Navigation2Activity\" />\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/BaseActivity.java",
    "content": "package com.cy.statusnavigationtrans;\nimport android.os.Bundle;\n\nimport androidx.annotation.Nullable;\nimport androidx.appcompat.app.AppCompatActivity;\n\nimport com.cy.translucentparent.StaNavUtils;\n\n/**\n * Created by lenovo on 2017/4/25.\n */\n\npublic abstract class BaseActivity extends AppCompatActivity   {\n    @Override\n    protected void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        StaNavUtils.edgeToEdge(this);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/BaseSwitchActivity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.cy.translucentparent.StaNavUtils;\n\n\npublic class BaseSwitchActivity extends BaseActivity {\n    private boolean fullScreen=false;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status_navigation_switch);\n        final ViewGroup rl1=findViewById(R.id.rl1);\n        final ViewGroup rl2=findViewById(R.id.rl2);\n\n        StaNavUtils.setNavigationBarTransparent(BaseSwitchActivity.this, false);\n        findViewById(R.id.iv).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                fullScreen=!fullScreen;\n                if(fullScreen){\n                    rl1.setVisibility(View.GONE);\n                    rl2.setVisibility(View.GONE);\n                }else {\n                    rl1.setVisibility(View.VISIBLE);\n                    rl2.setVisibility(View.VISIBLE);\n                }\n            }\n        });\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/FullScreenActivity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\nimport android.view.View;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class FullScreenActivity extends BaseActivity {\n    private boolean fullScreen = false;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_full_screen);\n        StaNavUtils.setAppearanceLightStatusBars(this,false);\n        StaNavUtils.setNavigationBarTransparent(this,false);\n        StaNavUtils.fillStatusBar(this,true);\n        findViewById(R.id.iv).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                fullScreen = !fullScreen;\n                StaNavUtils.fullScreen(FullScreenActivity.this,fullScreen);\n            }\n        });\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/HideNavigationBarActivity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class HideNavigationBarActivity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_hide_navigation_bar);\n        StaNavUtils.setAppearanceLightNavigationBars(this,false);\n        StaNavUtils.showNavigationBar(this,false);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/HideStatusBarActivity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class HideStatusBarActivity extends BaseActivity {\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_hide_status_bar);\n        StaNavUtils.showStatusBar(this,false);\n        StaNavUtils.setAppearanceLightStatusBars(this,false);\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/LogUtils.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Build;\nimport android.util.Log;\n\n/**\n * Created by lenovo on 2017/8/20.\n */\n\npublic class LogUtils {\n    private static boolean DEBUG = true;\n\n    private LogUtils() {\n    }\n\n    public static synchronized void debug(boolean debug) {\n        DEBUG = debug;\n    }\n\n    public static void logI(Object tag, Object content) {\n        if(DEBUG==false)return;\n        if (tag == null) tag = \"LOG_I\";\n        Log.i(String.valueOf(tag), \"----------------------------------->>>>\" + content);\n    }\n    public static void logE(Object tag, Object content) {\n        if(DEBUG==false)return;\n        if (tag == null) tag = \"LOG_E\";\n        Log.e(String.valueOf(tag), \"----------------------------------->>>>\" + content);\n    }\n\n\n    public static void logI(Object content) {\n        logI(null,content);\n    }\n    public static void logE(Object content) {\n        logE(null,content);\n    }\n\n    public static void log(Object tag, Object content) {\n        logE(tag,content);\n    }\n    public static void log(Object content) {\n        logE(content);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/MainActivity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.content.Intent;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.View;\n\nimport androidx.annotation.NonNull;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.core.graphics.Insets;\nimport androidx.core.view.OnApplyWindowInsetsListener;\nimport androidx.core.view.ViewCompat;\nimport androidx.core.view.WindowInsetsCompat;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class MainActivity extends BaseActivity implements View.OnClickListener {\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        findViewById(R.id.btn_00).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, Status00Activity.class));\n            }\n        });\n        findViewById(R.id.btn_0).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, Status0Activity.class));\n\n            }\n        });\n        findViewById(R.id.btn_6).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, Status6Activity.class));\n            }\n        });\n        findViewById(R.id.btn_7).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, Navigation0Activity.class));\n\n            }\n        });\n        findViewById(R.id.btn_9).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, Navigation2Activity.class));\n            }\n        });\n        findViewById(R.id.btn_10).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, HideStatusBarActivity.class));\n\n            }\n        });\n        findViewById(R.id.btn_11).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, HideNavigationBarActivity.class));\n\n            }\n        });\n        findViewById(R.id.btn_12).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                startActivity(new Intent(MainActivity.this, FullScreenActivity.class));\n\n            }\n        });\n    }\n\n    @Override\n    public void onClick(View v) {\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Navigation0Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class Navigation0Activity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_navigation0);\n        StaNavUtils.setNavigationBarColor(this,Color.RED);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Navigation2Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class Navigation2Activity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_nav2);\n        StaNavUtils.setNavigationBarTransparent(this,false);\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Status00Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\npublic class Status00Activity extends BaseActivity {\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status00);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Status0Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class Status0Activity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        StaNavUtils.setStatusBarColor(this,Color.RED);\n        setContentView(R.layout.activity_status0);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Status2Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\npublic class Status2Activity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status2);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Status5Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\npublic class Status5Activity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status5);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/cy/statusnavigationtrans/Status6Activity.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport android.os.Bundle;\n\nimport com.cy.translucentparent.StaNavUtils;\n\npublic class Status6Activity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_status6);\n        StaNavUtils.fillStatusBar(this,true);\n        StaNavUtils.setAppearanceLightStatusBars(this,false);\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_full_screen.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    <ImageView\n        android:id=\"@+id/iv\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@drawable/paper\" />\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:gravity=\"center\"\n        android:text=\"点击切换全屏\"\n        android:textColor=\"@color/white\"\n        android:textSize=\"30sp\"\n        android:layout_height=\"match_parent\"/>\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_hide_navigation_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    <ImageView\n        android:id=\"@+id/iv\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@drawable/paper\" />\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_hide_status_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n    <ImageView\n        android:layout_width=\"match_parent\"\n        android:src=\"@drawable/paper\"\n        android:scaleType=\"centerCrop\"\n        android:id=\"@+id/iv\"\n        android:layout_height=\"match_parent\"/>\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/activity_main\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/white\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:orientation=\"vertical\">\n        <Button\n            android:id=\"@+id/btn_00\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"系统StatusBar填充界面,自定义背景颜色(文字、icon颜色自动根据StatusBar颜色亮度设置为黑色)\" />\n\n        <Button\n            android:id=\"@+id/btn_0\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"系统StatusBar填充界面,自定义背景颜色(文字、icon颜色自动根据StatusBar颜色亮度设置为白色)\" />\n\n        <Button\n            android:id=\"@+id/btn_6\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"系统StatusBar不填充界面,且全透明于图片之上，修改状态栏icon颜色，使得和图片协调\" />\n\n        <Button\n            android:id=\"@+id/btn_7\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"系统navigationbar填充界面,自定义颜色，icon颜色自动根据navigationbar颜色亮度进行设置\" />\n        <!--        <Button-->\n        <!--            android:id=\"@+id/btn_8\"-->\n        <!--            android:layout_width=\"match_parent\"-->\n        <!--            android:layout_height=\"wrap_content\"-->\n        <!--            android:text=\"系统navigationbar不填充界面,且半透明\" />-->\n\n        <Button\n            android:id=\"@+id/btn_9\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"系统navigationbar不填充界面,且全/半透明\" />\n\n        <Button\n            android:id=\"@+id/btn_10\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"隐藏statusbar\" />\n\n        <Button\n            android:id=\"@+id/btn_11\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"隐藏navigationbar\" />\n\n        <Button\n            android:id=\"@+id/btn_12\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"隐藏statusbar、navigationbar，全屏\" />\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"dsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfgdsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\ndsgdfgdfgdsfgdfg\\n\"\n            android:textSize=\"18sp\" />\n    </LinearLayout>\n\n</ScrollView>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_nav1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/activity_status7\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\">\n\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:gravity=\"center\"\n        android:layout_alignParentBottom=\"true\"\n        android:text=\"navigationBar半透明\"\n        android:textColor=\"@color/white\" />\n<!--    <com.cy.translucentparent.NavigationBarView-->\n<!--        android:layout_width=\"match_parent\"-->\n<!--        android:background=\"#33000000\"-->\n<!--        android:layout_height=\"wrap_content\"/>-->\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_nav2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/activity_status7\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\">\n\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:layout_gravity=\"bottom\"\n        android:gravity=\"center\"\n        android:layout_alignParentBottom=\"true\"\n        android:text=\"navigationBar全透明\"\n        android:textColor=\"@color/white\" />\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_navigation0.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/red\"\n    tools:context=\".Navigation0Activity\">\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_alignParentBottom=\"true\"\n        android:gravity=\"center\"\n        android:text=\"系统navigationbar填充界面，并且navigation自定义颜色\"\n        android:layout_height=\"wrap_content\"/>\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_status0.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\"\n    android:orientation=\"vertical\">\n\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:background=\"@color/theme\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"文字、icon颜色根据StatusBar颜色亮度设置为白色\"\n            android:textColor=\"#ffffff\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"@color/white\"\n        android:orientation=\"vertical\"></LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_status00.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\"\n    android:orientation=\"vertical\">\n\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:background=\"#f2f2f2\"\n        android:layout_height=\"48dp\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"文字、icon颜色根据StatusBar颜色亮度设置为黑色\"\n            android:textColor=\"#2d1d1d\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"@color/white\"\n        android:orientation=\"vertical\"></LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_status2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\"\n    android:orientation=\"vertical\">\n    <com.cy.translucentparent.StatusBarView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"/>\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:background=\"@color/colorPrimary\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"StatusBar半透明\"\n            android:textColor=\"#ffffff\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"@color/white\"\n        android:orientation=\"vertical\"></LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_status5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\"\n    android:orientation=\"vertical\">\n    <ImageView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@drawable/paper\" />\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:background=\"@color/colorPrimary\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"StatusBar半透明于图片之上(setStatusBarColor)\"\n            android:textColor=\"#ffffff\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"@color/white\"\n        android:orientation=\"vertical\"></LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_status6.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\"\n    android:orientation=\"vertical\">\n\n    <ImageView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@drawable/paper\" />\n\n<!--    <RelativeLayout-->\n<!--        android:layout_width=\"match_parent\"-->\n<!--        android:layout_height=\"48dp\"-->\n<!--        android:background=\"@color/colorPrimary\">-->\n\n<!--        <TextView-->\n<!--            android:layout_width=\"match_parent\"-->\n<!--            android:layout_height=\"match_parent\"-->\n<!--            android:gravity=\"center\"-->\n<!--            android:text=\"StatusBar全透明于图片之上\"-->\n<!--            android:textColor=\"#ffffff\" />-->\n<!--    </RelativeLayout>-->\n\n<!--    <LinearLayout-->\n<!--        android:layout_width=\"match_parent\"-->\n<!--        android:layout_height=\"match_parent\"-->\n<!--        android:background=\"@color/white\"-->\n<!--        android:orientation=\"vertical\"></LinearLayout>-->\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_status_navigation_switch.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/colorPrimary\">\n\n    <ImageView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:scaleType=\"centerCrop\"\n        android:id=\"@+id/iv\"\n        android:src=\"@drawable/paper\" />\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:id=\"@+id/rl1\"\n        android:background=\"@color/colorPrimary\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"点击图片切换statusbar、navigationbar显示\"\n            android:textColor=\"#ffffff\" />\n    </RelativeLayout>\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"48dp\"\n        android:layout_gravity=\"bottom\"\n        android:id=\"@+id/rl2\"\n        android:background=\"@color/colorPrimary\">\n\n        <TextView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center\"\n            android:text=\"点击图片切换statusbar、navigationbar显示\"\n            android:textColor=\"#ffffff\" />\n    </RelativeLayout>\n</FrameLayout>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n\n\n    <color name=\"white\">#ffffff</color>\n    <color name=\"line\">#e6e6e6</color>\n    <color name=\"transparent\">#00000000</color>\n    <color name=\"transparent_half\">#66000000</color>\n    <color name=\"transparent_half_2\">#20000000</color>\n\n    <color name=\"text_deep\">#333333</color>\n    <color name=\"red\">#fb484c</color>\n    <color name=\"halfred\">#77fb484c</color>\n    <color name=\"halfred2\">#11fb484c</color>\n    <color name=\"bg\">#eaebed</color>\n    <color name=\"text_deep_est\">#343434</color>\n    <color name=\"text_tint\">#999999</color>\n    <color name=\"text_tint_half\">#55999999</color>\n    <color name=\"mengban_black\">#99000000</color>\n    <color name=\"huangse\">#ffff00</color>\n    <color name=\"transparent_white\">#22ffffff</color>\n    <!--<color name=\"theme\">#304B90</color>-->\n    <!--<color name=\"theme_half\">#2a5caa</color>-->\n    <color name=\"theme\">#2a5caa</color>\n\n    <color name=\"theme_half\">#2a5caa</color>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"margin_dialog\">20dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n    <dimen name=\"height_title\">48dp</dimen>\n    <dimen name=\"height_main_tab\">56dp</dimen>\n    <dimen name=\"height_btn_login\">56dp</dimen>\n    <dimen name=\"padding_content\">10dp</dimen>\n    <dimen name=\"dp_20\">20dp</dimen>\n    <dimen name=\"dp_30\">30dp</dimen>\n    <dimen name=\"dp_40\">40dp</dimen>\n    <dimen name=\"dp_50\">50dp</dimen>\n    <dimen name=\"size_0\">22sp</dimen>\n    <dimen name=\"size_1\">18sp</dimen>\n    <dimen name=\"size_2\">17sp</dimen>\n    <dimen name=\"size_3\">16sp</dimen>\n    <dimen name=\"size_4\">15sp</dimen>\n    <dimen name=\"size_5\">14sp</dimen>\n    <dimen name=\"size_6\">13sp</dimen>\n    <dimen name=\"size_7\">12sp</dimen>\n    <dimen name=\"size_8\">11sp</dimen>\n    <dimen name=\"size_9\">10sp</dimen>\n    <dimen name=\"size_10\">9sp</dimen>\n    <dimen name=\"size_11\">8sp</dimen>\n    <dimen name=\"size_12\">7sp</dimen>\n    <dimen name=\"size_13\">6sp</dimen>\n    <dimen name=\"size_14\">5sp</dimen>\n    <dimen name=\"iv_head_rect_radius\">5dp</dimen>\n    <dimen name=\"iv_circle_border_width\">1dp</dimen>\n    <dimen name=\"head_width\">60dp</dimen>\n    <dimen name=\"chat_head_width\">40dp</dimen>\n    <dimen name=\"head_width_gerenzhuye\">90dp</dimen>\n    <dimen name=\"padding_small\">5dp</dimen>\n    <dimen name=\"width_index\">24dp</dimen>\n    <dimen name=\"height_min_chat_BubbleLayout\">60dp</dimen>\n    <dimen name=\"width_max_chat_BubbleLayout\">100dp</dimen>\n    <dimen name=\"width_chat_iv_framelayout\">150dp</dimen>\n    <dimen name=\"height_banner\">180dp</dimen>\n    <dimen name=\"height_banner_goods_detail\">260dp</dimen>\n\n\n    <dimen name=\"bl_arrowHeight\">12dp</dimen>\n    <dimen name=\"bl_cornersRadius\">10dp</dimen>\n\n\n    <!--<dimen name=\"bl_cornersRadius\">10dp</dimen>-->\n    <!--<dimen name=\"bl_arrowHeight\">10dp</dimen>-->\n    <!--<dimen name=\"bl_arrowPosition\">10dp</dimen>-->\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">StatusNavigationTrans</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!--&lt;!&ndash; Base application theme. &ndash;&gt;-->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n\n        <!--此处可自行根据项目需要设置,和状态栏导航栏透明无关-->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/theme</item>\n        <item name=\"android:windowBackground\">@color/white</item>\n        <item name=\"android:windowSoftInputMode\">stateAlwaysHidden</item>\n        <item name=\"android:textColor\">@color/text_deep</item>\n        <item name=\"android:textSize\">@dimen/size_3</item>\n        <item name=\"android:scaleType\">centerInside</item>\n        <item name=\"android:launchMode\">singleTop</item>\n        <item name=\"textAllCaps\">false</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/test/java/com/cy/statusnavigationtrans/ExampleUnitTest.java",
    "content": "package com.cy.statusnavigationtrans;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "build.gradle.kts",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nplugins {\n    alias(libs.plugins.android.application) apply false\n    alias(libs.plugins.kotlin.android) apply false\n    alias(libs.plugins.android.library) apply false\n}"
  },
  {
    "path": "gradle/libs.versions.toml",
    "content": "[versions]\nagp = \"8.9.1\"\nkotlin = \"2.0.21\"\ncoreKtx = \"1.10.1\"\njunit = \"4.13.2\"\njunitVersion = \"1.1.5\"\nespressoCore = \"3.5.1\"\nlifecycleRuntimeKtx = \"2.6.1\"\nactivityCompose = \"1.8.0\"\ncomposeBom = \"2024.09.00\"\nappcompat = \"1.7.0\"\nmaterial = \"1.10.0\"\nactivity = \"1.8.0\"\nconstraintlayout = \"2.2.1\"\n\n[libraries]\nandroidx-core-ktx = { group = \"androidx.core\", name = \"core-ktx\", version.ref = \"coreKtx\" }\njunit = { group = \"junit\", name = \"junit\", version.ref = \"junit\" }\nandroidx-junit = { group = \"androidx.test.ext\", name = \"junit\", version.ref = \"junitVersion\" }\nandroidx-espresso-core = { group = \"androidx.test.espresso\", name = \"espresso-core\", version.ref = \"espressoCore\" }\nandroidx-lifecycle-runtime-ktx = { group = \"androidx.lifecycle\", name = \"lifecycle-runtime-ktx\", version.ref = \"lifecycleRuntimeKtx\" }\nandroidx-activity-compose = { group = \"androidx.activity\", name = \"activity-compose\", version.ref = \"activityCompose\" }\nandroidx-compose-bom = { group = \"androidx.compose\", name = \"compose-bom\", version.ref = \"composeBom\" }\nandroidx-ui = { group = \"androidx.compose.ui\", name = \"ui\" }\nandroidx-ui-graphics = { group = \"androidx.compose.ui\", name = \"ui-graphics\" }\nandroidx-ui-tooling = { group = \"androidx.compose.ui\", name = \"ui-tooling\" }\nandroidx-ui-tooling-preview = { group = \"androidx.compose.ui\", name = \"ui-tooling-preview\" }\nandroidx-ui-test-manifest = { group = \"androidx.compose.ui\", name = \"ui-test-manifest\" }\nandroidx-ui-test-junit4 = { group = \"androidx.compose.ui\", name = \"ui-test-junit4\" }\nandroidx-material3 = { group = \"androidx.compose.material3\", name = \"material3\" }\nandroidx-appcompat = { group = \"androidx.appcompat\", name = \"appcompat\", version.ref = \"appcompat\" }\nmaterial = { group = \"com.google.android.material\", name = \"material\", version.ref = \"material\" }\nandroidx-activity = { group = \"androidx.activity\", name = \"activity\", version.ref = \"activity\" }\nandroidx-constraintlayout = { group = \"androidx.constraintlayout\", name = \"constraintlayout\", version.ref = \"constraintlayout\" }\n\n[plugins]\nandroid-application = { id = \"com.android.application\", version.ref = \"agp\" }\nkotlin-android = { id = \"org.jetbrains.kotlin.android\", version.ref = \"kotlin\" }\nkotlin-compose = { id = \"org.jetbrains.kotlin.plugin.compose\", version.ref = \"kotlin\" }\nandroid-library = { id = \"com.android.library\", version.ref = \"agp\" }\n\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Tue Apr 22 14:28:54 GMT+08:00 2025\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.11.1-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app's APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Automatically convert third-party libraries to use AndroidX\nandroid.enableJetifier=true\nandroid.injected.testOnly=false\n\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windows variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle.kts",
    "content": "pluginManagement {\n    repositories {\n        google {\n            content {\n                includeGroupByRegex(\"com\\\\.android.*\")\n                includeGroupByRegex(\"com\\\\.google.*\")\n                includeGroupByRegex(\"androidx.*\")\n            }\n        }\n        mavenCentral()\n        gradlePluginPortal()\n\n        google()\n        maven {\n            url = uri(\"https://repo1.maven.org/maven2/\")\n        }\n    }\n}\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        google()\n        mavenCentral()\n\n        google()\n        maven {\n            url = uri(\"https://www.jitpack.io\")\n        }\n    }\n}\nrootProject.name = \"StatusNavigationTransparent\"\ninclude(\":app\")\ninclude (\"translucentparent\")\n"
  },
  {
    "path": "translucentparent/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "translucentparent/build.gradle",
    "content": "apply plugin: 'com.android.library'\napply plugin: 'org.jetbrains.kotlin.android'\napply plugin: 'maven-publish'\n\nandroid {\n    compileSdkVersion 34\n    namespace 'com.cy.translucentparent'\n\n    defaultConfig {\n        minSdkVersion 21\n        targetSdkVersion 33\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n\n    // ✅ Gradle 自动生成 sources/javadoc Jar，保留注释\n    publishing {\n        singleVariant(\"release\") {\n            withSourcesJar()\n            withJavadocJar()\n        }\n    }\n}\n\ndependencies {\n    compileOnly fileTree(dir: 'libs', include: ['*.jar'])\n    compileOnly 'androidx.appcompat:appcompat:1.7.0'\n    compileOnly 'androidx.activity:activity:1.8.0'\n}\n\nafterEvaluate {\n    publishing {\n        publications {\n            release(MavenPublication) {\n                from components.release\n                groupId = 'com.github.AnJiaoDe'      // TODO: 改成你的 GitHub 用户名\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "translucentparent/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:\\AndroidSDK/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "translucentparent/src/androidTest/java/com/cy/translucentparent/ExampleInstrumentedTest.java",
    "content": "package com.cy.translucentparent;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"com.cy.translucentparent.test\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "translucentparent/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.cy.translucentparent\">\n</manifest>\n"
  },
  {
    "path": "translucentparent/src/main/java/com/cy/translucentparent/LogUtils.java",
    "content": "//package com.cy.translucentparent;\n//\n//import android.os.Build;\n//import android.util.Log;\n//\n///**\n// * Created by lenovo on 2017/8/20.\n// */\n//\n//public class LogUtils {\n//    private static boolean DEBUG = true;\n//\n//    private LogUtils() {\n//    }\n//\n//    public static synchronized void debug(boolean debug) {\n//        DEBUG = debug;\n//    }\n//\n//    public static void logI(Object tag, Object content) {\n//        if(DEBUG==false)return;\n//        if (tag == null) tag = \"LOG_I\";\n//        Log.i(String.valueOf(tag), \"----------------------------------->>>>\" + content);\n//    }\n//    public static void logE(Object tag, Object content) {\n//        if(DEBUG==false)return;\n//        if (tag == null) tag = \"LOG_E\";\n//        Log.e(String.valueOf(tag), \"----------------------------------->>>>\" + content);\n//    }\n//\n//\n//    public static void logI(Object content) {\n//        logI(null,content);\n//    }\n//    public static void logE(Object content) {\n//        logE(null,content);\n//    }\n//\n//    public static void log(Object tag, Object content) {\n//        logE(tag,content);\n//    }\n//    public static void log(Object content) {\n//        logE(content);\n//    }\n//}\n"
  },
  {
    "path": "translucentparent/src/main/java/com/cy/translucentparent/NavigationBarView.java",
    "content": "package com.cy.translucentparent;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.View;\n\nimport androidx.annotation.NonNull;\nimport androidx.core.view.ViewCompat;\nimport androidx.core.view.WindowInsetsCompat;\n\n\n/**\n * Created by lenovo on 2017/7/4.\n */\n\npublic class NavigationBarView extends View {\n    private int height;\n\n    public NavigationBarView(Context context) {\n        this(context,null);\n    }\n\n    public NavigationBarView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        height = StaNavUtils.getNavigationBarHeight(this);\n        ViewCompat.setOnApplyWindowInsetsListener(this, new androidx.core.view.OnApplyWindowInsetsListener() {\n            @NonNull\n            @Override\n            public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) {\n                height = StaNavUtils.getNavigationBarHeight(v);\n                requestLayout();\n                return insets;\n            }\n        });\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));\n    }\n}\n"
  },
  {
    "path": "translucentparent/src/main/java/com/cy/translucentparent/ScreenUtils.java",
    "content": "package com.cy.translucentparent;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.os.Build;\nimport android.util.DisplayMetrics;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.WindowManager;\n\nimport java.lang.reflect.Method;\n\n/**\n * Created by Administrator on 2018/11/20 0020.\n */\n\npublic class ScreenUtils {\n\n    public static int getStatusBarHeight(Context context) {\n        Resources resources = context.getResources();\n        int resourceId = resources.getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n        return resources.getDimensionPixelSize(resourceId);\n    }\n\n    public static int getNavigationBarHeight(Context context) {\n        Resources resources = context.getResources();\n        int resourceId = resources.getIdentifier(\"navigation_bar_height\", \"dimen\", \"android\");\n        return resources.getDimensionPixelSize(resourceId);\n    }\n\n    public static DisplayMetrics getDisplayMetrics(Context context) {\n        DisplayMetrics displayMetrics = new DisplayMetrics();\n        WindowManager wm = (WindowManager) context.getSystemService(\"window\");\n        if (Build.VERSION.SDK_INT <= 17) {\n            wm.getDefaultDisplay().getMetrics(displayMetrics);\n        } else {\n            wm.getDefaultDisplay().getRealMetrics(displayMetrics);\n        }\n        return displayMetrics;\n    }\n\n    public static int getScreenWidth(Context context) {\n        return getDisplayMetrics(context).widthPixels;\n    }\n\n    public static int getScreenHeight(Context context) {\n        return getDisplayMetrics(context).heightPixels;\n    }\n\n    public static int setYStart(Context context, float y) {\n\n//        if (isGroove(context)) {\n\n        return (int) (y * getScreenHeight(context)) + getStatusBarHeight(context);\n//        } else {\n//            return (int) (y * getScreenHeight(context));\n//\n//\n//        }\n    }\n\n    /**\n     * 获取当前界面可视区域的高度\n     *\n     * @param activity\n     * @return\n     */\n    public static int getVisibleFrameHeight(Activity activity) {\n        Rect r = new Rect();\n        //获取当前界面可视部分\n        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);\n\n//        if (isGroove(activity)) {\n\n//            return r.bottom - r.top - getStatusBarHeight(activity);\n//        } else {\n        return r.bottom - r.top;\n//\n//        }\n    }\n\n    /**\n     * 获取当前界面可视区域的宽度\n     *\n     * @param activity\n     * @return\n     */\n    public static int getVisibleFrameWidth(Activity activity) {\n        Rect r = new Rect();\n        //获取当前界面可视部分\n        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(r);\n        return r.right - r.left;\n    }\n\n\n    /**\n     * 将px值转换为dip或dp值，保证尺寸大小不变\n     *\n     * @param pxValue\n     * @return\n     */\n    public static int px2dip(Context context, float pxValue) {\n        final float scale = context.getResources().getDisplayMetrics().density;\n        return (int) (pxValue / scale + 0.5f);\n    }\n\n    public static float getWidthDp(Context context) {\n        DisplayMetrics displayMetrics = getDisplayMetrics(context);\n        return displayMetrics.widthPixels / displayMetrics.density;\n    }\n\n    public static float getHeightDp(Context context) {\n        DisplayMetrics displayMetrics = getDisplayMetrics(context);\n        return displayMetrics.heightPixels / displayMetrics.density;\n    }\n\n    /**\n     * @param context\n     * @param dp\n     * @return\n     */\n    public static float dpTrans(Context context, float dp, float widthDpBase) {\n        return getWidthDp(context) / widthDpBase * dp;\n    }\n\n    /**\n     * @param context\n     * @param dp\n     * @return\n     */\n    public static float dpTrans(Context context, float dp) {\n        return getWidthDp(context) / 360 * dp;\n    }\n\n    /**\n     * 将dp值转换为px值，保证尺寸大小不变\n     *\n     * @return\n     */\n    public static int dpAdapt(Context context, float dp) {\n        return dpAdapt(context, dp, 360);\n    }\n\n    public static int dpAdapt(Context context, float dp, float widthDpBase) {\n        DisplayMetrics dm = context.getResources().getDisplayMetrics();\n        int heightPixels = dm.heightPixels;//高的像素\n        int widthPixels = dm.widthPixels;//宽的像素\n//        int densityDpi = dm.densityDpi;//dpi\n//        float xdpi = dm.xdpi;//xdpi\n//        float ydpi = dm.ydpi;//ydpi\n        float density = dm.density;//density=dpi/160,密度比\n//        float scaledDensity = dm.scaledDensity;//scaledDensity=dpi/160 字体缩放密度比\n        float heightDP = heightPixels / density;//高度的dp\n        float widthDP = widthPixels / density;//宽度的dp\n        float w = Math.min(widthDP, heightDP);\n//        final float scale = activity.getResources().getDisplayMetrics().density;\n        return (int) (dp * w / widthDpBase * density + 0.5f);\n    }\n\n    /**\n     * 将sp值转换为px值，保证尺寸大小不变\n     *\n     * @return\n     */\n    public static int spAdapt(Context context, float sp) {\n        return spAdapt(context, sp, 360);\n    }\n\n    public static int spAdapt(Context context, float sp, float widthDpBase) {\n        DisplayMetrics dm = context.getResources().getDisplayMetrics();\n        int heightPixels = dm.heightPixels;//高的像素\n        int widthPixels = dm.widthPixels;//宽的像素\n//        int densityDpi = dm.densityDpi;//dpi\n//        float xdpi = dm.xdpi;//xdpi\n//        float ydpi = dm.ydpi;//ydpi\n        float density = dm.density;//density=dpi/160,密度比\n//        float scaledDensity = dm.scaledDensity;//scaledDensity=dpi/160 字体缩放密度比\n        float heightDP = heightPixels / density;//高度的dp\n        float widthDP = widthPixels / density;//宽度的dp\n        float w = Math.min(widthDP, heightDP);\n//        final float scale = activity.getResources().getDisplayMetrics().density;\n        return (int) (sp * w / widthDpBase * dm.scaledDensity + 0.5f);\n    }\n\n    /**\n     * 根据手机的分辨率从 dp 的单位 转成为 px(像素)\n     */\n    public static int dp2px(Context context, float dpValue) {\n        final float scale = context.getResources().getDisplayMetrics().density;\n        return (int) (dpValue * scale + 0.5f);\n    }\n\n    /**\n     * 根据手机的分辨率从 px(像素) 的单位 转成为 dp\n     */\n    public static int px2dp(Context context, float pxValue) {\n        final float scale = context.getResources().getDisplayMetrics().density;\n        return (int) (pxValue / scale + 0.5f);\n    }\n\n    /**\n     * sp转px\n     */\n    public static int sp2px(Context context, float sp) {\n        float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (sp * scaledDensity + 0.5f);\n    }\n\n    /**\n     * px转sp\n     */\n    public static int px2sp(Context context, float px) {\n        float scaledDensity = context.getResources().getDisplayMetrics().scaledDensity;\n        return (int) (px / scaledDensity + 0.5f);\n    }\n\n    /**\n     * 计算指定的 View 在屏幕中的坐标。\n     */\n    public static int[] getViewScreenLocation(View view) {\n        int[] location = new int[2];\n        // 获取控件在屏幕中的位置，返回的数组分别为控件左顶点的 x、y 的值\n        view.getLocationOnScreen(location);\n        return location;\n    }\n\n    /**\n     * 计算指定的 View 在屏幕中的范围。\n     */\n    public static RectF getViewScreenRectF(View view) {\n        int[] location = new int[2];\n        // 获取控件在屏幕中的位置，返回的数组分别为控件左顶点的 x、y 的值\n        view.getLocationOnScreen(location);\n        return new RectF(location[0], location[1], location[0] + view.getWidth(),\n                location[1] + view.getHeight());\n    }\n\n    /**\n     * 判断触摸点是否在控件内\n     */\n    public static boolean isInViewRange(View view, float rawX, float rawY) {\n        // View view;\n        RectF rect = getViewScreenRectF(view);\n        return rect.contains(rawX, rawY);\n    }\n\n    /**\n     * 判断触摸点是否在控件内\n     */\n    public static boolean isInViewRange(View view, MotionEvent event) {\n\n        // MotionEvent event;\n        // event.getX(); 获取相对于控件自身左上角的 x 坐标值\n        // event.getY(); 获取相对于控件自身左上角的 y 坐标值\n        float x = event.getRawX(); // 获取相对于屏幕左上角的 x 坐标值\n        float y = event.getRawY(); // 获取相对于屏幕左上角的 y 坐标值\n\n        // View view;\n        RectF rect = getViewScreenRectF(view);\n        return rect.contains(x, y);\n    }\n\n    /**\n     * * 判断是否有长按动作发生 * @param lastX 按下时X坐标 * @param lastY 按下时Y坐标 *\n     *\n     * @param thisX         移动时X坐标 *\n     * @param thisY         移动时Y坐标 *\n     * @param lastDownTime  按下时间 *\n     * @param thisEventTime 移动时间 *\n     * @param longPressTime 判断长按时间的阀值\n     */\n    public static boolean isLongPressed(float lastX, float lastY, float thisX,\n                                        float thisY, long lastDownTime, long thisEventTime,\n                                        long longPressTime) {\n        float offsetX = Math.abs(thisX - lastX);\n        float offsetY = Math.abs(thisY - lastY);\n        long intervalTime = thisEventTime - lastDownTime;\n        if (offsetX <= 10 && offsetY <= 10 && intervalTime >= longPressTime) {\n            return true;\n        }\n        return false;\n    }\n\n\n    public static float getDPWidth(Context context) {\n        DisplayMetrics displayMetrics = new DisplayMetrics();\n        WindowManager wm = (WindowManager) context\n                .getSystemService(Context.WINDOW_SERVICE);\n        if (Build.VERSION.SDK_INT <= 17) {\n            wm.getDefaultDisplay().getMetrics(displayMetrics);\n        } else {\n            wm.getDefaultDisplay().getRealMetrics(displayMetrics);\n        }\n        int widthPixels = displayMetrics.widthPixels;//宽的像素\n        float density = displayMetrics.density;//density=dpi/160,密度比\n        float widthDP = widthPixels / density;//宽度的dp\n\n        return widthDP;\n    }\n\n    public static float getDPHeight(Context context) {\n        DisplayMetrics displayMetrics = new DisplayMetrics();\n        WindowManager wm = (WindowManager) context\n                .getSystemService(Context.WINDOW_SERVICE);\n        if (Build.VERSION.SDK_INT <= 17) {\n            wm.getDefaultDisplay().getMetrics(displayMetrics);\n        } else {\n            wm.getDefaultDisplay().getRealMetrics(displayMetrics);\n        }\n        int heightPixels = displayMetrics.heightPixels;//高的像素\n        float density = displayMetrics.density;//density=dpi/160,密度比\n        float heightDP = heightPixels / density;//高度的dp\n        return heightDP;\n    }\n\n\n    //判断是否是华为刘海屏\n    public static boolean isHuaweiScreenHasGroove(Context context) {\n        boolean ret = false;\n        try {\n            ClassLoader cl = context.getClassLoader();\n            Class HwNotchSizeUtil = cl.loadClass(\"com.huawei.android.util.HwNotchSizeUtil\");\n            Method get = HwNotchSizeUtil.getMethod(\"hasNotchInScreen\");\n            ret = (boolean) get.invoke(HwNotchSizeUtil);\n        } catch (Exception e) {\n\n        } finally {\n            return ret;\n        }\n    }\n\n    //获取华为刘海的高宽\n    public static int[] getHuaweiNotchSize(Context context) {\n        int[] ret = new int[]{0, 0};\n        try {\n            ClassLoader cl = context.getClassLoader();\n            Class HwNotchSizeUtil = cl.loadClass(\"com.huawei.android.util.HwNotchSizeUtil\");\n            Method get = HwNotchSizeUtil.getMethod(\"getNotchSize\");\n            ret = (int[]) get.invoke(HwNotchSizeUtil);\n        } catch (Exception e) {\n\n        } finally {\n            return ret;\n        }\n    }\n\n    //判断手机是否是oppo有刘海\n    public static boolean isOppoScreenHasGroove(Context context) {\n        boolean isHasGroove = context.getPackageManager().hasSystemFeature(\"com.oppo.feature.screen.heteromorphism\");\n        return isHasGroove;\n    }\n\n    //判断是否是voio刘海屏\n    public static final int NOTCH_IN_SCREEN_VOIO = 0x00000020;//是否有凹槽\n    public static final int ROUNDED_IN_SCREEN_VOIO = 0x00000008;//是否有圆角\n\n    public static boolean isVoioScreenHasGroove(Context context) {\n        boolean ret = false;\n        try {\n            ClassLoader cl = context.getClassLoader();\n            Class FtFeature = cl.loadClass(\"com.util.FtFeature\");\n            Method get = FtFeature.getMethod(\"isFeatureSupport\", int.class);\n            ret = (boolean) get.invoke(FtFeature, NOTCH_IN_SCREEN_VOIO);\n        } catch (Exception e) {\n\n        } finally {\n            return ret;\n        }\n    }\n\n    public static boolean isGroove(Context context) {\n        if (ScreenUtils.isOppoScreenHasGroove(context) ||\n                ScreenUtils.isVoioScreenHasGroove(context)) {\n            return true;\n        }\n\n        return false;\n\n    }\n\n}\n\n"
  },
  {
    "path": "translucentparent/src/main/java/com/cy/translucentparent/StaNavUtils.java",
    "content": "package com.cy.translucentparent;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.graphics.Color;\nimport android.graphics.Insets;\nimport android.icu.text.IDNA;\nimport android.os.Build;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.Window;\nimport android.view.WindowManager;\nimport android.widget.LinearLayout;\n\nimport androidx.activity.ComponentActivity;\nimport androidx.activity.EdgeToEdge;\nimport androidx.annotation.ColorInt;\nimport androidx.annotation.IdRes;\nimport androidx.annotation.NonNull;\nimport androidx.core.view.ViewCompat;\nimport androidx.core.view.WindowCompat;\nimport androidx.core.view.WindowInsetsCompat;\nimport androidx.core.view.WindowInsetsControllerCompat;\n\nimport java.net.IDN;\nimport java.util.HashMap;\nimport java.util.Map;\n\n\n/**\n * Created by lenovo on 2017/4/25. 做安卓开发，至少有一半的时间都在折腾适配问题，垃圾安卓，垃圾就是垃圾，永远都是垃圾\n */\n\npublic class StaNavUtils {\n    private static final @IdRes int ID_STATUSBAR = R.id.s_t_a_t_u_s_b_a_r;\n    private static final @IdRes int ID_NAVIGATIONBAR = R.id.n_a_v_i_g_a_t_i_o_n_b_a_r;\n\n    public static void edgeToEdge(ComponentActivity componentActivity) {\n        EdgeToEdge.enable(componentActivity);\n\n        ViewGroup decorView = (ViewGroup) componentActivity.getWindow().getDecorView();\n        View decorChild = decorView.getChildAt(0);\n        decorView.removeView(decorChild);\n\n        LinearLayout linearLayout = new LinearLayout(componentActivity);\n        linearLayout.setOrientation(LinearLayout.VERTICAL);\n\n        StatusBarView statusBarView = new StatusBarView(componentActivity);\n        statusBarView.setId(ID_STATUSBAR);\n        setStatusBarColor(componentActivity, Color.WHITE);\n        linearLayout.addView(statusBarView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));\n\n        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 0);\n        layoutParams.weight = 1;\n        linearLayout.addView(decorChild, layoutParams);\n\n        NavigationBarView navigationBarView = new NavigationBarView(componentActivity);\n        navigationBarView.setId(ID_NAVIGATIONBAR);\n        setNavigationBarColor(componentActivity, Color.WHITE);\n        linearLayout.addView(navigationBarView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));\n\n        decorView.addView(linearLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));\n    }\n\n    /**\n     * @param activity\n     * @param isLight  false,就是让文字图标变成亮色\n     */\n    public static void setAppearanceLightStatusBars(Activity activity, boolean isLight) {\n        Window window = activity.getWindow();\n        WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(window, window.getDecorView());\n        controller.setAppearanceLightStatusBars(isLight);\n    }\n\n    /**\n     * @param activity\n     * @param isLight  false,就是让图标变成亮色\n     */\n    public static void setAppearanceLightNavigationBars(Activity activity, boolean isLight) {\n        Window window = activity.getWindow();\n        WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(window, window.getDecorView());\n        controller.setAppearanceLightNavigationBars(isLight);\n    }\n\n    public static void showStatusBar(Activity activity, boolean show) {\n        Window window = activity.getWindow();\n        WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(window, window.getDecorView());\n        View view_statusbar = null;\n        try {\n            view_statusbar = activity.findViewById(ID_STATUSBAR);\n        } catch (Exception e) {\n\n        }\n        if (show) {\n            controller.show(WindowInsetsCompat.Type.statusBars());\n        } else {\n            if (view_statusbar != null) view_statusbar.setVisibility(View.GONE);\n\n            controller.hide(WindowInsetsCompat.Type.statusBars());\n            // 用户滑动边缘拉出状态栏后，还能隐藏\n            controller.setSystemBarsBehavior(\n                    WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);\n            //防止14版本不灵\n            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {\n                // 设置窗口占用刘海区\n                WindowManager.LayoutParams lp = activity.getWindow().getAttributes();\n                lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;\n                activity.getWindow().setAttributes(lp);\n            }\n\n            final View decorView = activity.getWindow().getDecorView();\n            int ui = decorView.getSystemUiVisibility();\n            ui |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                    | View.SYSTEM_UI_FLAG_FULLSCREEN\n                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n            decorView.setSystemUiVisibility(ui);\n        }\n    }\n\n    /**\n     * 内容是否顶入状态栏\n     *\n     * @param activity\n     * @param fill\n     */\n    public static void fillStatusBar(Activity activity, boolean fill) {\n        View view_statusbar = null;\n        try {\n            view_statusbar = activity.findViewById(ID_STATUSBAR);\n        } catch (Exception e) {\n\n        }\n        if (fill) {\n            if (view_statusbar != null) view_statusbar.setVisibility(View.GONE);\n        } else {\n            if (view_statusbar != null) view_statusbar.setVisibility(View.VISIBLE);\n        }\n    }\n\n    /**\n     * 内容是否顶入状态栏\n     *\n     * @param activity\n     * @param fill\n     */\n    public static void fillNavigationBar(Activity activity, boolean fill) {\n        View view_navigarion = null;\n        try {\n            view_navigarion = activity.findViewById(ID_NAVIGATIONBAR);\n        } catch (Exception e) {\n\n        }\n        if (fill) {\n            if (view_navigarion != null) view_navigarion.setVisibility(View.GONE);\n        } else {\n            if (view_navigarion != null) view_navigarion.setVisibility(View.VISIBLE);\n        }\n    }\n\n    public static void showNavigationBar(Activity activity, boolean show) {\n        Window window = activity.getWindow();\n        WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(window, window.getDecorView());\n        View view_navigationbar = null;\n        try {\n            view_navigationbar = activity.findViewById(ID_NAVIGATIONBAR);\n        } catch (Exception e) {\n\n        }\n        if (show) {\n            controller.show(WindowInsetsCompat.Type.navigationBars());\n        } else {\n            if (view_navigationbar != null) view_navigationbar.setVisibility(View.GONE);\n\n            controller.hide(WindowInsetsCompat.Type.navigationBars());\n            // 用户滑动边缘拉出导航栏后，还能隐藏\n            controller.setSystemBarsBehavior(\n                    WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE\n            );\n        }\n    }\n\n    public static void fullScreen(Activity activity, boolean fullScreen) {\n        showStatusBar(activity, !fullScreen);\n        showNavigationBar(activity, !fullScreen);\n        //防止10版本不灵\n        if (fullScreen) {\n            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {\n                // 设置窗口占用刘海区\n                WindowManager.LayoutParams lp = activity.getWindow().getAttributes();\n                lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;\n                activity.getWindow().setAttributes(lp);\n            }\n\n            View decorView = activity.getWindow().getDecorView();\n            int ui = decorView.getSystemUiVisibility();\n            ui |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n                    | View.SYSTEM_UI_FLAG_FULLSCREEN\n                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n            decorView.setSystemUiVisibility(ui);\n        }\n    }\n\n    /**\n     * 判断颜色是否为亮色\n     *\n     * @param color\n     * @return\n     */\n    public static boolean isLightColor(int color) {\n        double darkness = 1 - (0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color)) / 255;\n        if (darkness < 0.5) {\n            return true; // It's a light color\n        } else {\n            return false; // It's a dark color\n        }\n    }\n\n    /**\n     * * 导航栏全透明，布局会填充到导航栏底部，有些手机是半透明\n     *\n     * @param activity\n     * @param isLightColor 使得导航栏图标颜色根据背景色修改颜色为亮或者暗\n     */\n    public static void setNavigationBarTransparent(Activity activity, boolean isLightColor) {\n        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n        fillNavigationBar(activity, true);\n        setAppearanceLightNavigationBars(activity, isLightColor);\n    }\n\n    /**\n     * 状态栏自定义背景颜色,6.0以上可修改状态栏字体颜色，icon颜色\n     *\n     * @param activity\n     * @param color\n     */\n    public static void setStatusBarColor(Activity activity, int color) {\n        try {\n            /**\n             *  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.widget.ContentFrameLayout.setDecorPadding(int, int, int, int)' on a null object reference\n             *  at androidx.appcompat.app.AppCompatDelegateImpl.applyFixedSizeWindow(AppCompatDelegateImpl.java:1085)\n             * at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:879)\n             * at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:667)\n             */\n            View view = activity.findViewById(ID_STATUSBAR);\n            view.setBackgroundColor(color);\n        } catch (Exception e) {\n\n        }\n        boolean isLightColor = isLightColor(color);\n        setAppearanceLightStatusBars(activity, isLightColor);\n    }\n\n    public static void setNavigationBarColor(Activity activity, int color) {\n        try {\n            /**\n             *  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.widget.ContentFrameLayout.setDecorPadding(int, int, int, int)' on a null object reference\n             *  at androidx.appcompat.app.AppCompatDelegateImpl.applyFixedSizeWindow(AppCompatDelegateImpl.java:1085)\n             * at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:879)\n             * at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:667)\n             */\n            View view = activity.findViewById(ID_NAVIGATIONBAR);\n            view.setBackgroundColor(color);\n        } catch (Exception e) {\n\n        }\n        boolean isLightColor = isLightColor(color);\n        setAppearanceLightNavigationBars(activity, isLightColor);\n    }\n\n    public static void setStatusBarColorOld(Activity activity, int color) {\n        Window window = activity.getWindow();\n        //去除statusbar不填充的标志\n        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n        int ui = window.getDecorView().getSystemUiVisibility();\n        boolean isLightColor = isLightColor(color);\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n            if (isLightColor) {\n                ui |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; //设置状态栏中字体的颜色为黑色\n            } else {\n                ui &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; //设置状态栏中字体颜色为白色\n            }\n        }\n        window.getDecorView().setSystemUiVisibility(ui);\n        window.setStatusBarColor(color);\n        setAppearanceLightStatusBars(activity, isLightColor);\n    }\n\n    /**\n     * 设置导航栏颜色，和setNavigationBarTransparent互斥，要么选择自定义导航栏颜色，要么选择导航栏全透明\n     * @param activity\n     * @param color\n     */\n    public static void setNavigationBarColorOld(Activity activity, int color) {\n        Window window = activity.getWindow();\n        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n        int ui = window.getDecorView().getSystemUiVisibility();\n        boolean isLightColor = isLightColor(color);\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n            if (isLightColor) {\n                ui |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; //设置导航栏中字体的颜色为黑色\n            } else {\n                ui &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; //设置导航栏中字体颜色为白色\n            }\n        }\n        window.getDecorView().setSystemUiVisibility(ui);\n        window.setNavigationBarColor(color);\n        setAppearanceLightNavigationBars(activity, isLightColor);\n    }\n\n    public static int getStatusBarHeight(Activity activity) {\n        return getStatusBarHeight(activity.getWindow().getDecorView());\n    }\n\n    /**\n     * 注意：安卓15及以上不准确，必须 setOnApplyWindowInsetsListener 监控才能获取正确的高度\n     *\n     * @param view\n     * @return\n     */\n    public static int getStatusBarHeight(View view) {\n        WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(view);\n        int h = 0;\n        if (insets != null)\n            h = insets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.statusBars()).top;\n        return Math.max(h, getStatusBarHeightLegacy(view.getContext()));\n    }\n\n    public static int getNavigationBarHeight(Activity activity) {\n        return getNavigationBarHeight(activity.getWindow().getDecorView());\n    }\n\n    /**\n     * 注意：安卓15及以上不准确，必须 setOnApplyWindowInsetsListener 监控才能获取正确的高度\n     *\n     * @param view\n     * @return\n     */\n    public static int getNavigationBarHeight(View view) {\n        WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(view);\n        int h = 0;\n        if (insets != null)\n            h = insets.getInsetsIgnoringVisibility(WindowInsetsCompat.Type.navigationBars()).bottom;\n        return Math.max(h, getNavigationBarHeightLegacy(view.getContext()));\n    }\n\n    public static int getStatusBarHeightLegacy(Context context) {\n        int resId = context.getResources()\n                .getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n        return resId > 0 ? context.getResources().getDimensionPixelSize(resId) : 0;\n    }\n\n    public static int getNavigationBarHeightLegacy(Context context) {\n        int resId = context.getResources()\n                .getIdentifier(\"navigation_bar_height\", \"dimen\", \"android\");\n        return resId > 0 ? context.getResources().getDimensionPixelSize(resId) : 0;\n    }\n//垃圾安卓，都他妈不灵了，damn\n//    public static int getStatusBarHeight(Activity activity) {\n//        WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(activity.getWindow().getDecorView());\n//        if (insets == null) return 0;\n//        return insets.getInsets(WindowInsetsCompat.Type.statusBars()).top;\n//        return insets.getSystemWindowInsetTop();\n//    }\n//\n//    public static int getNavigationBarHeight(Activity activity) {\n//        WindowInsetsCompat insets = ViewCompat.getRootWindowInsets(activity.getWindow().getDecorView());\n//        if (insets == null) return 0;\n//        return insets.getInsets(WindowInsetsCompat.Type.navigationBars()).top;\n//    }\n\n    //安卓14不灵了\n//    public static int getStatusBarHeight(Context context) {\n//        Resources resources = context.getResources();\n//        int resourceId = resources.getIdentifier(\"status_bar_height\", \"dimen\", \"android\");\n//        return resources.getDimensionPixelSize(resourceId);\n//    }\n//\n//    public static int getNavigationBarHeight(Context context) {\n//        Resources resources = context.getResources();\n//        int resourceId = resources.getIdentifier(\"navigation_bar_height\", \"dimen\", \"android\");\n//        return resources.getDimensionPixelSize(resourceId);\n//    }\n}\n"
  },
  {
    "path": "translucentparent/src/main/java/com/cy/translucentparent/StatusBarView.java",
    "content": "package com.cy.translucentparent;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.View;\n\nimport androidx.annotation.NonNull;\nimport androidx.core.graphics.Insets;\nimport androidx.core.view.OnApplyWindowInsetsListener;\nimport androidx.core.view.ViewCompat;\nimport androidx.core.view.WindowInsetsCompat;\n\n\n/**\n * Created by lenovo on 2017/7/4.\n */\n\npublic class StatusBarView extends View {\n    private int height;\n    public StatusBarView(Context context) {\n        this(context, null);\n    }\n\n    public StatusBarView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        height = StaNavUtils.getStatusBarHeight(this);\n        ViewCompat.setOnApplyWindowInsetsListener(this, new androidx.core.view.OnApplyWindowInsetsListener() {\n            @NonNull\n            @Override\n            public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) {\n                height = StaNavUtils.getStatusBarHeight(v);\n                requestLayout();\n                return insets;\n            }\n        });\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));\n    }\n}\n"
  },
  {
    "path": "translucentparent/src/main/res/values/ids.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <item name=\"s_t_a_t_u_s_b_a_r\" type=\"id\"/>\n    <item name=\"n_a_v_i_g_a_t_i_o_n_b_a_r\" type=\"id\"/>\n</resources>"
  },
  {
    "path": "translucentparent/src/test/java/com/cy/translucentparent/ExampleUnitTest.java",
    "content": "package com.cy.translucentparent;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  }
]