当前位置: 首页>>代码示例>>Java>>正文


Java KLog.w方法代码示例

本文整理汇总了Java中com.socks.library.KLog.w方法的典型用法代码示例。如果您正苦于以下问题:Java KLog.w方法的具体用法?Java KLog.w怎么用?Java KLog.w使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.socks.library.KLog的用法示例。


在下文中一共展示了KLog.w方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HeaderViewWrapperAdapter

import com.socks.library.KLog; //导入方法依赖的package包/类
public HeaderViewWrapperAdapter(RecyclerView recyclerView,
                                @NonNull RecyclerView.Adapter mWrappedAdapter,
                                ArrayList<FixedViewInfo> mHeaderViewInfos,
                                ArrayList<FixedViewInfo> mFooterViewInfos) {
    this.recyclerView = recyclerView;
    this.mWrappedAdapter = mWrappedAdapter;
    try {
        mWrappedAdapter.registerAdapterDataObserver(mDataObserver);
    }catch (IllegalStateException e){
        //maybe observer is added
        KLog.w(e);
    }
    if (mHeaderViewInfos == null) {
        this.mHeaderViewInfos = EMPTY_INFO_LIST;
    } else {
        this.mHeaderViewInfos = mHeaderViewInfos;
    }
    if (mFooterViewInfos == null) {
        this.mFooterViewInfos = EMPTY_INFO_LIST;
    } else {
        this.mFooterViewInfos = mFooterViewInfos;
    }
}
 
开发者ID:razerdp,项目名称:FriendCircle,代码行数:24,代码来源:HeaderViewWrapperAdapter.java

示例2: setCountSpan

import com.socks.library.KLog; //导入方法依赖的package包/类
/**
 * 设置加载item占据一整行
 *
 * @param mRecyclerView
 */
private void setCountSpan(RecyclerView mRecyclerView) {
    RecyclerView.LayoutManager layoutManager = mRecyclerView.getLayoutManager();
    if (layoutManager == null) {
        ToastSnackUtil.snackbarLong(mRecyclerView, TAG + "layoutManager=null");
        KLog.w(TAG + "layoutManager=null");
    }
    if (layoutManager instanceof GridLayoutManager) {
        final GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
        gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
            @Override
            public int getSpanSize(int position) {
                int itemViewType = getItemViewType(position);
                if (itemViewType == TYPE_NORMAL_ITEM) {
                    return 1;
                } else {
                    return gridLayoutManager.getSpanCount();
                }
            }
        });
    }

    if (layoutManager instanceof StaggeredGridLayoutManager) {
        //后面会用到
        mStaggeredGridLayoutManager = (StaggeredGridLayoutManager) layoutManager;
    }

}
 
开发者ID:yihaha,项目名称:YGank,代码行数:33,代码来源:YBaseLoadingAdapter.java

示例3: show

import com.socks.library.KLog; //导入方法依赖的package包/类
public void show(String msg) {
  if (mSuperToast == null) {
    KLog.w("对象未实例化");
  } else {
    if (!this.msg.equals(msg)) {
      this.msg = msg;
      mSuperToast.setText(msg).show();
    } else if (!mSuperToast.isShowing()) {
      mSuperToast.setText(msg).show();
    }
  }
}
 
开发者ID:bitkylin,项目名称:BitkyShop,代码行数:13,代码来源:ToastUtil.java

示例4: onCreate

import com.socks.library.KLog; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);

    setSupportActionBar(mToolbar);
    mToolbar.setTitleTextColor(Color.WHITE);

    //当前数据库版本
    KLog.w("db version: " + DaoMaster.SCHEMA_VERSION);

    mFastAdapter = new GenericFastItemAdapter<>(new Function<Student, StudentItem>() {
        @Override
        public StudentItem apply(Student student) {
            return new StudentItem(student);
        }
    });

    mStudents = new ArrayList<>();

    mRandom = new Random();

    GridLayoutManager manager = new GridLayoutManager(this, 1);
    manager.setSpanSizeLookup(new GridLayoutManager.DefaultSpanSizeLookup());


    mRvMain.setAdapter(mFastAdapter);
    mRvMain.setLayoutManager(manager);

    mHelper = DbUtil.getDriverHelper();

    //读取所有学生
    dbStudents = mHelper.queryAll();

    //把学生信息显示到界面
    for (Student s : dbStudents) {
        Student item = new Student();
        item.id = s.getId();
        item.name = s.getName();
        item.age = s.getAge();
        item.number = s.getNumber();
        item.score = s.getScore();

        KLog.w("db: " + item.id + ", "
                + item.age + ", " + item.name + ", "
                + item.number
        );

        mStudents.add(item);
    }
    mFastAdapter.addModel(mStudents);

    //获取age大于20的数据
    Query<Student> query = mHelper.queryBuilder()
            .where(StudentDao.Properties.Age.ge("20"))
            .build();
    dbStudents = query.list();

}
 
开发者ID:jp1017,项目名称:GreenDAO3_Demo,代码行数:61,代码来源:MainActivity.java

示例5: onUpgrade

import com.socks.library.KLog; //导入方法依赖的package包/类
@Override
    public void onUpgrade(Database db, int oldVersion, int newVersion) {
        KLog.w("db version update from " + oldVersion + " to " + newVersion);

        switch (oldVersion) {
            case 1:

                //不能先删除表,否则数据都木了
//                StudentDao.dropTable(db, true);

                StudentDao.createTable(db, true);

                // 加入新字段 score
                db.execSQL("ALTER TABLE 'STUDENT' ADD 'SCORE' TEXT;");

                break;
        }

    }
 
开发者ID:jp1017,项目名称:GreenDAO3_Demo,代码行数:20,代码来源:MyOpenHelper.java


注:本文中的com.socks.library.KLog.w方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。