-
Notifications
You must be signed in to change notification settings - Fork 0
/
NativeView.java
35 lines (28 loc) · 907 Bytes
/
NativeView.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.example.hybrid_view;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Outline;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.TextView;
import androidx.annotation.RequiresApi;
import java.util.Map;
import io.flutter.plugin.platform.PlatformView;
class NativeView implements PlatformView {
private final TextView textView;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
NativeView(Context context, int id, Map<String, Object> creationParams) {
textView = new TextView(context);
textView.setTextSize(13);
textView.setBackgroundColor(Color.GREEN);
textView.setText("NativeView:" + id);
}
@Override
public View getView() {
return textView;
}
@Override
public void dispose() {}
}