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

Commit df6e8f0

Browse files
committed
Test @ViewById with generic Views
1 parent 21c04a3 commit df6e8f0

4 files changed

Lines changed: 108 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright (C) 2010-2015 eBusiness Information, Excilys Group
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed To in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package org.androidannotations.viewbyid;
17+
18+
import org.androidannotations.annotations.EActivity;
19+
import org.androidannotations.annotations.ViewById;
20+
import org.androidannotations.eviewgroup.SomeGenericViewGroup;
21+
22+
import android.app.Activity;
23+
24+
@EActivity
25+
public class GenericViewByIdActivity extends Activity {
26+
27+
@ViewById
28+
SomeGenericViewGroup<CharSequence> view;
29+
30+
@ViewById
31+
SomeGenericViewGroup<?> view2;
32+
33+
@ViewById
34+
SomeGenericViewGroup<? extends CharSequence> view3;
35+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.androidannotations.viewbyid;
2+
3+
public class R {
4+
public static final class id {
5+
public static final int view = 0x7f06000a;
6+
public static final int view2 = 0x7f06000b;
7+
public static final int view3 = 0x7f06000c;
8+
}
9+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (C) 2010-2015 eBusiness Information, Excilys Group
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed To in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package org.androidannotations.viewbyid;
17+
18+
import org.androidannotations.AndroidAnnotationProcessor;
19+
import org.androidannotations.utils.AAProcessorTestHelper;
20+
import org.junit.Before;
21+
import org.junit.Test;
22+
23+
public class ViewByIdTest extends AAProcessorTestHelper {
24+
25+
@Before
26+
public void setUp() {
27+
addManifestProcessorParameter(ViewByIdTest.class);
28+
addProcessor(AndroidAnnotationProcessor.class);
29+
}
30+
31+
@Test
32+
public void viewByIdGenericViewCompiles() {
33+
assertCompilationSuccessful(compileFiles(GenericViewByIdActivity.class));
34+
}
35+
36+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
4+
Copyright (C) 2010-2015 eBusiness Information, Excilys Group
5+
6+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
7+
use this file except in compliance with the License. You may obtain a copy of
8+
the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed To in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15+
License for the specific language governing permissions and limitations under
16+
the License.
17+
18+
-->
19+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
20+
package="org.androidannotations.viewbyid"
21+
android:versionCode="1"
22+
android:versionName="1.0" >
23+
24+
<application>
25+
<activity android:name="org.androidannotations.viewbyid.GenericViewByIdActivity_" />
26+
</application>
27+
28+
</manifest>

0 commit comments

Comments
 (0)