Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test @ViewById with generic Views
  • Loading branch information
WonderCsabo committed Apr 5, 2015
commit df6e8f0d19322410b8fa2cbfd3caf89897a46173
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright (C) 2010-2015 eBusiness Information, Excilys Group
*
* 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 org.androidannotations.viewbyid;

import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.eviewgroup.SomeGenericViewGroup;

import android.app.Activity;

@EActivity
public class GenericViewByIdActivity extends Activity {

@ViewById
SomeGenericViewGroup<CharSequence> view;

@ViewById
SomeGenericViewGroup<?> view2;

@ViewById
SomeGenericViewGroup<? extends CharSequence> view3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.androidannotations.viewbyid;

public class R {
public static final class id {
public static final int view = 0x7f06000a;
public static final int view2 = 0x7f06000b;
public static final int view3 = 0x7f06000c;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (C) 2010-2015 eBusiness Information, Excilys Group
*
* 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 org.androidannotations.viewbyid;

import org.androidannotations.AndroidAnnotationProcessor;
import org.androidannotations.utils.AAProcessorTestHelper;
import org.junit.Before;
import org.junit.Test;

public class ViewByIdTest extends AAProcessorTestHelper {

@Before
public void setUp() {
addManifestProcessorParameter(ViewByIdTest.class);
addProcessor(AndroidAnnotationProcessor.class);
}

@Test
public void viewByIdGenericViewCompiles() {
assertCompilationSuccessful(compileFiles(GenericViewByIdActivity.class));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--

Copyright (C) 2010-2015 eBusiness Information, Excilys Group

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.

-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.androidannotations.viewbyid"
android:versionCode="1"
android:versionName="1.0" >

<application>
<activity android:name="org.androidannotations.viewbyid.GenericViewByIdActivity_" />
</application>

</manifest>