I did a binding of libaums AAR in my Xamarin Android solution in Visual Studio.
I used libaums-0.5.0.aar from here.
At compile time I got 2 errors that I solved by adding those directives to my Metadata.xml file:
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createDirectory']" name="managedReturn">IUsbFile</attr>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createFile']" name="managedReturn">IUsbFile</attr>
Then I tried to implement the example found on the libaums github to get the mass storage devices:
UsbMassStorageDevice[] devices = UsbMassStorageDevice.GetMassStorageDevices(Global.MyActivity.ApplicationContext);
foreach (UsbMassStorageDevice device in devices)
{
// before interacting with a device you need to call init()!
device.Init();
// Only uses the first partition on the device
IFileSystem currentFs = device.Partitions[0].FileSystem;
Console.WriteLine("Capacity: " + currentFs.Capacity);
Console.WriteLine("Occupied Space: " + currentFs.OccupiedSpace);
Console.WriteLine("Free Space: " + currentFs.FreeSpace);
Console.WriteLine("Chunk size: " + currentFs.ChunkSize);
}
But at run time I have an exception on currentFs.Capacity which says:
no non-static method "Lcom/github/mjdev/libaums/fs/fat32/Fat32FileSystem;getCapacity()J"
Any ideas?
How did you manage to get that aar compiled with your metadata set? I had to add the folowing to metadata.xml to get it compiled:
<metadata>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createDirectory' and count(parameter)=1 and parameter[1][#type='java.lang.String']]" name="visibility">public override</attr>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createDirectory' and count(parameter)=1 and parameter[1][#type='java.lang.String']]" name="final">true</attr>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createDirectory' and count(parameter)=1 and parameter[1][#type='java.lang.String']]" name="managedReturn">IUsbFile</attr>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createFile' and count(parameter)=1 and parameter[1][#type='java.lang.String']]" name="visibility">public override</attr>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createFile' and count(parameter)=1 and parameter[1][#type='java.lang.String']]" name="final">true</attr>
<attr path="/api/package[#name='com.github.mjdev.libaums.fs.fat32']/class[#name='FatDirectory']/method[#name='createFile' and count(parameter)=1 and parameter[1][#type='java.lang.String']]" name="managedReturn">IUsbFile</attr>
</metadata>
Why? For example, without this, after transpiling the method CreateDirectory(string) has the signature public virtual unsafe global::Com.Github.Mjdev.Libaums.FS.Fat32.FatFile CreateFile (string p0). But it has to be public override unsafe IUsbFile CreateFile (string p0). Changing final to true appears to remove the virtual modifyer (seems to be a bug?).
Concerning your exception, have you tried to use a newer library? Here you can download the 0.5.5 version.
Related
when i added kotlin sdk in my java project i faced this problem:
Execution failed for task ':app:mergeDebugResources'
C:\Users\esmae\.gradle\caches\transforms-3\968226e282565914e6944dd746d7f052\transformed\material-1.6.1\res\values\values.xml:7098:4: Duplicate value for resource 'attr/animationMode' with config 'DEFAULT' and product ''. Resource was previously defined here: C:\Users\esmae\.gradle\caches\transforms-3\968226e282565914e6944dd746d7f052\transformed\material-1.6.1\res\values\values.xml:6408:4: .
value.xml
<declare-styleable name="SnackbarLayout">
<attr name="android:maxWidth"/>
<attr name="elevation"/>
<attr format="dimension" name="maxActionInlineWidth"/>
<!-- Sets the enter and exit animations for a Snackbar. -->
<attr format="enum" name="animationMode">
<!-- Mode that corresponds to the slide in and out animations. -->
<enum name="slide" value="0"/>
<!-- Mode that corresponds to the fade in and out animations. -->
<enum name="fade" value="1"/>
</attr>
</declare-styleable>
app built when i renamed or removed animationMode attribute but i have error when making snackbar. any idea whats the problem?
i tried with different gradle version
delete cashes an restart
clean project
but nothing happen
What I am trying to do: I am trying to integrate this library
What I have done so far:
I added cradle dependency implementation
'com.github.devlight:infinitecycleviewpager:1.0.2'
I have cleaned , synched and built the project
I added the xml as below
<com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager
android:id="#+id/swipableViewId"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:icvp_interpolator="..."
app:icvp_center_page_scale_offset="30dp"
app:icvp_max_page_scale="0.8"
app:icvp_medium_scaled="true"
app:icvp_min_page_scale="0.5"
app:icvp_min_page_scale_offset="5dp"
app:icvp_scroll_duration="500"/>
On building the project I get error: AAPT: error: '...' is incompatible with attribute icvp_interpolator (attr) reference.
I checked if the reference of icvp_min_page_scale is created. Looks
like the reference is there
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr format="dimension" name="icvp_center_page_scale_offset"/>
<attr format="reference" name="icvp_interpolator"/>
<attr format="float" name="icvp_max_page_scale"/>
<attr format="boolean" name="icvp_medium_scaled"/>
<attr format="float" name="icvp_min_page_scale"/>
<attr format="dimension" name="icvp_min_page_scale_offset"/>
<attr format="integer" name="icvp_scroll_duration"/>
<declare-styleable name="HorizontalInfiniteCycleViewPager"><attr name="icvp_min_page_scale_offset"/><attr name="icvp_center_page_scale_offset"/><attr name="icvp_min_page_scale"/><attr name="icvp_max_page_scale"/><attr name="icvp_medium_scaled"/><attr name="icvp_scroll_duration"/><attr name="icvp_interpolator"/></declare-styleable>
<declare-styleable name="VerticalInfiniteCycleViewPager"><attr name="icvp_min_page_scale_offset"/><attr name="icvp_center_page_scale_offset"/><attr name="icvp_min_page_scale"/><attr name="icvp_max_page_scale"/><attr name="icvp_medium_scaled"/><attr name="icvp_scroll_duration"/><attr name="icvp_interpolator"/></declare-styleable>
<string name="app_name">InfinityCycleViewPager</string>
</resources>
Question: How to resolve this. Is there any setting in android studio we need to make or in project settings
Remove
app:icvp_interpolator="..."
<com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager
android:id="#+id/swipableViewId"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:icvp_center_page_scale_offset="30dp"
app:icvp_max_page_scale="0.8"
app:icvp_medium_scaled="true"
app:icvp_min_page_scale="0.5"
app:icvp_min_page_scale_offset="5dp"
app:icvp_scroll_duration="500"/>
or add default anim #android:anim/accelerate_decelerate_interpolator
<com.gigamole.infinitecycleviewpager.HorizontalInfiniteCycleViewPager
android:id="#+id/swipableViewId"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:icvp_center_page_scale_offset="30dp"
app:icvp_interpolator="#android:anim/accelerate_decelerate_interpolator"
app:icvp_max_page_scale="0.8"
app:icvp_medium_scaled="true"
app:icvp_min_page_scale="0.5"
app:icvp_min_page_scale_offset="5dp"
app:icvp_scroll_duration="500"/>
I am trying to use PixlUI to implement custom fonts into my Android app using Xamarin. I've followed these steps:
Added a new Android Java Bindings Library to my main solution
Added pixlui-1-0-5.jar to the jars folder
Under properties for pixlui-1-0-5.jar i've set the "include in deploy" to true
Tested my new Android Java Bindings Library and it builds fine without errors
Under the main project i've added my font to the assets/fonts folder
Under references i've added the pixlUI binding library
In my main.axml i've placed this code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pixlui="http://schemas.android.com/apk/com.neopixl.pixlui"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:screenOrientation="portrait">
<com.neopixl.pixlui.components.textview.TextView
android:id="#+id/textViewpixl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/hello_world"
pixlui:copyandpaste="false"
pixlui:clearclipboardcontent="true"
pixlui:typeface="Lato-Light.ttf"
android:layout_below="#id/btnRebate"
/>
</RelativeLayout>
When I build my project it fails with 10 errors all referencing "already contains a definition for..." with error cs0102 inside the pixlUI files.
Ex: .../pixlUI/obj/Debug/generated/src/Com.Neopixl.Pixlui.Components.Edittext.IEditTextBatchListener.cs(59,59): Error CS0102: The type Com.Neopixl.Pixlui.Components.Edittext.AddNewCharEventArgs' already contains a definition forp0' (CS0102) (pixlUI)
I've tried troubleshooting this but it appears to be either an issue with pixlUI or conflict with something already in my solution. Does anyone have an idea on how to solve this?
First of all, you should change the Build Action for the pixelui.jar to EmbeddedJar.
Then you need to add the following to your binding's Metadata.xml file:
<!-- Bindings added to rename event parameters -->
<attr path="/api/package[#name='com.neopixl.pixlui.components.edittext']/interface[#name='EditTextBatchListener']/method[#name='addNewChar']/parameter[#name='p0']" name="name">editText</attr>
<attr path="/api/package[#name='com.neopixl.pixlui.components.edittext']/interface[#name='EditTextBatchListener']/method[#name='deleteKeyboardButton']/parameter[#name='p0']" name="name">editText</attr>
<attr path="/api/package[#name='com.neopixl.pixlui.components.edittext']/interface[#name='EditTextBatchListener']/method[#name='deleteKeyboardButton']/parameter[#name='p1']" name="name">emptyText</attr>
<attr path="/api/package[#name='com.neopixl.pixlui.components.edittext']/interface[#name='EditTextFocusListener']/method[#name='loseFocus']/parameter[#name='p0']" name="name">editText</attr>
<attr path="/api/package[#name='com.neopixl.pixlui.components.edittext']/interface[#name='EditTextFocusListener']/method[#name='requestFocus']/parameter[#name='p0']" name="name">editText</attr>
Rebuild your bindings then you should be able to use it in your Android app.
Here's a screenshot from the sample project:
does anyone is able to bind achartengine 1.0 library to a MonoForAndroid project (rel. 4.2.7) and make this works?
I have created "Java Binding Library" project in my solution, I've copied the file acahrtengine.jar in the folder Jars, edited the file Transforms/metadata.xml adding the following lines in order to normalize the namespace and fix a mistake:
<attr path="/api/package[#name='org.achartengine']" name="managedName">AChartEngine</attr>
<attr path="/api/package[#name='org.achartengine.chart']" name="managedName">AChartEngine.Chart</attr>
<attr path="/api/package[#name='org.achartengine.model']" name="managedName">AChartEngine.Model</attr>
<attr path="/api/package[#name='org.achartengine.renderer']" name="managedName">AChartEngine.Renderer</attr>
<attr path="/api/package[#name='org.achartengine.tools']" name="managedName">AChartEngine.Tools</attr>
<attr path="/api/package[#name='org.achartengine.util']" name="managedName">AChartEngine.Util</attr>
<attr path="/api/package[#name='org.achartengine.tools']/class[#name='Pan']/method[#name='addPanListener']" name="eventName">PanEvent</attr>
It complies without errors and creates the DLL but when I add the reference to my project and I try to recompile I have the following errors
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error : package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error : org.achartengine.tools.PanListener
obj\Debug\android\src\mono\org\achartengine\tools\PanListenerImplementor.java(8,25): javac error :
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error : package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error : org.achartengine.tools.ZoomListener
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(8,25): javac error :
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error : package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error : public void zoomApplied (org.achartengine.tools.ZoomEvent p0)
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(28,49): javac error :
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(33,59): error : package org.achartengine.tools does not exist
obj\Debug\android\src\mono\org\achartengine\tools\ZoomListenerImplementor.java(33,59): error : private native void n_zoomApplied (org.achartengine.tools.ZoomEvent p0);
Any suggestion to make the AChartEngine works on Mono For Android?
Thank you
You need to add the jar file to your Monodroid project as well as referencing the binding project.
The process is described in the help docs here:
http://docs.xamarin.com/Android/Guides/Advanced_Topics/Java_Integration_Overview/Binding_a_Java_Library_(.jar)#Add_the_Jar_to_the_Project
I'like to bind the jar-library of ActionBarSherlock in my Mono For Android project. I am reverencing to this documentation: http://docs.xamarin.com/android/tutorials/Binding_a_Java_Library_(.jar)
I have successfully bound android-support-v4.jar which is needed by ActionBarSherlock. But when I try to compile actionbarsherlock.jar, it gives me the following error message:
Target ResolveLibraryProjects:
Skipping target "ResolveLibraryProjects" because it has no inputs.
Target _ResolveMonoAndroidSdks:
MonoAndroid Tools: C:\Program Files (x86)\MSBuild\Novell\
MonoAndroid Framework: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.2\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\
Android SDK: C:\Program Files (x86)\Android\android-sdk\
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_31\
Target ExportJarToXml:
SourceJars:
Jars\actionbarsherlock.jar
ReferenceJars:
Jars\android-support-v4.jar
C:\Program Files (x86)\Java\jdk1.6.0_31\bin\java.exe -jar "C:\Program Files (x86)\MSBuild\Novell\jar2xml.jar" --jar=C:\Users\assrock\Documents\JavaBind\JavaBind\Jars\actionbarsherlock.jar --ref="C:\Program Files (x86)\Android\android-sdk\platforms\android-8\android.jar" --out=C:\Users\assrock\Documents\JavaBind\JavaBind\obj\Release\api.xml --ref=C:\Users\assrock\Documents\JavaBind\JavaBind\Jars\android-support-v4.jar
Couldn't load class com/actionbarsherlock/internal/ActionBarSherlockNative$ActionModeCallbackWrapper
Couldn't load class com/actionbarsherlock/internal/app/ActionBarWrapper$TabWrapper
Couldn't load class com/actionbarsherlock/internal/app/ActionBarWrapper
Couldn't load class com/actionbarsherlock/internal/view/ActionProviderWrapper
Couldn't load class com/actionbarsherlock/internal/view/menu/MenuItemWrapper$1
Exception in thread "main" java.lang.NoClassDefFoundError: com/actionbarsherlock/R
at java.lang.Class.getDeclaringClass(Native Method)
at jar2xml.JavaClass.getConstructorParameterOffset(JavaClass.java:149)
at jar2xml.JavaClass.appendCtor(JavaClass.java:138)
at jar2xml.JavaClass.appendToDocument(JavaClass.java:462)
at jar2xml.JavaPackage.appendToDocument(JavaPackage.java:66)
at jar2xml.Start.main(Start.java:157)
Caused by: java.lang.ClassNotFoundException: com.actionbarsherlock.R
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 6 more
C:\Program Files (x86)\MSBuild\Novell\Xamarin.Android.Bindings.targets(170,5): error MSB6006: "java.exe" exited with code 1.
Task "JarToXml" execution -- FAILED
Done building target "ExportJarToXml" in project "C:\Users\assrock\Documents\JavaBind\JavaBind\JavaBind.csproj".-- FAILED
Done building project "C:\Users\assrock\Documents\JavaBind\JavaBind\JavaBind.csproj".-- FAILED
Build FAILED.
Warnings:
C:\Program Files (x86)\MSBuild\Novell\Xamarin.Android.Bindings.targets(40,11): warning MSB4011: There is a circular reference involving the import of file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.Targets". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored.
Errors:
C:\Users\assrock\Documents\JavaBind\JavaBind\JavaBind.csproj (Build) ->
C:\Program Files (x86)\MSBuild\Novell\Xamarin.Android.Bindings.targets (ExportJarToXml target) ->
C:\Program Files (x86)\MSBuild\Novell\Xamarin.Android.Bindings.targets(170,5): error MSB6006: "java.exe" exited with code 1.
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.4730270
--------------------- Fertig ---------------------
Build: 1 Fehler, 0 Warnungen
For the android-support-v4.jar I found these xml-files and put them in the Transforms directory:
EnumFields.xml
<enum-field-mappings>
<mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType">
<field jni-name="Fragment_id" clr-name="Id" value="1" />
<field jni-name="Fragment_name" clr-name="Name" value="0" />
<field jni-name="Fragment_tag" clr-name="Tag" value="2" />
</mapping>
</enum-field-mappings>
EnumMethods.xml
<enum-method-mappings>
<mapping jni-class="android/support/v4/app/Fragment$SavedState">
<method jni-name="writeToParcel" parameter="p1" clr-enum-type="Android.OS.ParcelableWriteFlags" />
<method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
</mapping>
</enum-method-mappings>
Metadata.xml
<metadata>
<remove-node path="/api/package[#name='android.support.v4.app']/class[#name='BackStackState']" />
<remove-node path="/api/package[#name='android.support.v4.app']/class[#name='FragmentState']" />
<remove-node path="/api/package[#name='android.support.v4.app']/class[#name='FragmentManagerState']" />
<remove-node path="/api/package[#name='android.support.v4.widget']/class[#name='CursorAdapter']/implements[#name='android.support.v4.widget.CursorFilter.CursorFilterClient']" />
<remove-node path="/api/package[#name='android.support.v4.widget']/class[#name='CursorAdapter']/field[#name='mCursorFilter']" />
<remove-node path="/api/package[#name='android.support.v4.content']/class[#name='AsyncTaskLoader.LoadTask']" />
<!-- FIXME:
This method is an override of another method in the base types.
The base method expects JLO, but this method returns Cursor.
So we somehow have to fill the gap between them.
-->
<remove-node path="/api/package[#name='android.support.v4.content']/class[#name='CursorLoader']/method[#name='loadInBackground']" />
<remove-node path="/api/package[#name='android.support.v4.view.accessibility']/class[#name='AccessibilityNodeInfoCompat.AccessibilityNodeInfoIcsImpl']" />
<remove-node path="/api/package[#name='android.support.v4.widget']/class[#name='CursorAdapter.ChangeObserver']" />
<remove-node path="/api/package[#name='android.support.v4.view.accessibility']/class[#name='AccessibilityNodeInfoCompat.AccessibilityNodeInfoIcsImpl']" />
<remove-node path="/api/package[#name='android.support.v4.view.accessibility']/class[#name='AccessibilityNodeInfoCompat.AccessibilityNodeInfoStubImpl']" />
<remove-node path="/api/package[#name='android.support.v4.view']/interface[#name='ViewPager.OnAdapterChangeListener']" />
<attr path="/api/package[#name='android.support.v4.app']/class[#name='LoaderManager']/method[#name='initLoader']/parameter[#name='p2']" name="type">android.support.v4.app.LoaderManager.LoaderCallbacks</attr>
<attr path="/api/package[#name='android.support.v4.app']/class[#name='LoaderManager']/method[#name='initLoader']/parameter[#name='callback']" name="type">android.support.v4.app.LoaderManager.LoaderCallbacks</attr>
<attr path="/api/package[#name='android.support.v4.app']/class[#name='LoaderManager']/method[#name='initLoader']" name="return">android.support.v4.content.Loader</attr>
<attr path="/api/package[#name='android.support.v4.app']/class[#name='LoaderManager']/method[#name='restartLoader']/parameter[#name='p2']" name="type">android.support.v4.app.LoaderManager.LoaderCallbacks</attr>
<attr path="/api/package[#name='android.support.v4.app']/class[#name='LoaderManager']/method[#name='restartLoader']/parameter[#name='callback']" name="type">android.support.v4.app.LoaderManager.LoaderCallbacks</attr>
<attr path="/api/package[#name='android.support.v4.app']/class[#name='LoaderManager']/method[#name='restartLoader']" name="return">android.support.v4.content.Loader</attr>
</metadata>
ActionBarSherlock includes UI elements, styles, and other things that can't be compiled into a JAR file. There is a note about this on the ActionBarSherlock FAQ.
Q: Why is ActionBarSherlock a library project whereas the original compatibility library is only a .jar?
A: The custom action bar implementation within ActionBarSherlock relies on styles, themes, layouts, and drawables in order to display properly. Due to the limitations of Android and .jar files, this currently can not be accomplished any other way.
Edit: There is some additional information about trying to share resources across library projects in Mono for Android at this link: http://mono-for-android.1047100.n5.nabble.com/Resources-from-a-Library-Project-td4657828.html. Short answer is it doesn't look possible at the moment.
I believe I have successfully bound ActionBarSherlock in Mono for Android.
You need to package the java files as a JAR file but without the resources and without the R java class files. Before you package the files make sure that you check the box in Android settings that says "Is Library" so that the resource IDs are not created as constants and inlined in your compiled java classes.
Once you have done this you can use the latest version of Mono for Android to bind the JAR file.
Resources need to be copied separately from the JAR file and placed directly in the main android application project. Unfortunately, at the present time there is no way to isolate the resources in a separate library project when using Mono for Android, but I expect that will change soon.
Finally, you need to edit your C-Sharp project file so that it automatically creates a new version of the com.actionbarsherlock.R java class file each time you rebuild. This is required to keep all your resource IDs in sync.
I may have missed a step or two but those are the most important ones.
Please see my blog post for more information and a download link with source code:
http://www.craigsprogramming.com/2012/07/actionbarsherlock-with-mono-for-android.html
This may seem like a sledgehammer approach, but will likely solve your problem...
I would suggest building using Maven, which handles these dependencies much better. You will be able to reference the ActionBarSherlock project in your POM, and MVN will manage the dependancies for you.
I can confirm the original answer as correct as well - there is a limitation to including JAR files that contain layout resources.
Looks like Xamarin solved ActionBarSherlock bound issue
https://bugzilla.xamarin.com/show_bug.cgi?id=6186
This fix has included in 4.2.5 which is available on alpha channel now.