Clean code
This commit is contained in:
parent
f61c4d9c42
commit
3eb1f42116
|
|
@ -34,18 +34,12 @@ public class Notice extends Spider {
|
|||
}
|
||||
|
||||
private void createView() {
|
||||
createLayout();
|
||||
createText();
|
||||
createRoot();
|
||||
setColor();
|
||||
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() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < 2; i++) sb.append(SPACE).append(text);
|
||||
|
|
@ -59,6 +53,12 @@ public class Notice extends Spider {
|
|||
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() {
|
||||
Init.run(() -> Utils.removeView(view), time * 1000);
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
8d3f8cfed4f4ac1731da98acc255b189
|
||||
73954c18f409c0cadb91e6a4aff10381
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue