Skip to content

Commit 71f9e1b

Browse files
committed
新增kotlin支持并脏修正动态配置引起的图片预览失败
1 parent 1b5aac1 commit 71f9e1b

4 files changed

Lines changed: 28 additions & 3 deletions

File tree

build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
buildscript {
2+
ext.gradle_version = '3.3.2'
3+
ext.kotlin_version = '1.3.41'
4+
25
repositories {
36
google()
47
jcenter()
58
}
69

710
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.3.2'
11+
classpath "com.android.tools.build:gradle:$gradle_version"
12+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
913

1014
// NOTE: Do not place your application dependencies here; they belong
1115
// in the individual module build.gradle files
@@ -18,6 +22,8 @@ repositories {
1822
}
1923

2024
if (! project.plugins.hasPlugin("com.android.feature")) apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply plugin: 'kotlin-android-extensions'
2127

2228
android {
2329
compileSdkVersion 28
@@ -54,12 +60,16 @@ android {
5460
}
5561
}
5662

63+
sourceSets {
64+
main.java.srcDirs += 'src/main/kotlin'
65+
}
5766
}
5867

5968
dependencies {
6069
compileOnly 'de.robv.android.xposed:api:82'
6170
compileOnly 'de.robv.android.xposed:api:82:sources'
6271
// implementation 'com.oasisfeng.nevo:sdk:1.2.0'
72+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6373
implementation 'androidx.core:core:1.0.1'
6474
implementation 'androidx.annotation:annotation:1.0.0'
6575
// implementation 'com.android.support:support-v4:28.0.0'

src/main/java/com/oasisfeng/nevo/xposed/MainHook.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ protected void beforeHookedMethod(MethodHookParam param) {
206206
}
207207
});
208208
} catch (XposedHelpers.ClassNotFoundError e) { XposedBridge.log("NotificationManager hook failed"); }
209-
wechat.onCreate(pref);
210-
if (!wechat.isDisabled() && (wechat instanceof HookSupport)) ((HookSupport)wechat).hook(loadPackageParam); // TODO
209+
if (wechat instanceof HookSupport) ((HookSupport)wechat).hook(loadPackageParam); // TODO 没法用onCreate(XSharedPreferences)实现动态配置,需要搞定
211210
}
212211

213212
private void onCreate(Context context) {

src/main/res/layout/media_notifition_layout.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
android:ellipsize="end"
8686
android:lines="1"
8787
android:singleLine="true"
88+
android:shadowColor="#FFFFFF"
89+
android:shadowDx="0"
90+
android:shadowDy="0"
91+
android:shadowRadius="2"
8892
android:textSize="16sp"
8993
android:textStyle="bold" />
9094

@@ -96,6 +100,10 @@
96100
android:textStyle="bold"
97101
android:lines="1"
98102
android:singleLine="true"
103+
android:shadowColor="#FFFFFF"
104+
android:shadowDx="0"
105+
android:shadowDy="0"
106+
android:shadowRadius="2"
99107
android:textSize="14sp" />
100108

101109
</LinearLayout>

src/main/res/layout/media_notifition_layout_big.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
android:ellipsize="end"
7474
android:lines="1"
7575
android:singleLine="true"
76+
android:shadowColor="#FFFFFF"
77+
android:shadowDx="0"
78+
android:shadowDy="0"
79+
android:shadowRadius="2"
7680
android:textSize="16sp"
7781
android:textStyle="bold" />
7882

@@ -84,6 +88,10 @@
8488
android:textStyle="bold"
8589
android:lines="1"
8690
android:singleLine="true"
91+
android:shadowColor="#FFFFFF"
92+
android:shadowDx="0"
93+
android:shadowDy="0"
94+
android:shadowRadius="2"
8795
android:textSize="14sp" />
8896

8997
<LinearLayout

0 commit comments

Comments
 (0)