Add notice at init
This commit is contained in:
parent
f7e65963ae
commit
c9126d7acc
|
|
@ -8,6 +8,7 @@ import android.os.Looper;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.github.catvod.crawler.SpiderDebug;
|
||||
import com.github.catvod.utils.Notice;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
|
@ -40,6 +41,7 @@ public class Init {
|
|||
public static void init(Context context) {
|
||||
SpiderDebug.log("自定義爬蟲代碼載入成功!");
|
||||
get().app = ((Application) context);
|
||||
Notice.show("FongMi 天下第一;10");
|
||||
}
|
||||
|
||||
public static void execute(Runnable runnable) {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public class ScrollTextView extends TextView {
|
|||
|
||||
public void stopScroll() {
|
||||
if (scroller != null) scroller.abortAnimation();
|
||||
setVisibility(GONE);
|
||||
}
|
||||
|
||||
private int calculateScrollingLen() {
|
||||
|
|
|
|||
|
|
@ -1,36 +1,31 @@
|
|||
package com.github.catvod.spider;
|
||||
package com.github.catvod.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.view.Gravity;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.github.catvod.crawler.Spider;
|
||||
import com.github.catvod.spider.Init;
|
||||
import com.github.catvod.ui.ScrollTextView;
|
||||
import com.github.catvod.utils.Utils;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class Notice extends Spider {
|
||||
public class Notice {
|
||||
|
||||
private static final String SPACE = " ";
|
||||
private ScrollTextView view;
|
||||
private String text;
|
||||
private int time;
|
||||
|
||||
@Override
|
||||
public void init(Context context, String extend) {
|
||||
super.init(context, extend);
|
||||
public static void show(String msg) {
|
||||
new Notice().init(msg);
|
||||
}
|
||||
|
||||
public void init(String extend) {
|
||||
String[] splits = extend.split(";");
|
||||
this.text = splits[0];
|
||||
this.time = splits.length > 1 ? Integer.parseInt(splits[1]) : 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String homeContent(boolean filter) throws Exception {
|
||||
Init.run(this::createView);
|
||||
return "";
|
||||
}
|
||||
|
||||
private void createView() {
|
||||
Loading…
Reference in New Issue