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

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

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

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

狀態(tài)欄圖標的布局文件在frameworks\base\packages\SystemUI\res\layout\status_bar.xml,主要包括通知,定位,藍牙,信號,時間,電池等圖標,只要在相應的布局文件中加入屬性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>

總結

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

相關文章

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

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

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

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

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

    Android中PopupMenu組件的使用實例

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

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

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

    Android里實現退出主程序的提示代碼

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

    Android使用vitamio插件實現視頻播放器

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

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

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

    Kotlin中內置函數的用法和區(qū)別總結

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

    Android 提交或者上傳數據時的dialog彈框動畫效果

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

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

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

最新評論

齐齐哈尔市| 原阳县| 湖北省| 偃师市| 浦东新区| 庆城县| 吴忠市| 嵊泗县| 河北区| 招远市| 霍城县| 项城市| 神农架林区| 施秉县| 桃园市| 石林| 嘉善县| 马鞍山市| 迁西县| 时尚| 林周县| 贵港市| 洞口县| 许昌市| 荣成市| 闻喜县| 武乡县| 军事| 阿坝| 财经| 泸水县| 来宾市| 长宁区| 夹江县| 左权县| 合川市| 军事| 乐安县| 台安县| 青川县| 澜沧|