最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android 8.1隱藏狀態(tài)欄圖標(biāo)的實例代碼

 更新時間:2020年04月03日 10:54:45   作者:祥子Gyx  
這篇文章主要介紹了Android 8.1隱藏狀態(tài)欄圖標(biāo),本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

近期客戶需求,狀態(tài)欄只顯示時間和電池圖標(biāo),如圖 

狀態(tài)欄圖標(biāo)的布局文件在frameworks\base\packages\SystemUI\res\layout\status_bar.xml,主要包括通知,定位,藍(lán)牙,信號,時間,電池等圖標(biāo),只要在相應(yīng)的布局文件中加入屬性android:visibility="invisible" 或者“gone”即可

<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
** you may not use this file except in compliance with the License. 
** You may obtain a copy of the License at 
**
**   http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/
-->
<!--  android:background="@drawable/status_bar_closed_default_background" -->
<com.android.systemui.statusbar.phone.PhoneStatusBarView
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
  android:layout_width="match_parent"
  android:layout_height="@dimen/status_bar_height"
  android:id="@+id/status_bar"
  android:background="@drawable/system_bar_background"
  android:orientation="vertical"
  android:focusable="false"
  android:descendantFocusability="afterDescendants"
  >
  <ImageView
    android:id="@+id/notification_lights_out"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:paddingStart="6dip"
    android:paddingBottom="2dip"
    android:src="@drawable/ic_sysbar_lights_out_dot_small"
    android:scaleType="center"
    android:visibility="gone"
    />
  <LinearLayout android:id="@+id/status_bar_contents"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingStart="6dp"
    android:paddingEnd="8dp"
    android:orientation="horizontal"
    >
    <!-- The alpha of this area is controlled from both PhoneStatusBarTransitions and
       PhoneStatusBar (DISABLE_NOTIFICATION_ICONS). -->
    <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
      android:id="@+id/notification_icon_area"
      android:layout_width="0dip"
      android:layout_height="match_parent"
      android:layout_weight="1"
      android:visibility="invisible"
      android:orientation="horizontal" />
    <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      >
      <include layout="@layout/system_icons" />
      <com.android.systemui.statusbar.policy.Clock
        android:id="@+id/clock"
        android:textAppearance="@style/TextAppearance.StatusBar.Clock"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:singleLine="true"
        android:paddingStart="@dimen/status_bar_clock_starting_padding"
        android:paddingEnd="@dimen/status_bar_clock_end_padding"
        android:gravity="center_vertical|start"
        />
    </com.android.keyguard.AlphaOptimizedLinearLayout>
  </LinearLayout>
  <ViewStub
    android:id="@+id/emergency_cryptkeeper_text"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout="@layout/emergency_cryptkeeper_text"
  />
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
<?xml version="1.0" encoding="utf-8"?><!--
 ~ Copyright (C) 2014 The Android Open Source Project
 ~
 ~ Licensed under the Apache License, Version 2.0 (the "License");
 ~ you may not use this file except in compliance with the License.
 ~ You may obtain a copy of the License at
 ~
 ~   http://www.apache.org/licenses/LICENSE-2.0
 ~
 ~ Unless required by applicable law or agreed to in writing, software
 ~ distributed under the License is distributed on an "AS IS" BASIS,
 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ~ See the License for the specific language governing permissions and
 ~ limitations under the License
 -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/system_icons"
  android:layout_width="wrap_content"
  android:layout_height="match_parent"
  android:gravity="center_vertical">
  <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/statusIcons"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:gravity="center_vertical"
    android:visibility="invisible"
    android:orientation="horizontal"/>
  <include layout="@layout/signal_cluster_view"
    android:visibility="invisible"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="@dimen/signal_cluster_margin_start"/>
  <com.android.systemui.BatteryMeterView android:id="@+id/battery"
    android:layout_height="match_parent"
    android:layout_width="wrap_content"
    />
</LinearLayout>

總結(jié)

到此這篇關(guān)于Android 8.1隱藏狀態(tài)欄圖標(biāo)的實例代碼的文章就介紹到這了,更多相關(guān)android 隱藏狀態(tài)欄圖標(biāo)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Android編程防止進程被第三方軟件殺死的方法

    Android編程防止進程被第三方軟件殺死的方法

    這篇文章主要介紹了Android編程防止進程被第三方軟件殺死的方法,涉及Android進程操作的相關(guān)技巧,具有一定參考借鑒價值,需要的朋友可以參考下
    2015-10-10
  • Android開發(fā)之圖片壓縮實現(xiàn)方法分析

    Android開發(fā)之圖片壓縮實現(xiàn)方法分析

    這篇文章主要介紹了Android開發(fā)之圖片壓縮實現(xiàn)方法,結(jié)合實例形式分析了Android圖片壓縮的原理、實現(xiàn)方法及相關(guān)操作注意事項,需要的朋友可以參考下
    2019-03-03
  • Android中PopupMenu組件的使用實例

    Android中PopupMenu組件的使用實例

    本篇文章主要介紹了Android中PopupMenu組件的使用實例,詳細(xì)的介紹了PopupMenu組件的使用,具體一定的參考價值,有興趣的可以了解一下
    2017-07-07
  • 詳解kotlin中::雙冒號的使用

    詳解kotlin中::雙冒號的使用

    在?Kotlin?中?,?::?雙冒號操作符?的作用是獲取類,對象,函數(shù),屬性的?類型對象引用,這篇文章主要介紹了詳解kotlin中::雙冒號的使用,需要的朋友可以參考下
    2023-04-04
  • Android里實現(xiàn)退出主程序的提示代碼

    Android里實現(xiàn)退出主程序的提示代碼

    當(dāng)用戶選擇"確定",就退出當(dāng)前的對話框。其中,有個很重要的函數(shù),Activity.finish(),通過調(diào)用這個函數(shù),退出當(dāng)前運行的整個Android程序
    2013-06-06
  • Android使用vitamio插件實現(xiàn)視頻播放器

    Android使用vitamio插件實現(xiàn)視頻播放器

    這篇文章主要為大家詳細(xì)介紹了Android使用vitamio實現(xiàn)視頻播放器,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-04-04
  • Android onKeyDown監(jiān)聽返回鍵無效的解決辦法

    Android onKeyDown監(jiān)聽返回鍵無效的解決辦法

    這篇文章主要介紹了 Android onKeyDown監(jiān)聽返回鍵無效的解決辦法的相關(guān)資料,需要的朋友可以參考下
    2017-06-06
  • Kotlin中內(nèi)置函數(shù)的用法和區(qū)別總結(jié)

    Kotlin中內(nèi)置函數(shù)的用法和區(qū)別總結(jié)

    眾所周知相比Java, Kotlin提供了不少高級語法特性。對于一個Kotlin的初學(xué)者來說經(jīng)常會寫出一些不夠優(yōu)雅的代碼。下面這篇文章主要給大家介紹了關(guān)于Kotlin中內(nèi)置函數(shù)的用法和區(qū)別的相關(guān)資料,需要的朋友可以參考下
    2018-06-06
  • Android 提交或者上傳數(shù)據(jù)時的dialog彈框動畫效果

    Android 提交或者上傳數(shù)據(jù)時的dialog彈框動畫效果

    我們在使用支付寶支付的時候會看到類似這種彈框動畫效果,下面通過實例代碼給大家分享android 提交或者上傳數(shù)據(jù)時的彈框動畫效果,感興趣的的朋友參考下
    2017-07-07
  • 淺談Viewpager和輪播圖的沖突解決方法

    淺談Viewpager和輪播圖的沖突解決方法

    下面小編就為大家?guī)硪黄獪\談Viewpager和輪播圖的沖突解決方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-04-04

最新評論

固安县| 成安县| 枣阳市| 贡山| 仪征市| 临安市| 侯马市| 横山县| 大洼县| 金山区| 苍南县| 岱山县| 长乐市| 无为县| 淄博市| 武夷山市| 淅川县| 安溪县| 鄯善县| 武冈市| 赞皇县| 威信县| 宣汉县| 安远县| 噶尔县| 衡阳市| 米林县| 满城县| 仙游县| 饶阳县| 桦川县| 留坝县| 柘荣县| 益阳市| 涿鹿县| 当涂县| 江陵县| 恩平市| 萍乡市| 遂昌县| 颍上县|