To align pencil icon to right, in main.xml change LinearLayout to RelativeLayout that matches example code from lynda.com
In main.xml manually re-indent.