Skip to content

Commit

Permalink
新增设置主题功能
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest-su committed Oct 27, 2022
1 parent d512bde commit b0c89a5
Show file tree
Hide file tree
Showing 34 changed files with 4,361 additions and 18 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.preference:preference:1.1.1'
implementation "androidx.multidex:multidex:2.0.1"
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name="androidx.multidex.MultiDexApplication"
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand All @@ -26,6 +26,10 @@
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<activity
android:name=".setting.ThemeSettingActivity"
android:label="@string/setting_theme" />

<provider
android:name=".CmdSuggestionProvider"
android:authorities="ernest.linuxcmd.CmdSuggestionProvider" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/assets/template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="file:///android_asset/style.css" type="text/css" />
</head>
<link rel="stylesheet" href="file:///android_asset/theme/css/style.css" type="text/css" />
</head>
48 changes: 48 additions & 0 deletions app/src/main/assets/theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
7z
===

拥有极高压缩比的开源压缩软件。

## 安装

在 Linux 中输入以下命令安装 7-Zip。

```bash
# Ubuntu 系统
apt-get update
apt-get install p7zip-full -y
```

## 实例

介绍几个常用场景:解压、压缩、查看(压缩包内容)。

1、将压缩文件 text.7z 在当前目录下解压缩。

```bash
7z x text.7z
```

2、将压缩文件 text.7z 在指定目录(/home/text)下解压缩。

```bash
# 注意 -o 用来指定解压缩文件存放目录,-o 后是没有空格的,直接接目录
7z x text.7z -r -o/home/text
```

3、将文件 /home/text 压缩成 text.7z。

```bash
7z a text.7z -r /home/text
```

4、查看压缩包 text.7z 内容,但不解压。

```bash
7z l text.7z
```

## 官网

更多安装使用方法可以访问官网学习:https://www.7-zip.org/

211 changes: 211 additions & 0 deletions app/src/main/assets/theme/css/Chinese-red.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
word-break: break-word;
font-weight: 400;
line-height: 2;
font-size: 17px;
overflow-x: hidden;
color: black;
}
strong {
padding: 1px;
color: #ee3f4d;
}
em {
padding: 0 2px;
color: #f33b1f;
}
h1, h2, h3, h4, h5, h6 {
position: relative;
margin-top: 30px;
margin-bottom: 20px;
line-height: 1.5;
font-weight: bold;
}
h1 {
text-align: center;
padding-bottom: 5px;
font-size: 32px;
color: #ac1f18;
}
h1::after {
content: '';
display: block;
margin: 4px auto 0;
width: 100px;
height: 2px;
border-bottom: 2px solid #f33b1f;
}
h2 {
font-size: 28px;
border-bottom: 1px solid #f33b1f;
}
h2::before {
content: '# ' !important;
color: #f33b1f;
}
h3 {
font-size: 24px;
padding-left: 9px;
border-left: 6px solid #f33b1f;
}
h4 {
font-size: 20px;
}
img {
max-width: 100%;
}
hr {
border-top: 1px solid #bbbbbb;
border-bottom: none;
border-left: none;
border-right: none;
margin: 16px 0;
}
code {
font-family: -apple-system, -apple-system-body, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, PingFang SC, "思源黑体 CN", "思源黑体", "JetBrains Mono", "Fira Code", Menlo, "Ubuntu Mono", Consolas, sans-serif;
word-break: break-word;
overflow-x: auto;
background-color: #f9f1db;
color: #ee2746;
border-radius: 2px;
font-size: 16px;
padding: 1px 2px;
}
pre {
font-family: -apple-system, -apple-system-body, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, PingFang SC, "思源黑体 CN", "思源黑体", "JetBrains Mono", "Fira Code", Menlo, "Ubuntu Mono", Consolas, sans-serif;
overflow: auto;
position: relative;
line-height: 1.75;
}
pre > code {
margin: 12px 0 !important;
border-radius: 3px;
font-size: 15px;
padding: 16px 12px;
word-break: normal;
display: block;
overflow-x: auto;
color: #333;
background: #f7f7f7;
}
a {
text-decoration: none;
color: #1781b5;
padding: 0 2px;
border-bottom: 1px solid #1781b5;
}
a:hover, a:active {
border-bottom: 2px solid #f33b1f;
color: #ac1f18;
}
blockquote {
color: #3d3d3d;
background-color: #fff9f9;
padding: 6px 16px;
margin: 16px 0;
border-left: 3px solid #f07c82;
}
blockquote::after {
display: block;
content: '';
}
blockquote > p {
margin: 6px 0;
}
ol, ul {
padding-left: 30px;
}
ol li, ul li {
margin-bottom: 6px;
}
ol li .task-list-item, ul li .task-list-item {
list-style: none;
}
ol li .task-list-item ul, ul li .task-list-item ul, ol li .task-list-item ol, ul li .task-list-item ol {
margin-top: 6px;
}
ol ul, ul ul, ol ol, ul ol {
margin-top: 6px;
}
ol li {
padding-left: 6px;
}
::marker {
color: #f33b1f;
}
.contains-task-list {
padding-left: 0;
}
.task-list-item {
list-style: none;
}
.task-list-item input[type="checkbox"] {
position: relative;
}
.task-list-item input[type="checkbox"]::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: white;
border: 1px solid #f07c82;
border-radius: 3px;
box-sizing: border-box;
z-index: 1;
}
.task-list-item input[type="checkbox"]:checked::after {
content: "\2713";
position: absolute;
top: -5px;
left: 0;
right: 0;
bottom: 0;
width: 0;
height: 0;
color: #f33b1f;
font-size: 16px;
font-weight: bold;
z-index: 2;
}
table {
display: inline-block !important;
font-size: 14px;
width: auto;
max-width: 100%;
overflow: auto;
border-spacing: 0;
border-collapse: collapse;
}
table thead {
background: #fff9f9;
color: black;
text-align: left;
font-size: 15px;
}
table tr:nth-child(2n) {
background-color: #fcfcfc;
}
table tr:hover {
background-color: #fff9f9;
}
table th, table td {
padding: 12px 7px;
line-height: 24px;
border: 1px solid #f9f1db;
}
table td {
min-width: 120px;
}
@media (max-width: 720px) {
h1 {
font-size: 24px;
}
h2 {
font-size: 20px;
}
h3 {
font-size: 18px;
}
}
Loading

0 comments on commit b0c89a5

Please sign in to comment.