|
|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
|