summaryrefslogtreecommitdiff
path: root/android/testData/folding
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-04-17 18:40:18 -0700
committerTor Norbye <tnorbye@google.com>2013-04-18 07:35:58 -0700
commit96cc39b9677fa929e08f3b500fcf311382ccdfaa (patch)
tree88c67d2897ff731b6e8ad5b3f0420be48caece2b /android/testData/folding
parentbf7cc597a64b166e82b0cae46a208ab10d0dad79 (diff)
downloadidea-96cc39b9677fa929e08f3b500fcf311382ccdfaa.tar.gz
Add custom code folding for Android to resolve string resources
This will show the default string values of resources in place of getString(R.string.name) in Java files and in place of @string/name references in XML attribute values. Change-Id: I1585fc6a2314b25ac22027fde9fef5862cbbdf34
Diffstat (limited to 'android/testData/folding')
-rw-r--r--android/testData/folding/javaStrings.java32
-rw-r--r--android/testData/folding/strings.xml8
-rw-r--r--android/testData/folding/xmlString.xml27
3 files changed, 67 insertions, 0 deletions
diff --git a/android/testData/folding/javaStrings.java b/android/testData/folding/javaStrings.java
new file mode 100644
index 00000000000..0fa0eb8f63a
--- /dev/null
+++ b/android/testData/folding/javaStrings.java
@@ -0,0 +1,32 @@
+<fold text='/.../' expand='false'>/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * 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.
+ */</fold>
+ package p1.p2
+
+ import <fold text='...' expand='false'>android.app.Activity;
+import android.os.Bundle;</fold>
+
+public class MyActivity extends Activity {
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ <fold text='{...}' expand='true'>{
+ Activity c = this;
+ String label = <fold text='"Application Name"' expand='false'>c.getString(R.string.app_name)</fold>;
+ String label2 = <fold text='"This is a really really really long string, a..."' expand='false'>getString(R.string.foobar)</fold>;
+ String label3 = <fold text='"Vibration level is %s."' expand='false'>getString(R.string.string_width_formatting)</fold>;
+ String label2 = <fold text='getString(R.string.empty)' expand='false'>getString(R.string.empty)</fold>;
+ String label2 = <fold text='getString(R.string.unknown)' expand='false'>getString(R.string.unknown)</fold>;
+ }</fold>
+}
diff --git a/android/testData/folding/strings.xml b/android/testData/folding/strings.xml
new file mode 100644
index 00000000000..f7a4e899abc
--- /dev/null
+++ b/android/testData/folding/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">Application Name</string>
+ <string name="foobar">This is a really really really long string, and the folding code should be truncating it</string>
+ <string name="empty"></string>
+ <string name="string_width_formatting">Vibration level is %s.</string>
+
+</resources>
diff --git a/android/testData/folding/xmlString.xml b/android/testData/folding/xmlString.xml
new file mode 100644
index 00000000000..14312cc8f14
--- /dev/null
+++ b/android/testData/folding/xmlString.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--<fold text='...' expand='true'>
+ ~ Copyright 2000-2013 JetBrains s.r.o.
+ ~
+ ~ 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.
+ </fold>-->
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"<fold text='...' expand='true'>
+android:layout_width="fill_parent"
+android:layout_height="match_parent"
+android:orientation="horizontal">
+<TextView android:layout_width="wrap_content"<fold text='...' expand='true'>
+ android:layout_height="wrap_content"
+ android:text=<fold text='"Application Name"' expand='false'>"@string/app_name"</fold> /</fold>>
+<TextView android:layout_width="wrap_content"<fold text='...' expand='true'>
+ android:layout_height="wrap_content"
+ android:text="Text here" /</fold>>
+</GridLayout</fold>>