本文整理汇总了Java中com.novoda.notils.exception.DeveloperError类的典型用法代码示例。如果您正苦于以下问题:Java DeveloperError类的具体用法?Java DeveloperError怎么用?Java DeveloperError使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeveloperError类属于com.novoda.notils.exception包,在下文中一共展示了DeveloperError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateViewHolder
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Override
public MessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
MessageBubbleDrawable bubbleDrawable;
MessageView messageView;
if (viewType == VIEW_TYPE_MESSAGE_THIS_USER) {
bubbleDrawable = new MessageBubbleDrawable(parent.getContext(), R.color.colorPrimaryLight, Gravity.END);
messageView = (MessageView) inflater.inflate(R.layout.self_message_item_layout, parent, false);
} else if (viewType == VIEW_TYPE_MESSAGE_OTHER_USERS) {
bubbleDrawable = new MessageBubbleDrawable(parent.getContext(), R.color.bubble_grey, Gravity.START);
messageView = (MessageView) inflater.inflate(R.layout.message_item_layout, parent, false);
} else {
throw new DeveloperError("There is an unknown view type, you should inflate a view for it.");
}
messageView.setTextBackground(bubbleDrawable);
return new MessageViewHolder(messageView);
}
示例2: getOrder
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
protected String getOrder() {
QUERY query = (QUERY) getArguments().get("query");
switch (query) {
case top:
return HNewsContract.StoryEntry.RANK + " ASC" +
", " + HNewsContract.StoryEntry.TIMESTAMP + " DESC";
case newest:
return HNewsContract.StoryEntry.TIME_AGO + " DESC";
case best:
return HNewsContract.StoryEntry.SCORE + " DESC" +
", " + HNewsContract.StoryEntry.TIMESTAMP + " DESC";
default:
new DeveloperError("Bad Query type");
return null;
}
}
示例3: init
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Override
public void init() {
synchronized (this) {
if (initialised) {
throw new DeveloperError("You don't really want init this if it was already initialised");
}
initialised = true;
configureDrawer();
flowerDrawer.init();
}
}
示例4: init
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Override
public void init() {
synchronized (this) {
if (initialised) {
throw new DeveloperError("You don't really want init this if it was already initialised");
}
initialised = true;
configureDrawer();
}
}
示例5: setOrientation
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Override
public void setOrientation(int orientation) {
if (orientation != VERTICAL) {
throw new DeveloperError("CroutonView supports only vertical orientation");
}
super.setOrientation(orientation);
}
示例6: getType
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
public Story.FILTER getType() {
QUERY query = (QUERY) getArguments().get("query");
switch (query) {
case top:
return Story.FILTER.top_story;
case newest:
return Story.FILTER.new_story;
case best:
return Story.FILTER.top_story;
default:
new DeveloperError("Bad Query type");
return null;
}
}
示例7: getStory
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
private Story getStory() {
if (activity.getIntent().getExtras().containsKey(CommentsActivity.ARG_STORY)) {
return (Story) activity.getIntent().getExtras().getSerializable(CommentsActivity.ARG_STORY);
} else {
throw new DeveloperError("Missing argument");
}
}
示例8: createIntent
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
/**
* TODO Allow intent creation without connection. Might be useful to re-customise a current session.
*/
public CustomTabsIntent createIntent() {
if (connection.isDisconnected()) {
throw new DeveloperError("An active connection to custom tabs service is required for intent creation");
}
Session session = connection.getSession();
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(session.getCustomTabsSession());
for (Composer composer : composers) {
builder = composer.compose(builder);
}
return builder.build();
}
示例9: newSession
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
public Session newSession() {
if (!stillConnected()) {
throw new DeveloperError("Cannot start session on a disconnected client. Use stillConnected() to check connection");
}
warmup();
return SimpleChromeCustomTabsSession.newSessionFor(customTabsClient);
}
示例10: givenThatClientIsDisconnected_whenStartingNewSession_thenClientIsNotWarmedUp
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Test(expected = DeveloperError.class)
public void givenThatClientIsDisconnected_whenStartingNewSession_thenClientIsNotWarmedUp() {
connectedClient.disconnect();
connectedClient.newSession();
verify(mockCustomTabsClient, never()).warmup(anyInt());
}
示例11: from
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static <T> T from(Object implementor) {
try {
return (T) implementor;
} catch (ClassCastException e) {
throw new DeveloperError(implementor.toString() + " does not inherit / implement the wanted interface", e);
}
}
示例12: shouldShowLogs
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
/**
* Returns the active status of the log switch
*
* @return {@code true} if logs are active, {@code false} if deactivated
*/
public static boolean shouldShowLogs() {
if (INITIALISED) {
return SHOW_LOGS;
} else {
throw new DeveloperError("#rekt - To use simple logger you need to have called setShowLogs(boolean). "
+ "The typical way is to use Log.setShowLogs(BuildConfig.DEBUG) "
+ "in onCreate() of your class that extends Application."
+ "(It's ok we've all been there.)");
}
}
示例13: setOrientation
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Override
public final void setOrientation(int orientation) {
throw new DeveloperError("This layout only supports horizontal orientation");
}
示例14: setOrientation
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
@Override
public void setOrientation(int orientation) {
throw new DeveloperError("This view only supports vertical orientation");
}
示例15: instance
import com.novoda.notils.exception.DeveloperError; //导入依赖的package包/类
private static Inject instance() {
if (INSTANCE == null) {
throw new DeveloperError("You need to setup Inject to use a valid DependenciesFactory");
}
return INSTANCE;
}