zoukankan      html  css  js  c++  java
  • 亮度

    // 调整屏幕亮度 --> 把亮度调到最高
            WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes();
            lp.screenBrightness = 255f * (1f / 255f);
            getActivity().getWindow().setAttributes(lp);
    /**
         * 获取当前系统亮度
         */
        private int getCurrentSystemScreenLight() {
            int brightValue = 160;
            ContentResolver contentResolver = getActivity().getContentResolver();
            try {
                brightValue = Settings.System.getInt(contentResolver, Settings.System.SCREEN_BRIGHTNESS);
            } catch (Settings.SettingNotFoundException e) {
                MyLog.e("获取当前屏幕亮度失败");
            }
            MyLog.d("当前屏幕亮度:" + brightValue);
            return brightValue;
        }
    // 屏幕亮度恢复
            WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes();
            lp.screenBrightness = currentScreenLight;
            getActivity().getWindow().setAttributes(lp);
  • 相关阅读:
    【题解】【HAOI2011】Problem b
    【题解】完全平方数
    sqoop安装
    hive安装
    hbase分布式安装
    zookeeper分布式安装
    hadoop分布式安装
    zabbix proxy安装及使用
    web数据存储
    js格式
  • 原文地址:https://www.cnblogs.com/H-BolinBlog/p/9228014.html
Copyright © 2011-2022 走看看