User Profile & Activity

Arief Handany Member
Page
of 20
Posted: May 4, 2015 10:03 AM

Hi Thomas,

1. Looks like based from my testing, i can't replicate the issue (using build 231 in both emulator & device, no transparent background on detail), based from our programmer observation, looks like this is just a memory issue/ lagging. Could you tell me what build did you use? and what are the steps did you use to reproduce this issues? thanks!

2. Actually from my testing, this issue only happened if i hold the transition then change device orientation but if i try to change orientation in exact time when sliding what happened is my slider simply just wait for the slider to slide first then it will change orientation. However in my case if i remove my presses it will go back to normal, is this the same with issue that you have? 

For android this issue has already filed under CROS-809, however in my case it is a little different as the app will close automatically rather than continue.

Hope that helps

Best Regards,
Arief

Hi Jimmy,

Sorry looks like i send you the wrong code, (I assume the problem is from the lack of ID in axml) so it is actually already right to use ContextualActionBarSettings & EditingOptions, 

In your solution in MyInventory Master Detail what actually i change to allow the CanExecute to work is to change the CanExecuteMarkSold method in ItemListViewModel into:

		private bool CanExecuteMarkSold(object parameter)		{
			if (parameter is Item)
				return true;
			else if (parameter is IEnumerable<Item>)
                return ((IEnumerable<Item>)parameter).Where(o => o.IsSold == false).Count() > 0;
			
			return false;
		}

Here is the sample i make yesterday that similar with the solutions that you give me (using MyInventoryWebAPI)

Please download the samples by clicking here.

Hope that'll helps

Best Regards
Arief

Hi Jimmy,

About the buttonID actually even already included in view identifier, you still must manually added it to Android Layout, using this code in activity:

        protected override int MenuLayoutId        {
            get { return Resource.Layout.actionbarlistlayout; }
        }

 actionbarlistlayout is the layout name, and inside of the axml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/SearchButton"
        android:icon="@drawable/ic_search"
        android:title="Search"
        android:showAsAction="ifRoom|withText|collapseActionView"
        android:actionViewClass="android.widget.SearchView" />
    <item
        android:id="@+id/AddButton"
        android:icon="@drawable/ic_menu_add"
        android:title="Add"
        android:showAsAction="ifRoom|withText" />
</menu>

Can confirm i already tested it in MyInventoryWebApi which using DataListViewModelBase and Changing the Activity into Fragment and i encounter no problem the CanExecute function was working as intended (if i try to markSold marked Sold item, the button will be disabled)

Best Regard
Arief

Hi Jimmy,

To bind CanExecute on ActionBar Items is actually just as you expected to be, we only need to bind ButtonId to BindingProvider then to the Command in ViewModel, then inside the new delegate command we include both Execute and CanExecute method.

Also please check this sample because based from our testing, we sucessfully use CanExecute in dynamically changing condition, we also put breakpoints inside the ItemListViewModel.cs. If succeed the Mark Sold button (when you long press an item, the button will appear) will be disabled when it used for sold items.

If the problem still persist please inform us, we will be glad to help!

Best Regards,
Arief

Hi Leo,

We have uploaded the hotfix for CROS-798 featuring CommandProperty binding support to UIButton in custom UICarouselVewCell. 

You can download the nightly build here. Please note that you need to use Unified API for it to work, also please mind that you need to add these code because how the UIButton work differently in iOS for ViewSlider. Just add the Bolded code below, i use the View Slider samples as the example:

[ImportBinding(typeof(ItemSliderBindingProvider))]    public partial class ItemSliderViewController : UIViewController<ItemSliderViewModel>,ISupportItemBinding    
{        

private Dictionary<Type, IItemBindingAdapter> _itemBindingAdapters = null;

        public UICarouselView CarouselView { get; set; }

        public ItemSliderViewController()
        {
        }

        #region ISupportItemBinding implementation

        public Dictionary<Type, IItemBindingAdapter> ItemBindingAdapters
        {
            get
            {
                if (_itemBindingAdapters == null)
                    _itemBindingAdapters = new Dictionary<Type, IItemBindingAdapter>();

                return _itemBindingAdapters;
            }
        }
        #endregion

        protected override void OnViewInitialized()
        {
            base.OnViewInitialized();

            //register the binding adapter for UIButton
            this.ItemBindingAdapters.Add(typeof(UIButton), Activator.CreateInstance<UIButtonItemBindingAdapter>());

            this.Title = "Custom Template";
        }

        protected override void InitializeView()
        {
            base.InitializeView();

            this.EdgesForExtendedLayout = UIRectEdge.None;

            this.CarouselView = new UICarouselView(new CGRect(0, 0, this.View.Bounds.Width, this.View.Bounds.Height))
            {
                AutoresizingMask = UIViewAutoresizing.FlexibleDimensions,
                CellTemplate = new UIViewTemplate(ItemSliderCellView.Nib)
            };
            this.View.AddSubview(this.CarouselView);

            this.RegisterViewIdentifier("ViewSlider", this.CarouselView);
        }

        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                this.ItemBindingAdapters.Clear();
            }
        }
    }

Best Regards
Arief

Posted: April 20, 2015 4:59 AM

Hi Jimmy

We release a more stable hotfix, that further optimized the table performance. I suggest you use this hotfix which can be downloaded in http://git.intersoftpt.com/projects/CROS/repos/updates/browse/Crosslight3_0_5000_230

Should you need further assistance or run into any problems, feel free to post it into our forum or send it to our emails. We would be happy to assist you again!

Best Regards 
Arief

Posted: April 15, 2015 8:07 AM

Hi Jimmy,

We have uploaded the hotfix for CROS-793 (Styles binding inadvertently affecting other unrelated items when an item is updated in grouped condition) also based from our developer the resolution of this issue also improves table performance as redundant updates are eliminated. 

You can download the nightly build here. Please note that you need to use Unified API for it to work.

Best Regards,

Arief

Hi Leo,

We have uploaded the hotfix for CROS-796 & CROS-797 (Duplication and also improvement for supporting multiple image view in custom table cell). You can download the nightly build here. Please note that you need to use Unified API for it to work.

Best Regards,
Arief

Hi Jimmy,

Sorry for super late response, there is actually 2 solutions for your cases, i will also explain the reasoning behind the problems.

Solutions 1:
if using entities.OfType<Item>() 

You can still use that but we need to add this inside your :

this.Item.Details.Photo = Guid.NewGuid().ToString("n") + ".jpg";
this.Item.Details.ThumbnailImage = imagePicker.Result.ThumbnailImageData;
this.Item.Details.LargeImage = imagePicker.Result.ImageData;

//Add this
this.Item.EntityAspect.EntityState = EntityState.Modified;


When you use details it actually only send what changed so only details that sent, and because what you send in the form of details it doesn't accepted in entities of type<Item>, so in my solutions i make them send both items (by set it state modified) and details using entity state 

Solutions 2:
if using entities.OfType<Details>() 

You actually can use get single inside your intialize save request but you need Inject Repository/Entity that you want for example you want GetSingle from MachineDetails just add this:

private IMachineDetailsRepository MachineDetailsRepository        {            get            {
                if (Container.Current.CanResolve<IMachineDetailsRepository>())
return Container.Current.Resolve<IMachineDetailsRepository>();
else return new MachineDetailsRepository(null); // design time support
} }

 then you can use it inside you IntializeSaveRequest:

 public partial class TicketMachineRepository
    {
        protected override void InitializeSaveRequest(RestRequest request, IEnumerable<IEntity> entities)
        {
            var p_Items = entities.OfType<MachineDetails>();

            foreach (var p_Item in p_Items)
            {
                var p_OriginalItem = MachineDetailRepository.GetSingle(p_Item.TicketMachineId);
                var p_Machine = p_OriginalItem.Machine.MachineDetails;

                if (p_Machine.ThumbnailImage != null)
                    request.AddFile("Thumbnail", p_Machine.ThumbnailImage, p_Machine.Photo, "image/jpg");

                if (p_Machine.LargeImage != null)
                    request.AddFile("Large", p_Machine.LargeImage, p_Machine.Photo, "image/jpg");
            }
        }
    }

Yep the getSingle actually obtained from parent entity e.g. TicketMachineRepository but you can actually inject the repository using code above so you can obtain GetSIngle from other entity, GetSIngle is function from repository (EntityRepository).


Hope that helps and sorry again this take a long time to be solved

Best Regards
Arief

Hi Leo,

I will inform the feature request to our developer (under CROS-801), meanwhile actually you can use UseDefaultPicker = false; inside your code (if you are using the MyInventory WebAPI Samples you can put it in code below):

private void ExecuteActivateImagePicker(object parameter)        {
            ImagePickerActivateParameter activateParameter = parameter as ImagePickerActivateParameter;
            if (activateParameter != null)
            {
                activateParameter.UseDefaultPicker = false;
            }
        }

And add action presenter inside it to create custom menu which already can handle each Menu function (Delete photo actually just this.Item.LargeImage = null; & this.Item.ThumbnailImage = null;)
 
Finally just follow how to localizing resource, hope it'll helps :)

Best Regards,
Arief

All times are GMT -5. The time now is 5:00 AM.
Previous Next