Clean code

This commit is contained in:
FongMi 2023-05-30 15:02:39 +08:00
parent f61c4d9c42
commit 3eb1f42116
5 changed files with 10 additions and 10 deletions

View File

@ -34,18 +34,12 @@ public class Notice extends Spider {
} }
private void createView() { private void createView() {
createLayout();
createText(); createText();
createRoot();
setColor(); setColor();
hide(); hide();
} }
private void createLayout() {
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.TOP;
Utils.addView(view, params);
}
private void createText() { private void createText() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < 2; i++) sb.append(SPACE).append(text); for (int i = 0; i < 2; i++) sb.append(SPACE).append(text);
@ -59,6 +53,12 @@ public class Notice extends Spider {
view.startScroll(); view.startScroll();
} }
private void createRoot() {
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.TOP;
Utils.addView(view, params);
}
private void hide() { private void hide() {
Init.run(() -> Utils.removeView(view), time * 1000); Init.run(() -> Utils.removeView(view), time * 1000);
} }

Binary file not shown.

View File

@ -1 +1 @@
8d3f8cfed4f4ac1731da98acc255b189 73954c18f409c0cadb91e6a4aff10381

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8d3f8cfed4f4ac1731da98acc255b189", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;73954c18f409c0cadb91e6a4aff10381",
"wallpaper": "https://gao.chuqiuyu.tk", "wallpaper": "https://gao.chuqiuyu.tk",
"sites": [ "sites": [
{ {

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8d3f8cfed4f4ac1731da98acc255b189", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;73954c18f409c0cadb91e6a4aff10381",
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php", "wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
"sites": [ "sites": [
{ {