Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit deebbea

Browse files
author
Emmanuel Garcia
committed
temporary workaround
1 parent fd5c6bc commit deebbea

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/TextPlatformView.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,32 @@
66

77
import android.content.Context;
88
import android.graphics.Color;
9+
import android.view.Choreographer;
910
import android.view.View;
1011
import android.widget.TextView;
1112
import androidx.annotation.NonNull;
1213
import androidx.annotation.Nullable;
1314
import io.flutter.plugin.platform.PlatformView;
1415

1516
public class TextPlatformView implements PlatformView {
16-
private final TextView textView;
17+
final TextView textView;
1718

1819
@SuppressWarnings("unchecked")
1920
TextPlatformView(@NonNull final Context context, int id, @Nullable String params) {
2021
textView = new TextView(context);
2122
textView.setTextSize(72);
2223
textView.setBackgroundColor(Color.rgb(255, 255, 255));
2324
textView.setText(params);
25+
26+
Choreographer.getInstance()
27+
.postFrameCallbackDelayed(
28+
new Choreographer.FrameCallback() {
29+
@Override
30+
public void doFrame(long frameTimeNanos) {
31+
textView.invalidate();
32+
}
33+
},
34+
500);
2435
}
2536

2637
@Override

0 commit comments

Comments
 (0)