aboutsummaryrefslogtreecommitdiff
path: root/bridge/tests/res/testApp/MyApplication/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/tests/res/testApp/MyApplication/src/main')
-rw-r--r--bridge/tests/res/testApp/MyApplication/src/main/myapplication.widgets/SoftwareTextView.java52
-rw-r--r--bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml9
2 files changed, 61 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");
+ }
+}
diff --git a/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml b/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
index 7b338d1dc6..d75aab1c1c 100644
--- a/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
+++ b/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
@@ -16,4 +16,13 @@
<item name="android:windowBackground">@drawable/theme_attribute_drawable</item>
</style>
+ <style name="LightStatusBarTheme" parent="android:Theme.Material.Light.DarkActionBar">
+ <item name="android:statusBarColor">#ffff0000</item>
+ <item name="android:windowLightStatusBar">true</item>
+ </style>
+
+ <style name="DarkStatusBarTheme" parent="android:Theme.Material.Light.DarkActionBar">
+ <item name="android:statusBarColor">#ffff0000</item>
+ </style>
+
</resources>