Java Code Examples for com.apkfuns.logutils.LogUtils#i()

The following examples show how to use com.apkfuns.logutils.LogUtils#i() . 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: CourseAppWidgetProvider.java    From SmallGdufe-Android with GNU General Public License v3.0 6 votes vote down vote up
@Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        super.onUpdate(context, appWidgetManager, appWidgetIds);
        LogUtils.i("====onUpdate");

        setRemoteView(context);
        currentDay = WidgetCommonUtil.getTodayInWeek();
        updateDataView(context, appWidgetIds[0]);   //固定[0]

        //添加点击事件
        SetOnClickPendingIntent(context,R.id.widget_btn_nextday, WidgetCommonUtil.WidgetConstant.INTENT_NEXTDAY);
        SetOnClickPendingIntent(context,R.id.widget_btn_preday, WidgetCommonUtil.WidgetConstant.INTENT_PREDAY);
        SetOnClickPendingIntent(context,R.id.widget_tv_weekday, WidgetCommonUtil.WidgetConstant.INTENT_NEXTDAY); //点击星期几也显示明天的

//        //更新全部widget的界面,这个代码没效果,不过以后如果有遇到其他代码更新无效的情况可以试试
//        for (int widgetId : appWidgetIds) {
//            appWidgetManager.updateAppWidget(widgetId, remoteViews);
//        }

        //  item点击事件调到app,与WidgetListProviderFactory的setOnClickFillInIntent()共同使用
        Intent clickIntent = new Intent(context, MainActivity.class);
        PendingIntent clickPI = PendingIntent.getActivity(context, 0, clickIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        remoteViews.setPendingIntentTemplate(R.id.desktop_widget_list, clickPI);
    }
 
Example 2
Source File: CourseAppWidgetProvider.java    From SmallGdufe-Android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
    super.onReceive(context, intent);
    LogUtils.i(intent.getAction());
    String currentWeek = FileUtils.getCurrentWeek(context);

    //更换日期且更新对应数据
    if (intent.getAction().equals(WidgetCommonUtil.WidgetConstant.INTENT_NEXTDAY)){
        currentDay = WidgetCommonUtil.getNextDay(currentDay);
        WidgetListProviderFactory.refreshData(currentDay,currentWeek);
        setDepartmentOrWeek(context);
    }else if (intent.getAction().equals(WidgetCommonUtil.WidgetConstant.INTENT_PREDAY)) {
        currentDay = WidgetCommonUtil.getPreDay(currentDay);
        WidgetListProviderFactory.refreshData(currentDay,currentWeek);
        setDepartmentOrWeek(context);
    }else{ //其他广播不需要处理
    }
    LogUtils.i("after change currentDay:"+currentDay + " "+ "星期" + weekName[currentDay]);

    //更新 星期几 的文字说明
    setRemoteView(context);
    remoteViews.setTextViewText(R.id.widget_tv_weekday,"星期" + weekName[currentDay]);
    notifyUpdateUI(context);
    notifyListUpdateUI(context);

}
 
Example 3
Source File: OkHttpTask.java    From ZhiHu-TopAnswer with Apache License 2.0 5 votes vote down vote up
private OkHttpTask(OkHttpClient okHttpClient) {
    if (okHttpClient == null) {
        OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient.Builder();
        //cookie enabled
        okHttpClientBuilder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));
        okHttpClientBuilder.hostnameVerifier(new HostnameVerifier() {
            @Override
            public boolean verify(String hostname, SSLSession session) {
                return true;
            }
        });

        if (isDebug) {
            HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
                @Override
                public void log(String message, String json) {
                    LogUtils.i(message);
                    if (!TextUtils.isEmpty(json)) {
                        LogUtils.i("--------json---------\n");
                        LogUtils.json(json);
                        LogUtils.i("--------end----------\n");
                    }
                }

            });
            loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
            loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
            okHttpClientBuilder.addInterceptor(loggingInterceptor);
        }
        mOkHttpClient = okHttpClientBuilder.build();
    } else {
        mOkHttpClient = okHttpClient;
    }


    init();
}
 
Example 4
Source File: DrcomService.java    From SmallGdufe-Android with GNU General Public License v3.0 4 votes vote down vote up
private void performLogCall(String msg){
    LogUtils.i(msg);
}
 
Example 5
Source File: CourseAppWidgetProvider.java    From SmallGdufe-Android with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onEnabled(Context context) {
    super.onEnabled(context);
    LogUtils.i("onEnabled");
}
 
Example 6
Source File: L.java    From ZhiHu-TopAnswer with Apache License 2.0 4 votes vote down vote up
public static void i(String value) {
    if (isDEBUG) {
        LogUtils.i(value);
    }
}