Skip to content

Commit

Permalink
opt: debuginfo can be copied
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Apr 28, 2024
1 parent caad0fb commit 9e83bc3
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 51 deletions.
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/headtip_tip_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- rounded_corner.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="18dp" />
<solid android:color="#2A0D84FF" />
</shape>
96 changes: 46 additions & 50 deletions app/src/main/res/layout/development_debug_info.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,59 +15,56 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="false"
android:clipChildren="false"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="@dimen/preference_item_padding_start"
android:paddingEnd="@dimen/preference_item_padding_end"
android:paddingBottom="@dimen/preference_item_padding_inner">

<include layout="@layout/image_frame" />

<RelativeLayout
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1.0">
android:clickable="false"
android:clipChildren="false"
android:gravity="center_vertical"
android:paddingStart="@dimen/preference_item_padding_start"
android:paddingEnd="@dimen/preference_item_padding_end"
android:paddingTop="@dimen/preference_item_padding_inner"
android:paddingBottom="@dimen/preference_item_padding_inner">

<include layout="@layout/image_frame" />

<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/title"
android:layout_width="match_parent"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/textview_white"
android:textColor="@color/textview_black"
android:typeface="monospace"
android:inputType="textMultiLine"
android:textIsSelectable="true"
android:enabled="false"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:longClickable="true"
/>
</RelativeLayout>
android:layout_gravity="center_vertical"
android:layout_weight="1.0"
android:gravity="center_vertical">

<!-- Preference should place its actual preference widget here. -->
<LinearLayout
android:id="@android:id/widget_frame"
android:gravity="center"
android:clipChildren="false"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="@dimen/preference_widget_minWidth" />
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/textview_white"
android:clickable="false"
android:inputType="none"
android:textColor="@color/textview_black"
android:textIsSelectable="true"
android:typeface="monospace" />

<ImageView
android:id="@+id/arrow_right"
android:gravity="center"
android:layout_gravity="center|end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_preference_arrow_right" />

</RelativeLayout>

<!-- Preference should place its actual preference widget here. -->
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:gravity="center"
android:minWidth="@dimen/preference_widget_minWidth"
android:orientation="vertical" />

<ImageView
android:id="@+id/arrow_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:gravity="center"
android:src="@drawable/ic_preference_arrow_right" />

</LinearLayout>
78 changes: 78 additions & 0 deletions app/src/main/res/layout/headtip_tip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2015 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:clickable="false"
android:clipChildren="false"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingTop="6dp"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:paddingBottom="2dp">

<include layout="@layout/image_frame" />

<RelativeLayout
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1.0">

<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/headtip_tip_background"
android:textColor="@color/textview_blue"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="14dp"
android:paddingBottom="14dp"
android:inputType="textMultiLine"
android:textIsSelectable="true"
android:enabled="false"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:longClickable="true"
/>
</RelativeLayout>

<!-- Preference should place its actual preference widget here. -->
<LinearLayout
android:id="@android:id/widget_frame"
android:gravity="center"
android:clipChildren="false"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="@dimen/preference_widget_minWidth" />

<ImageView
android:id="@+id/arrow_right"
android:gravity="center"
android:layout_gravity="center|end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_preference_arrow_right" />

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1725,5 +1725,6 @@

<string name="headtip_warn_not_offical_rom">您正在使用的 ROM 来源可能并不是 Xiaomi 官方,部分功能可能会失效,详情请咨询您正在使用 ROM 的提供者。</string>
<string name="headtip_warn_sign_verification_failed">签名校验失败,您当前使用的版本可能并非来自于 Re.chronoRain 的官方版本,可能包含恶意代码,请注意使用安全。</string>
<string name="headtip_tip_long_press_to_copy">您可以长按或双击后选择文本进行操作,或者复制并反馈给开发者。</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,7 @@
<string name="help_cant_see_apps_switch_desc">You can still find this page in \"Settings - Set up the homepage entry\". Reboot app to apply.</string>
<string name="headtip_warn_not_offical_rom">The source of the ROM you are using may not be official from Xiaomi, and some functions may not work, please contact the provider you are using for details.</string>
<string name="headtip_warn_sign_verification_failed">The signature verification failed, and the current version you are using may not be from the official version of Re.chronoRain, and may contain malicious code.</string>
<string name="headtip_tip_long_press_to_copy">You can select text after long or double press, or copy it and feed it back to the developer.</string>
<string name="safe_mode_title">Warning</string>
<string name="safe_mode_desc">has entered safe mode due to multiple crashes and HyperCeiler functionality has been temporarily disabled. \nClick OK to cancel, click Cancel to process later.</string>
<string name="safe_mode_history">View exception records</string>
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/res/xml/prefs_development_debug_info.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<Preference
android:layout="@layout/headtip_tip"
android:key="prefs_key_headtip_tip"
android:enabled="false"
android:title="@string/headtip_tip_long_press_to_copy" />

<Preference
android:layout="@layout/development_debug_info"
android:key="prefs_key_debug_info"
android:enabled="false"
android:enabled="true"
android:title="@string/debug_info" />

</PreferenceScreen>

0 comments on commit 9e83bc3

Please sign in to comment.