aboutsummaryrefslogtreecommitdiff
path: root/bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java')
-rw-r--r--bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java b/bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java
new file mode 100644
index 0000000000..3d8cb0c75d
--- /dev/null
+++ b/bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.layoutlib.test.myapplication.widgets;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.util.AttributeSet;
+import android.widget.TextView;
+
+public class SoftwareTextView extends TextView {
+
+ public SoftwareTextView(Context context) {
+ super(context);
+ init();
+ }
+
+ public SoftwareTextView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ init();
+ }
+
+ public SoftwareTextView(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ init();
+ }
+
+ public SoftwareTextView(Context context, AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ init();
+ }
+
+ private void init() {
+ setLayerType(LAYER_TYPE_SOFTWARE, null);
+ setBackgroundColor(Color.RED);
+ setText("Software Layer");
+ }
+}