Archive for April 18th, 2016

All credits to the original author for doing this. Although I’m trying to extend it in the coming days, but props to Adam for finding this one out!

Go to https://www.syntaxismyui.com/xamarin-forms-in-anger-cards/ and follow his other tutorial as well.

 

The #1 request I get for the Xamarin.Forms in Anger is for a Google or Facebook like card view. Today is the day that I fulfill those requests.

To be completely honest, I’ve been thinking about how to do a card view for a while and let me tell you, it’s not easy. Especially when you try to stick with the “in the box” components of Xamarin.Forms. My first attempt at it was hideous.

Hideous Forms

Hideous would be the most polite way of saying it was crap. I started off using BoxViews to draw the lines and contain the whole thing in a Xamarin.Forms Grid. Ouch, yes hideous.

The Grid was becoming a nightmare with all the extra rows and columns needed for lines. What I wouldn’t do for some HTML Tables with a borders = 1 in Xamarin.Forms. I thought of putting in a feature request to the team, but didn’t. I don’t want them to laugh at me. 😉

Waffle Fries to the Rescue

With the BoxViews not working out, I went to lunch to clear my head and to think. I love lunch and I don’t miss a meal. That day, I decided to go to Chick Fil A and get a chicken sandwich with a side of epiphany fries.

There I was, eating my chicken and dunking my fries in ketchup (Sauce de American). When I dipped a waffle fry into the ketchup, the ketchup squeezed through the holes and made a red checkerboard on top of the fry. Then it hit me. Bam!

I was going about the card UI backwards or forwards. Either way, it was the wrong way. I had to do an about face and approach it in another way. The way the ketchup came up through the fry not by putting ketchup onto the fry.

A Grid of Lines

As soon as I got home, I worked up a Xamarin.Forms Grid with some padding, row and column spacing. In addition to those settings, I also set the background color of the grid to a medium dark grey. Then added ContentViews with white backgrounds into each cell of the Grid. This is what it looked like when I finished.

GridLines

The white panels acted like the ketchup on my waffle fries and the borders are the potato. Yes, I know, it’s strange to describe Xamarin.Forms design techniques using food, but stay with me; it gets better. Now that I knew the technique worked and was a heck of a lot less messy, I pushed on.

Content View Panels

Each CardView is made up of 5 ContentViews with a background color set to the designed color. Here are some of the background colors for each panel.

Panels

The CardView.cs file would have been gigantic if I kept all the code in the same file so I broke it up into different ContentViews. Here are the names for each ContentView that makes up the CardView.

CardViews

The CardDetailsView has a column span of three to horizontally bridge the two IconLableViews and the ConfigIconView. The CardStatusView has a row span of two to complete the vertical lefthand status bar.

The CardView Code

For the demo, I put a couple of CardViews in a vertical StackLayout. If I had a lot of cards, I would prefer to use a ListView. Hopefully a reader will let me know how well this design works in a ListView. It should be ok, especially while using the Grid and not a bunch of nested StackLayouts. I’ve learned my lesson.

public class CardView : ContentView
{
public CardView (Card card)
{
Grid grid = new Grid {
Padding = new Thickness (0, 1, 1, 1),
RowSpacing = 1,
ColumnSpacing = 1, 
BackgroundColor = StyleKit.CardBorderColor,
VerticalOptions = LayoutOptions.FillAndExpand,
RowDefinitions = {
new RowDefinition { Height = new GridLength (70, GridUnitType.Absolute) },
new RowDefinition { Height = new GridLength (30, GridUnitType.Absolute) }
},
ColumnDefinitions = {
new ColumnDefinition { Width = new GridLength (4, GridUnitType.Absolute) },
new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
new ColumnDefinition { Width = new GridLength (100, GridUnitType.Absolute) },
new ColumnDefinition { Width = new GridLength (50, GridUnitType.Absolute) }
}
};

grid.Children.Add (
new CardStatusView (card)
, 0, 1, 0, 2);

grid.Children.Add (new CardDetailsView (card), 1, 4, 0, 1);

grid.Children.Add (
new IconLabelView (
card.StatusMessageFileSource,
card.StatusMessage
)
, 1, 1);

grid.Children.Add (
new IconLabelView (
card.ActionMessageFileSource,
card.ActionMessage
)
, 2, 1);

grid.Children.Add (new ConfigIconView (), 3, 1);

Content = grid;
}
}

With all the refactoring; the CardView looks small and plain but the devil is in the ContentViews.

 

Final Layout:

Solution

The code for this sample is up on GitHub in the “In Anger” repository. For this post, I broke the code out into a separate directory and solution to make it easier for you to reuse the CardView without getting confused with all the other code and resources from other posts.

Moar Epiphany Fires

Who knew that a humble waffle fry would be the answer to the Xamarin.Forms CardView? Not me; I go for the chicken. Don’t you worry dear read, I will continue to go to “Chick Fil a” to get more Xamarin.Forms design inspiration in the future. Stay tuned to this blog and, if you have a design challenge, just put it in the comments below or email me at adam [at] adamjwolf dot com.

Xamarin.Forms in Anger Series

Can Xamarin.Forms produce good looking cross-platform UI from a single codebase? Each “In Anger” blog post will tackle a single page of a beautifully designed iOS or Android application. My job will be to reproduce the design in Xamarin.Forms as faithfully as possible.

So, Lot of people like me have a hackintosh all ready and set up and are usually missing just one very critical component of Hackintosh, that is, WIFI.

It’s not that the fix is hard (for some might be, modding and bios, maybe?) but its just for the cost involved. Why would anyone want to pay so much for something that is twice the price of the OS itself? So here’s the card that you all should buy:

 

It is the chipset BCM94322HM8L. You can get it from amazon for less that 7$!!!!

http://www.amazon.com/dp/B002OB0FPI/ref=wl_it_dp_o_pd_S_ttl?_encoding=UTF8&colid=JT2P8ARM3K9W&coliid=I2B6Z3GMHISRVS

Now, if this becomes out of stock or becomes costlier, ping me I’ll help you get it for less that 7$. Shipping inclusive.

 

You can also google search the fore mentioned  chipset, I’m sure you’ll get ton of results as well. And what’s the cherry on the cake? No KEXTS required.!!! yes, It works out of the box. So what are you waiting for???

Needs : Remix OS EFI ISO, Remix OS USB Tool, EasyUEFI, and 8GB Pendrive

Step . 1 : Create partition minimum 8GB (Recommended) with Fat32
Step. 2 : Download Remix OS EFI/UEFI ISO File from http://www.jide.com/en/remixos-for-pc
Step. 3 : Extract With Winrar, you have two file remix os ISO and Remix OS USB Tool
Step. 4: Run Remix OS USB Tool, Connect your Pendrive to Your PC/Laptop and Browse Remix OS File and Choose USB Disk Your Pendrive and Press Okay Button
Step. 5: Wait to Complete process. After complete process close Remix OS USB Tool.
Step. 6: Now open your Pendrive and Copy All File to Your Remix OS Partition (Previously you created in step. 1)
Step. 7: Now Download & Install EasyUEFI setup :

THe installer from there home page might not work. So here’s the link to the version which works flawlessly:

Download from easyuefi here : Link 1 : http://turbobit.net/mh2tosaboslr.html Link 2 : http://www.redbunker.net/yrqiezi1qo8…Setup.rar.html Link 3 : https://cloud.mail.ru/public/39162da…UEFI_Setup.rar  OR http://11.gddx.crsky.com/201509/EasyUEFI-v2.3.zip
Step. 8: Now open EasyUEFI, Click on Add new entry. check this image : http://bit.ly/1K8sVvR
Step. 9: In Type section Choose “Linux or Other OS” check this image : http://bit.ly/1RL5f3a
Step. 10: Type RemixOS (Whatever you want) in Description section. Check this image : http://bit.ly/1nN5heq
Step. 11: Select the target partition section, Select Remix OS Partition
Step. 12: Then Click on Browse Button, then click on + icon > Click on efi + icon > click on boot + icon > select bootia32.efi (for 32bit pc) or bootx64.efi (for 64bit pc) and click on OK button. check this image : http://bit.ly/1KCnmAU
Step. 13: Now close EasyUEFI
Step. 1: Now Shutdown your PC/Laptop and Turn on using Boot Menu Key. There you can select Remix OS. After select Remix OS it will show Guest Mode and Resident Mode.

Congratulations, Now You can run Remix OS

 

There are many ways to dual boot Windows and Mac OS X with different boot loaders on MBR but for UEFI, there’s only Clover boot loader is capable if you set it up correctly. In order to dual boot with Clover by default, you need to install Clover to EFI folder –> rename bootmgfw.efi to bootmgfw-orig.efi in the efi/Microsoft/boot/ folder. When we renamed this bootmgfw.efi, the bios will boot from clover BOOTX64.EFI in the efi/boot/ folder and the Clover boot GUI will come up with all the Windows and Mac OS X partition for us to select and boot correctly.

boot_folder_bootmgfw_efi     clover_boot_gui

This Guide is full walkthrough to how you can Dual Boot your Mac OSX El Capitan and Windows 10 on Hackintosh is very Simpler and Easier .

Using Single HDD / Hard-Drive  it is not difficult and it requires no experience and all basic installation steps are mentioned in this Guide

I assumes you have installed Mac OSX El Capitan on your Hard-Drive but if you haven’t installed it then Please follow below Guide and do installation First ::

1.At least 8 GB USB Drive

2. Windows 10 ISO Image

3. Latest revision of Rufus Download Here 

3. Latest revision of EasyUEFI Download Here

Making or Preparing for Windows10 USB installer 

Step 1: Now Run RuFus app and make sure your USB is Selected or Select it and Select Windows10 ISO Image as in ScreenShots Below ::

Rufus Installation

Step 2 : When Process Complete , Reboot your PC and Boot With USB Drive we prepared .

 Install MicroSoft Windows 10

Step 1 : Now Click on Install Now

Dual Boot Windows1 and OSX El Capitan

Step 2 :Choose your Language /Time/KeyBoard Setting and Click Next

Dual Boot Windows1 and OSX El Capitan 1

Step 3 : Select Custom Install and Look for Unallocated Partition , Choose and Click next , windows will prompt you “this will Create System Partitions ” .

Dual Boot Windows1 and OSX El Capitan 2

Step 4 : Now there will be Partions are as follow :

1.EFI Partition ( 200 MB)

2.OSX Partition (100 GB or more than what space you provided it )

3.MicroSoft Reserved Partition (620 MB)

4. Now Left Partition (320 GB ) Select it and Click Next and wait Untill Installation Complete

Dual Boot Windows1 and OSX El Capitan 3

 

Dual Boot Setting for OSX El Capitan and Windows10 

Now you have Windows But you are not able to Boot to OSX El Capitan due to Missing Boot Entry , now we gonna Fix This ::

Step 1: Run EasyUEFI   and See which Boot Entries are available , now we gonna add Missing Entry for OSX Bootloader ( Clover Bootloader ).

Disk0 is usually the internal Hard Drive / SSD. In the Boot order section, we can see that only Windows Boot Manager is detected. There is no mention of Clover UEFI anywhere.

EasyUEFI Setting

Step 2: To solve this problem, click on the Add button (the second button you see on the right).

EasyUEFI Settings 2

Step 3: Now Change Type fromWindows BootManager to Linux or Other OS , Type Name in Description Box (Whatever you want Clover Bootloader or Mac OSX Bootloader or Else depends upon you),  and Click Browse Button

EasyUEFI Settings 3

Step 4:  Now Expand EFI => BOOT or CLOVER Folder , Select any of Bootx64.efi or Cloverx64.efi  , Both are Clover Bootloader files Choose one or add Entry for Both but one is Enough to Boot Clover then why you waste your time but if you having Issue with and Then Use Another Option.

EasyUEFI Settings 4

Note : Remember these things :

1.Bootx64.efi is Bootloader file (this file is from Clover Bootloader )

2.Bootmgfw.efi is Windows Bootloader

3.Cloverx64.efi is Clover Bootloader

initially when we Click on drive to Boot it loads Bootx64.efi First then Required Files to Boot to OS (Operating System) . Every OS Contains it Bootx64.efi , Windows and Linux too . above Bootx64.efi is from CloverBootloader but anyhow your file is got Replaced with particular OS then Bootx64.efi will load that OS only .Clover is capable of running any OS.

But Don’t Worry use Above Bootloader Files to Boot to OS what you want .

Now Everything is done and you have Successfully added Boot Entry for OSX El Capitan in BIOS , Just Select This Entry and Boot to OS you want .

You will See Boot Menu Like This :-

Asus UEFI BootMenu

Also You can Set you OS’s Priority . you will see like This :-

Asus UEFI BIOS

Additional Workarounds :

These Following Steps i used to Format my Single HDD to Dual Boot in Mac OSX DiskUtility .

OSX El Capitan DiskUtility is not providing option to set you HDD as Free Space (as we were have in Yosemite or before OSX Version)

i have HDD (500 GB ) 250 GB for OSX El Capitan  and 250 GB for Windows 10 .

if you set you HDD first 250GB as Mac OSX and Second 250 GB as FAT32 or ExFat , This Way OSX WIll make Format your HDD as Hybrid GPT , there’s only way to Format you HDD as OSX Journaled to get Full GPT Drive .

Window 10 Can’t be Install on HyBrid GPT Drive you will Receive this Error Continously :-

Windows Error

Solution to This Error :-  

1 :  I Used Mac OSX Yosemite USB installer and Fomatted My HDD as

First 250GB for OSX  formatted as OSX Journaled and Left 250 GB as Free Space .

Free Space will be as Unallocated Space in Window10 Installation Disk Management

2 : You Can use GptFDisk to Convert your Hybrid GPT Drive into Pure or Full GPT then Windows Installation Can Proceed .

Pure/Full GPT Disk will look like :-

GPT FDISK

Above Screenshot is from Gdisk you can use Partition Manager Softwares on Windows as well as OSX to Determine Drive is Full GPT or Hybrid GPT .

Note : In My Case i was not able to Convert Hybrid GPT Disk using GDisk , receiving too many error then i used solution 1 , which is much Easier .

Things to be Remember Always Before Dual Boot:-

1. Always Install Install OSX First on HDD , Don’t try to Install Windows First .

2.EFI Partition is Required for UEFI Bios System , if EFI is not Present then it not Booting UEFI is using Legacy Boot.

3.Disable Secured or Set it to Other OS in Bios Menu , otherwise you won’t able to Boot from any OS then Windows .

Never try to Install Windows First Because Windows always make first partition as OEM (100MB), Second EFI (100 MB) and Third MSR (620 MB ).

OSX always Requires EFI to be First Partition and of (200 MB) at least of Size , otherwise you will Receive this Error Continuosly . Error will look like this :-

MEDiaKit reports partition (map) too small - Error

PS: This Guide is not only for Dual Booting With OSX El Capitan with Windows10 , you can Dual Boot any Version of OSX and Windows (UEFI Support ) on Single Hard Drive using This Method .