Java Code Examples for com.jess.arms.utils.ArmsUtils#snackbarText()

The following examples show how to use com.jess.arms.utils.ArmsUtils#snackbarText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResponseErrorListenerImpl.java    From lifecycle-component with Apache License 2.0 6 votes vote down vote up
@Override
public void handleResponseError(Context context, Throwable t) {
    Timber.tag("Catch-Error").w(t.getMessage());
    //这里不光只能打印错误, 还可以根据不同的错误做出不同的逻辑处理
    //这里只是对几个常用错误进行简单的处理, 展示这个类的用法, 在实际开发中请您自行对更多错误进行更严谨的处理
    String msg = "未知错误";
    if (t instanceof UnknownHostException) {
        msg = "网络不可用";
    } else if (t instanceof SocketTimeoutException) {
        msg = "请求网络超时";
    } else if (t instanceof HttpException) {
        HttpException httpException = (HttpException) t;
        msg = convertStatusCode(httpException);
    } else if (t instanceof JsonParseException || t instanceof ParseException || t instanceof JSONException || t instanceof JsonIOException) {
        msg = "数据解析错误";
    }
    ArmsUtils.snackbarText(msg);
}
 
Example 2
Source File: ResponseErrorListenerImpl.java    From Hands-Chopping with Apache License 2.0 6 votes vote down vote up
@Override
public void handleResponseError(Context context, Throwable t) {
    Timber.tag("Catch-Error").w(t.getMessage());
    //这里不光只能打印错误, 还可以根据不同的错误做出不同的逻辑处理
    //这里只是对几个常用错误进行简单的处理, 展示这个类的用法, 在实际开发中请您自行对更多错误进行更严谨的处理
    String msg = "未知错误";
    if (t instanceof UnknownHostException) {
        msg = "网络不可用";
    } else if (t instanceof SocketTimeoutException) {
        msg = "请求网络超时";
    } else if (t instanceof HttpException) {
        HttpException httpException = (HttpException) t;
        msg = convertStatusCode(httpException);
    } else if (t instanceof JsonParseException || t instanceof ParseException || t instanceof JSONException || t instanceof JsonIOException) {
        msg = "数据解析错误";
    }
    ArmsUtils.snackbarText(msg);
}
 
Example 3
Source File: ResponseErrorListenerImpl.java    From MVPArms with Apache License 2.0 6 votes vote down vote up
@Override
public void handleResponseError(Context context, Throwable t) {
    Timber.tag("Catch-Error").w(t);
    //这里不光只能打印错误, 还可以根据不同的错误做出不同的逻辑处理
    //这里只是对几个常用错误进行简单的处理, 展示这个类的用法, 在实际开发中请您自行对更多错误进行更严谨的处理
    String msg = "未知错误";
    if (t instanceof UnknownHostException) {
        msg = "网络不可用";
    } else if (t instanceof SocketTimeoutException) {
        msg = "请求网络超时";
    } else if (t instanceof HttpException) {
        HttpException httpException = (HttpException) t;
        msg = convertStatusCode(httpException);
    } else if (t instanceof JsonParseException || t instanceof ParseException || t instanceof JSONException || t instanceof JsonIOException) {
        msg = "数据解析错误";
    }
    ArmsUtils.snackbarText(msg);
}
 
Example 4
Source File: GoldHomeActivity.java    From lifecycle-component with Apache License 2.0 4 votes vote down vote up
@Override
public void showMessage(String message) {
    ArmsUtils.snackbarText(message);
}
 
Example 5
Source File: GankHomeActivity.java    From lifecycle-component with Apache License 2.0 4 votes vote down vote up
@Override
public void showMessage(String message) {
    ArmsUtils.snackbarText(message);
}
 
Example 6
Source File: ZhihuHomeActivity.java    From lifecycle-component with Apache License 2.0 4 votes vote down vote up
@Override
public void showMessage(String message) {
    ArmsUtils.snackbarText(message);
}
 
Example 7
Source File: DetailActivity.java    From lifecycle-component with Apache License 2.0 4 votes vote down vote up
@Override
public void showMessage(@NonNull String message) {
    checkNotNull(message);
    ArmsUtils.snackbarText(message);
}
 
Example 8
Source File: VideoDetailActivity.java    From LQRBiliBlili with MIT License 4 votes vote down vote up
@Override
public void showMessage(@NonNull String message) {
    checkNotNull(message);
    ArmsUtils.snackbarText(message);
}
 
Example 9
Source File: MainActivity.java    From LQRBiliBlili with MIT License 4 votes vote down vote up
@Override
public void showMessage(@NonNull String message) {
    checkNotNull(message);
    ArmsUtils.snackbarText(message);
}
 
Example 10
Source File: UserActivity.java    From MVPArms with Apache License 2.0 4 votes vote down vote up
@Override
public void showMessage(@NonNull String message) {
    checkNotNull(message);
    ArmsUtils.snackbarText(message);
}