Java Code Examples for com.socks.library.KLog#w()

The following examples show how to use com.socks.library.KLog#w() . 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: HeaderViewWrapperAdapter.java    From star-zone-android with Apache License 2.0 6 votes vote down vote up
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;
    }
}
 
Example 2
Source File: ToastUtil.java    From BitkyShop with MIT License 5 votes vote down vote up
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();
    }
  }
}
 
Example 3
Source File: MainActivity.java    From KLog with Apache License 2.0 5 votes vote down vote up
public void log(View view) {
    KLog.v();
    KLog.d();
    KLog.i();
    KLog.w();
    KLog.e();
    KLog.a();
}
 
Example 4
Source File: MainActivity.java    From KLog with Apache License 2.0 5 votes vote down vote up
public void logWithNull(View view) {
    KLog.v(null);
    KLog.d(null);
    KLog.i(null);
    KLog.w(null);
    KLog.e(null);
    KLog.a(null);
}
 
Example 5
Source File: MainActivity.java    From KLog with Apache License 2.0 5 votes vote down vote up
public void logWithMsg(View view) {
    KLog.v(LOG_MSG);
    KLog.d(LOG_MSG);
    KLog.i(LOG_MSG);
    KLog.w(LOG_MSG);
    KLog.e(LOG_MSG);
    KLog.a(LOG_MSG);
}
 
Example 6
Source File: MainActivity.java    From KLog with Apache License 2.0 5 votes vote down vote up
public void logWithTag(View view) {
    KLog.v(TAG, LOG_MSG);
    KLog.d(TAG, LOG_MSG);
    KLog.i(TAG, LOG_MSG);
    KLog.w(TAG, LOG_MSG);
    KLog.e(TAG, LOG_MSG);
    KLog.a(TAG, LOG_MSG);
}
 
Example 7
Source File: MainActivity.java    From KLog with Apache License 2.0 5 votes vote down vote up
public void logWithParams(View view) {
    KLog.v(TAG, LOG_MSG, "params1", "params2", this);
    KLog.d(TAG, LOG_MSG, "params1", "params2", this);
    KLog.i(TAG, LOG_MSG, "params1", "params2", this);
    KLog.w(TAG, LOG_MSG, "params1", "params2", this);
    KLog.e(TAG, LOG_MSG, "params1", "params2", this);
    KLog.a(TAG, LOG_MSG, "params1", "params2", this);
}
 
Example 8
Source File: MainActivity.java    From GreenDAO3_Demo with Apache License 2.0 4 votes vote down vote up
@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();

}
 
Example 9
Source File: MyOpenHelper.java    From GreenDAO3_Demo with Apache License 2.0 4 votes vote down vote up
@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;
        }

    }