I've developed an application for Android using MvvmCross. There is a part of it in which it should show either a ImageView or a MvxImageView. When i test it in debug mode it works fine, but when i change it to release mode the visibility converter seem to stop working. All the other converters work they way the should, only those converters stop working.
A resume from my xml:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="fitCenter"
local:MvxBind="Visibility MyObject, Converter=ByteInverseVisibility; AssetImagePath MyObject, Converter=AttachmentTypeToSource" />
<Mvx.MvxImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:maxHeight="150dp"
android:adjustViewBounds="true"
local:MvxBind="Visibility MyObject, Converter=ByteVisibility; Bitmap MyObject.Attachment, Converter=InMemoryImage" />
</LinearLayout>
The Converters:
public class ByteVisibilityConverter : MvxBaseVisibilityValueConverter<MyObjectClass>
{
protected override MvxVisibility Convert(MyObjectClass value, object parameter, CultureInfo culture)
{
if (value.AttachType == AttachmentType.Photo && value.Attachment != null)
{
return MvxVisibility.Visible;
}
return MvxVisibility.Collapsed;
}
}
public class ByteInverseVisibilityConverter : MvxBaseVisibilityValueConverter<MyObjectClass>
{
protected override MvxVisibility Convert(MyObjectClassvalue, object parameter, CultureInfo culture)
{
if (value.AttachType != AttachmentType.Photo || value.Attachment == null)
{
return MvxVisibility.Visible;
}
return MvxVisibility.Collapsed;
}
}
The reason is because that the Visibility property is not being included in the packaging.
You gotta add something like:
public void Include(ImageView imageView)
{
imageView.Visibility = imageView.imageView;
}
In your LinkerPleaseInclude.cs file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With