本文整理汇总了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;
}
}
示例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;
}
}
示例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();
}
}
}
示例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();
}
示例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;
}
}