mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-06 02:35:32 +08:00
528 lines
26 KiB
XML
528 lines
26 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||
xmlns:tools="http://schemas.android.com/tools"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:background="@color/colorThemeBackground"
|
||
android:orientation="vertical"
|
||
tools:context=".ui.MainActivity"
|
||
tools:ignore="HardcodedText,UseCompoundDrawables,ContentDescription">
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:elevation="0dp"
|
||
android:gravity="center|start"
|
||
android:paddingLeft="15dp"
|
||
android:paddingTop="13dp"
|
||
android:paddingRight="15dp"
|
||
android:paddingBottom="5dp">
|
||
|
||
<TextView
|
||
android:layout_width="0dp"
|
||
android:layout_height="wrap_content"
|
||
android:layout_weight="1"
|
||
android:singleLine="true"
|
||
android:text="MIUI 原生通知图标"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="25sp"
|
||
android:textStyle="bold" />
|
||
|
||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||
android:id="@+id/title_restart_icon"
|
||
style="?android:attr/selectableItemBackgroundBorderless"
|
||
android:layout_width="28dp"
|
||
android:layout_height="28dp"
|
||
android:layout_marginEnd="5dp"
|
||
android:alpha="0.85"
|
||
android:src="@mipmap/ic_restart"
|
||
android:tint="@color/colorTextGray"
|
||
android:tooltipText="重启系统界面" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:id="@+id/main_lin_status"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="10dp"
|
||
android:layout_marginRight="15dp"
|
||
android:layout_marginBottom="5dp"
|
||
android:background="@drawable/bg_dark_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center">
|
||
|
||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||
android:id="@+id/main_img_status"
|
||
android:layout_width="25dp"
|
||
android:layout_height="25dp"
|
||
android:layout_marginStart="25dp"
|
||
android:layout_marginEnd="5dp"
|
||
android:src="@mipmap/ic_warn"
|
||
android:tint="@color/white" />
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:orientation="vertical"
|
||
android:paddingLeft="20dp"
|
||
android:paddingTop="10dp"
|
||
android:paddingRight="20dp"
|
||
android:paddingBottom="10dp">
|
||
|
||
<TextView
|
||
android:id="@+id/main_text_status"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="5dp"
|
||
android:text="模块状态未知"
|
||
android:textColor="@color/white"
|
||
android:textSize="18sp" />
|
||
|
||
<TextView
|
||
android:id="@+id/main_text_version"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="5dp"
|
||
android:alpha="0.8"
|
||
android:text="当前版本:%1"
|
||
android:textColor="@color/white"
|
||
android:textSize="13sp" />
|
||
|
||
<TextView
|
||
android:id="@+id/main_text_miui_version"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:alpha="0.8"
|
||
android:text="MIUI 版本:%1"
|
||
android:textColor="@color/white"
|
||
android:textSize="13sp" />
|
||
</LinearLayout>
|
||
</LinearLayout>
|
||
|
||
<androidx.core.widget.NestedScrollView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="match_parent"
|
||
android:layout_marginBottom="10dp"
|
||
android:fadingEdgeLength="10dp"
|
||
android:fillViewport="true"
|
||
android:requiresFadingEdge="vertical">
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:animateLayoutChanges="true"
|
||
android:orientation="vertical">
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="10dp"
|
||
android:layout_marginRight="15dp"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="horizontal"
|
||
android:padding="15dp">
|
||
|
||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||
android:layout_width="15dp"
|
||
android:layout_height="15dp"
|
||
android:layout_marginEnd="10dp"
|
||
android:alpha="0.85"
|
||
android:src="@mipmap/ic_about"
|
||
android:tint="@color/colorTextDark" />
|
||
|
||
<TextView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="5dp"
|
||
android:text="修改设置或开启关闭模块请点击右上角重启系统界面才能生效。"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="11sp"
|
||
tools:ignore="SmallSp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="10dp"
|
||
android:layout_marginRight="15dp"
|
||
android:animateLayoutChanges="true"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:paddingLeft="15dp"
|
||
android:paddingRight="15dp">
|
||
|
||
<com.fankes.miui.notify.view.MaterialSwitch
|
||
android:id="@+id/module_enable_switch"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="40dp"
|
||
android:layout_marginTop="5dp"
|
||
android:text="启用模块"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<com.fankes.miui.notify.view.MaterialSwitch
|
||
android:id="@+id/module_enable_log_switch"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="35dp"
|
||
android:layout_marginBottom="5dp"
|
||
android:text="启用调试日志"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="模块关闭后一切功能都将彻底停止工作。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:id="@+id/config_item_color_hook"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="10dp"
|
||
android:layout_marginRight="15dp"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:paddingLeft="15dp"
|
||
android:paddingRight="15dp">
|
||
|
||
<com.fankes.miui.notify.view.MaterialSwitch
|
||
android:id="@+id/color_icon_fix_switch"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:text="忽略彩色通知图标"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="此选项默认开启,开启后将自动对 APP 通知图标进行判断,保持高版本 API 的 APP 不规范的彩色图标不被着色为白、黑色块并对图标进行圆角优化,关闭后将按照 Android API 规范对 APP 通知进行图标着色,可能会出现着色为黑白、色块情况。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
|
||
<com.fankes.miui.notify.view.MaterialSwitch
|
||
android:id="@+id/color_icon_compat_switch"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="35dp"
|
||
android:layout_marginBottom="5dp"
|
||
android:text="启用兼容模式"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<TextView
|
||
android:id="@+id/color_icon_compat_text"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="如果发现通知图标颜色判定不正常可启用兼容模式,一般情况下不建议启用兼容模式,发生问题请关闭兼容模式。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:id="@+id/config_item_notify"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="10dp"
|
||
android:layout_marginTop="15dp"
|
||
android:layout_marginRight="10dp"
|
||
android:animateLayoutChanges="true"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:paddingLeft="15dp"
|
||
android:paddingRight="15dp">
|
||
|
||
<com.fankes.miui.notify.view.MaterialSwitch
|
||
android:id="@+id/notify_icon_fix_switch"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="5dp"
|
||
android:layout_marginRight="5dp"
|
||
android:text="启用通知图标优化"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<TextView
|
||
android:id="@+id/config_notify_app_button"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:background="@drawable/bg_button_round"
|
||
android:gravity="center"
|
||
android:padding="10dp"
|
||
android:singleLine="true"
|
||
android:text="配置通知图标优化名单"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="5dp"
|
||
android:layout_marginRight="5dp"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="首次安装请打开名单列表从云端更新数据,后期适配的内容也请手动打开名单列表重新拉取数据以检查更新,数据更新后重启系统界面即可生效。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="5dp"
|
||
android:layout_marginRight="5dp"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="此选项默认开启,开启后将对优化名单内的 APP 通知小图标使用单色调进行修复,特别是通过 MIPUSH 推送的通知,它们始终是 APP 默认图标(彩色的 APP 图标),修复后使得它们的图标看起来更加符合 Android 原生的统一规范。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="15dp"
|
||
android:layout_marginRight="15dp"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:paddingLeft="15dp"
|
||
android:paddingRight="15dp">
|
||
|
||
<com.fankes.miui.notify.view.MaterialSwitch
|
||
android:id="@+id/hide_icon_in_launcher_switch"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:text="在桌面隐藏模块图标"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="15sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.6"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="隐藏模块图标后界面可能会被关闭,将不会再在桌面显示,你可以在 EdXposed、LSPosed 中找到模块设置并打开。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="15dp"
|
||
android:layout_marginRight="15dp"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:padding="15dp">
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:gravity="center|start">
|
||
|
||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||
android:layout_width="15dp"
|
||
android:layout_height="15dp"
|
||
android:layout_marginEnd="5dp"
|
||
android:alpha="0.85"
|
||
android:src="@mipmap/ic_about"
|
||
android:tint="@color/colorTextGray" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:alpha="0.85"
|
||
android:singleLine="true"
|
||
android:text="使用帮助与说明"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.8"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="Q.这个模块是如何诞生的?\nA.这个模块诞生来源于 MIUI 的乱改和不规范,本来 MIUI 9 之后,官方给出了原生通知图标样式,后面由于用户反应通知栏经常出现黑白块。\n这当然不是系统的错,而是国内 APP 和 MIPUSH 的通知极其不规范的通知图标设计。\n但是呢,接到反馈后 MIUI 开发组选择直接忽略这个问题,在 2021-5-18 的开发版开始,把全部通知图标都改成了 APP 的彩色图标,使得之前拥有自有样式的原生图标也被破坏。\n对于 Android 开发者来说,官方文档中的 “setSmallIcon” 不再适用于魔改后的 MIUI,这将会严重破坏非常多的状态图标。\n当然,国内的手机生态除了 MIPUSH 的营销通知就是社交软件的通知,可能大部分人都不会在意这件事情。\n但是,这个模块就是为了修复被 MIUI 开发组忽略的图标问题才诞生的,并完美地给 MIUI 修复了黑白块图标的问题。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.8"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="Q.如何使用?\nA.模块仅支持 LSPosed,EdXposed 也可以使用但随时停止支持,由于模块涉及到修改系统应用,不支持其它 Hook 框架,在 LSPosed 的作用域中,只需勾选“系统界面”(旧版本为“系统 UI”)即可,应用设置后需要重启系统界面。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:alpha="0.8"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="Q.哪些是已知问题?\nA.以下是问题描述列表:\n(1) 动态小图标可能会在高版本系统中闪烁,这是 MIUI 自身就存在的问题,后期只能等官方修复。\n(2) 请始终保持最新版本的 LSPosed,旧版本可能会出现 Hook 不生效的问题。\n(3) 建议最低从 MIUI 12.5 “2021-5-18” 开发版以后开始使用,之前的版本可能或多或少存在 MIUI 自身 BUG 不生效、黑白块问题,若你的系统不存在原生图标问题不建议使用模块。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:alpha="0.8"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="Q.如何反馈问题?\nA.酷安关注 @星夜不荟"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:id="@+id/link_with_project_address"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="15dp"
|
||
android:layout_marginRight="15dp"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:padding="15dp">
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:gravity="center|start">
|
||
|
||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||
android:layout_width="15dp"
|
||
android:layout_height="15dp"
|
||
android:layout_marginEnd="5dp"
|
||
android:alpha="0.85"
|
||
android:src="@mipmap/ic_about"
|
||
android:tint="@color/colorTextGray" />
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:alpha="0.85"
|
||
android:singleLine="true"
|
||
android:text="项目地址"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:alpha="0.8"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="本软件是免费开源项目,遵循 AGPL3.0 协议,你可以点击这里前往 Github 查看源码以及获取模块更新。"
|
||
android:textColor="@color/colorTextDark"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
|
||
<LinearLayout
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginTop="15dp"
|
||
android:layout_marginRight="15dp"
|
||
android:layout_marginBottom="10dp"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:elevation="0dp"
|
||
android:gravity="center"
|
||
android:orientation="vertical"
|
||
android:paddingLeft="15dp"
|
||
android:paddingRight="15dp">
|
||
|
||
<TextView
|
||
android:id="@+id/link_with_follow_me"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginTop="10dp"
|
||
android:layout_marginBottom="10dp"
|
||
android:gravity="center"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="恰饭时间\n点击前往酷安关注我,获取我的更多应用"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="16sp" />
|
||
|
||
<androidx.cardview.widget.CardView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
app:cardCornerRadius="15dp"
|
||
app:cardElevation="0dp">
|
||
|
||
<ImageView
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:src="@mipmap/bg_qr_pay" />
|
||
</androidx.cardview.widget.CardView>
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginBottom="10dp"
|
||
android:gravity="center"
|
||
android:lineSpacingExtra="6dp"
|
||
android:text="开发者 酷安 @星夜不荟\n未经允许不得转载、修改复制我的劳动成果"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="16sp" />
|
||
</LinearLayout>
|
||
|
||
<TextView
|
||
android:layout_width="match_parent"
|
||
android:layout_height="wrap_content"
|
||
android:layout_marginLeft="15dp"
|
||
android:layout_marginRight="15dp"
|
||
android:layout_marginBottom="10dp"
|
||
android:autoLink="web"
|
||
android:background="@drawable/bg_permotion_round"
|
||
android:lineSpacingExtra="6dp"
|
||
android:padding="10dp"
|
||
android:text="此模块使用 YukiHookAPI 构建。\n点击这里了解更多 https://github.com/fankes/YukiHookAPI"
|
||
android:textColor="@color/colorTextGray"
|
||
android:textSize="12sp" />
|
||
</LinearLayout>
|
||
</androidx.core.widget.NestedScrollView>
|
||
</LinearLayout> |