Skip to content

Commit ea665f4

Browse files
committed
UI小调整
1 parent 0c19232 commit ea665f4

29 files changed

+561
-234
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</intent-filter>
4646
</activity>
4747

48-
<activity
48+
<!-- <activity
4949
android:name=".activity.TestActivity"
5050
android:label="博客园测试"
5151
android:screenOrientation="portrait"
@@ -55,7 +55,7 @@
5555
5656
<category android:name="android.intent.category.LAUNCHER"/>
5757
</intent-filter>
58-
</activity>
58+
</activity>-->
5959

6060
<!--博文-->
6161
<activity
@@ -182,7 +182,7 @@
182182

183183
<activity
184184
android:name=".activity.SearchActivity"
185-
android:windowSoftInputMode="adjustPan|stateVisible"/>
185+
android:windowSoftInputMode="stateVisible"/>
186186

187187

188188
<meta-data

app/src/main/assets/css/rae-night.css

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
1-
body,div,p{
1+
body,div,p,.cnblogs_code div{
22
background:#1F1F21;
33
color:#8f9091;
44
}
55
div{
66
opacity: 0.8;
7-
filter: alpha(opacity=80); /* For IE8 and earlier */
7+
filter: alpha(opacity=80); /* For IE8 and earlier */
88
}
9-
.cnblogs_code pre{
10-
opacity: 0.6;
11-
filter: alpha(opacity=60); /* For IE8 and earlier */
12-
border: 1px solid #8f9091;
9+
code{
10+
background: #2B303B !important;
11+
border:none !important;
12+
color:#C0C5CE !important;
1313
}
14+
15+
pre, pre code, .hljs{
16+
background: #2B303B;
17+
color: #C0C5CE;
18+
border:none;
19+
}
20+
.hljs-string, .hljs-title, .hljs-section, .hljs-attribute, .hljs-literal, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-addition{
21+
color:#ECCC87;
22+
}
23+
.hljs-function{
24+
color:#8EA1B4;
25+
}
26+
.code_key_primary, .hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-name, .hljs-tag{
27+
color:#B58DAC;
28+
font-weight: bold;
29+
}
30+
.code_comment,.hljs-comment, .hljs-quote, .hljs-variable{
31+
color:#65737F;
32+
}
33+
.code_args{
34+
color:#C0C5CE;
35+
}
36+
.code_symbol{
37+
color:#C0C5CE;
38+
}
39+
.code_text,.hljs-string{
40+
color:#A2BF88;
41+
}
42+
.code_high_night{
43+
color:#FFCD22;
44+
}
45+
1446
img{
1547
opacity: 0.5;
1648
filter: alpha(opacity=50); /* For IE8 and earlier */
@@ -20,5 +52,5 @@ blockquote{
2052
border-left: 5px solid #eee;
2153
}
2254
a {
23-
color: #135792;
55+
color: #4893D8;
2456
}

app/src/main/assets/css/rae.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,23 @@
1010
}
1111
.container-fluid{
1212
overflow: auto;
13-
}
13+
}
14+
15+
.code_key_primary, .hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-name, .hljs-tag{
16+
color:#0000ff;
17+
}
18+
.code_comment{
19+
color:#008000;
20+
}
21+
.code_args{
22+
color:#000000;
23+
}
24+
.code_symbol{
25+
color:#800080;
26+
}
27+
.code_text{
28+
color:#800000;
29+
}
30+
.code_high_night{
31+
color:#ff0000;
32+
}

app/src/main/assets/js/blog-common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/assets/js/rae.js

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ if(hasJQuery){
1414
}
1515

1616
function onPageLoad(){
17-
1817
}
1918

2019
// 图片点击
2120
function initImage(){
22-
2321
var filter = ["ExpandedBlockStart.gif","ContractedBlock.gif"];
2422
$("img").click(function(e){
2523
var src = $(this).attr("src");
2624

2725
if(src.indexOf("ExpandedBlockStart.gif")!=-1|| src.indexOf("ContractedBlock.gif")!=-1){
28-
return;
26+
return false;
2927
}
3028

3129
e.stopPropagation(); // 阻止事件冒泡
@@ -40,4 +38,50 @@ function initImage(){
4038
app.onImageClick(src, images);
4139
return false;
4240
});
41+
}
42+
43+
44+
// 重新设置代码高亮
45+
function refreshCodeTheme(){
46+
47+
$(".cnblogs_code span").each(function(i,e){
48+
var color = $(e).css("color");
49+
if(color){
50+
color = rgb2hex(color);
51+
// 关键字
52+
if(color=="#0000ff"){
53+
$(e).css("color","").addClass("code_key_primary");
54+
}
55+
// 注释
56+
else if(color=="#008000"){
57+
$(e).css("color","").addClass("code_comment");
58+
}
59+
// 参数
60+
else if(color == "#000000"){
61+
$(e).css("color","").addClass("code_args");
62+
}
63+
// 分号
64+
else if(color == "#800080"){
65+
$(e).css("color","").addClass("code_symbol");
66+
}
67+
// 字符串
68+
else if(color == "#800000"){
69+
$(e).css("color","").addClass("code_text");
70+
}
71+
// 突出显示
72+
else if(color == "#ff0000"){
73+
$(e).css("color","").addClass("code_high_night");
74+
}
75+
}
76+
77+
})
78+
79+
}
80+
81+
function rgb2hex(rgb) {
82+
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
83+
function hex(x) {
84+
return ("0" + parseInt(x).toString(16)).slice(-2);
85+
}
86+
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
4387
}

0 commit comments

Comments
 (0)