@@ -0,0 +1,2579 @@
+package com.cube.storm.ui.lib.spec;%0A%0Aimport android.text.TextUtils;%0A%0Aimport com.cube.storm.ui.model.list.StandardListItem;%0Aimport com.cube.storm.ui.model.property.DestinationLinkProperty;%0Aimport com.cube.storm.ui.model.property.LinkProperty;%0Aimport com.cube.storm.ui.model.property.ShareLinkProperty;%0Aimport com.cube.storm.ui.view.holder.list.StandardListItemViewHolder;%0A%0A/**%0A * Specification abstract class used to determine whether a chevron should be shown on each %7B@link StandardListItemViewHolder%7D.%0A * Use this abstract class along with %7B@link com.cube.storm.UiSettings#setChevronSpec(ChevronSpec)%7D to change the default spec.%0A * Currently defaults to %7B@link ChevronSpec#noChevronSpec()%7D.%0A *%0A * @author JR Mitchell%0A * @project LightningUI%0A */%0Apublic abstract class ChevronSpec%0A%7B%0A%09/**%0A%09 * Determines whether a chevron should be shown based on the %7B@link StandardListItem%7D that it is populated with.%0A%09 *%0A%09 * @param model the model that the %7B@link StandardListItemViewHolder%7D is populated with%0A%09 * @return true if the UI element should show a chevron, else false.%0A%09 */%0A%09abstract public boolean shouldChevronShow(StandardListItem model);%0A%09%0A%09/**%0A%09 * Get an instance of %7B@link ChevronSpec%7D that never shows chevrons%0A%09 *%0A%09 * @return the new %7B@link ChevronSpec%7D instance%0A%09 */%0A%09public static ChevronSpec noChevronSpec()%0A%09%7B%0A%09%09return new ChevronSpec()%0A%09%09%7B%0A%09%09%09@Override public boolean shouldChevronShow(StandardListItem model)%0A%09%09%09%7B%0A%09%09%09%09return false;%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%09%0A%09/**%0A%09 * Get an instance of %7B@link ChevronSpec%7D that shows chevrons in a standard way which matches with iOS Storm behaviour.%0A%09 *%0A%09 * @return the new %7B@link ChevronSpec%7D instance%0A%09 */%0A%09public static ChevronSpec standardChevronSpec()%0A%09%7B%0A%09%09return new ChevronSpec()%0A%09%09%7B%0A%09%09%09@Override public boolean shouldChevronShow(StandardListItem model)%0A%09%09%09%7B%0A%09%09%09%09LinkProperty link = model.getLink();%0A%09%09%09%09return link != null && (%0A%09%09%09%09%09(link instanceof DestinationLinkProperty && !TextUtils.isEmpty(((DestinationLinkProperty)link).getDestination()))%0A%09%09%09%09%09%7C%7C link instanceof ShareLinkProperty%0A%09%09%09%09%09//%7C%7C link instanceof EmergencyLinkProperty %7C%7C link instanceof TimerLinkProperty%0A%09%09%09%09%09//NOTE: the above commented-out LinkProperty types appear to exist in iOS Storm library but not Android Storm library%0A%09%09%09%09);%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%09%0A%09/**%0A%09 * Get an instance of %7B@link ChevronSpec%7D that always shows chevrons%0A%09 *%0A%09 * @return the new %7B@link ChevronSpec%7D instance%0A%09 */%0A%09public static ChevronSpec allChevronSpec()%0A%09%7B%0A%09%09return new ChevronSpec()%0A%09%09%7B%0A%09%09%09@Override public boolean shouldChevronShow(StandardListItem model)%0A%09%09%09%7B%0A%09%09%09%09return true;%0A%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%7D%0A

Add ChevronSpec abstract class with useful static defaults