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

The following examples show how to use com.apkfuns.logutils.LogUtils#e() . 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: UserProfileActivity.java    From CoolChat with Apache License 2.0 6 votes vote down vote up
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == NameActivity.REQUEST_REMARK_NAME && resultCode == NameActivity.REQUEST_REMARK_NAME) {
        LogUtils.e("修改后的备注名为", data.getStringExtra("name"));
        String name = data.getStringExtra("name");
        contact.setRemarkName(name);
        contactDao.update(contact);
        initData();

        //通知主页聊天页面用户昵称更新
        EventBus.getDefault().post(new Conversation());
    } else {
        LogUtils.e("修改后的备注名为", "未修改");
    }
}
 
Example 2
Source File: ChatActivity.java    From CoolChat with Apache License 2.0 6 votes vote down vote up
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
    LogUtils.e("dispatchTouchEvent" + ",当前点击高度" + ev.getY());
    LogUtils.e("dispatchTouchEvent" + ",当前无效区域高度" + (DisplayUtils.getScreenHeight(this) - DisplayUtils.dp2px(this, 120)));
    if (ev.getY() < DisplayUtils.getScreenHeight(this) - AppConfig.getKeyboardHeight(this) - DisplayUtils.dp2px(this, 120)) {
        if (isKeyboardShowing) {
            LogUtils.e("点击事件" + "键盘在展示,要隐藏");
            KeyboardUtils.updateSoftInputMethod(this, WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
            KeyboardUtils.hideKeyboard(getCurrentFocus());
        }
        if (isMultiLayoutShowing) {
            hideMultiLayout();
        }
    }
    return super.dispatchTouchEvent(ev);
}
 
Example 3
Source File: RecordButton.java    From CoolChat with Apache License 2.0 6 votes vote down vote up
private void init() {

        //如果文件夹不创建的话那么执行到recorder.prepare()就会报错
        File dir = new File(audioPath);
        if (!dir.exists()) {
            dir.mkdirs();
        }

        recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        recorder.setMaxDuration(MAX_LENGTH);
        recorder.setOutputFile(audioFileName);
        try {
            recorder.prepare();
        } catch (IOException e) {
            e.printStackTrace();
            LogUtils.e("MediaRecorder prepare()报错");
        }
    }
 
Example 4
Source File: MainActivity.java    From SmallGdufe-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    AppConfig.appVer = CalcUtils.getVersionName(this);
    isAlpha = FileUtils.getIsAlphaTest(this);
    LogUtils.e("内测Ing");

    //未登录跳转登陆页
    if(!FileUtils.getStoredAccountAndSetApp(this) || TextUtils.isEmpty(AppConfig.sno) || TextUtils.isEmpty(AppConfig.idsPwd)){
        startActivity(new Intent(this, LoginActivity.class));
        this.finish();return; //没这个居然会往下跑!
    }
    //默认页为drcom的话就跳转到drcom页且关闭当前的(特例:从drcom回到main的情况不跳转,不然就死循环跳转了)
    AppConfig.defaultPage = FileUtils.getStoredDefaultPage(this);
    if(AppConfig.defaultPage == AppConfig.DefaultPage.DRCOM
            && !getIntent().getBooleanExtra(DrcomActivity.INTENT_DRCOM_TO_MAIN,false) ) {
        startActivity(new Intent(this, DrcomActivity.class));
        this.finish();return;
    }

    setTitle(R.string.app_name);
    initFragment();
    UpdateBuilder.create().check();

    checkAppTips();
}
 
Example 5
Source File: QupaiUpload.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
/**
 * 开始上传
 *
 * @param data 上传任务的task
 */
public static void startUpload(QupaiUploadTask data) {
    try {
        UploadService uploadService = UploadService.getInstance();
        uploadService.startUpload(data);
    } catch (IllegalArgumentException exc) {
        LogUtils.e("趣拍云上传错误:" + "Missing some arguments. " + exc.getMessage());
    }
}
 
Example 6
Source File: GroupProfileActivity.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == NameActivity.REQUEST_CHANGE_GROUP_NAME && resultCode == NameActivity.REQUEST_CHANGE_GROUP_NAME) {
        if (data.hasExtra("name")) {
            LogUtils.e("修改的后的群组名", data.getStringExtra("name"));
        }
    } else {
        LogUtils.e("修改的后的群组名", "未修改");
    }

}
 
Example 7
Source File: ChatActivity.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
/**
 * 下拉加载更多聊天信息
 */
private void initMoreChatData(String chatType, int chatId) {
    ChatDao chatDao = GreenDAOUtils.getInstance(ChatActivity.this).getChatDao();
    List<Chat> chats;
    //从Id最大的往小查
    if ("friend".equals(chatType)) {
        chats = chatDao.queryBuilder()
                .where(ChatDao.Properties.ChatType.eq(chatType), ChatDao.Properties.Id.lt(latestId))
                .whereOr(ChatDao.Properties.FromId.eq(chatId), ChatDao.Properties.ToId.eq(chatId))
                .limit(10)
                .orderDesc(ChatDao.Properties.Time)
                .build()
                .list();
    } else {
        chats = chatDao.queryBuilder()
                .where(ChatDao.Properties.ChatType.eq(chatType), ChatDao.Properties.Id.lt(latestId), ChatDao.Properties.ToId.eq(chatId))
                .limit(10)
                .orderDesc(ChatDao.Properties.Time)
                .build()
                .list();
    }
    if (!chats.isEmpty()) {
        latestId = chats.get(chats.size() - 1).getId();
        LogUtils.e("数据的索引" + latestId);
        Collections.reverse(chats);
        chatListData.addAll(0, chats);
        adapter.notifyDataSetChanged();
    } else {
        ToastUtils.showShort(ChatActivity.this, "没有更多数据了");
    }
    swipeRefreshLayout.setRefreshing(false);
}
 
Example 8
Source File: ChatActivity.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
/**
 * 加载最近的聊天消息,默认5条(QQ是15条)
 */
private void initRecentChatData(String chatType, int chatId) {
    ChatDao chatDao = GreenDAOUtils.getInstance(ChatActivity.this).getChatDao();
    List<Chat> chats;

    //从Id最大的往小查
    if ("friend".equals(chatType)) {
        chats = chatDao.queryBuilder()
                .where(ChatDao.Properties.ChatType.eq(chatType))
                .whereOr(ChatDao.Properties.FromId.eq(chatId), ChatDao.Properties.ToId.eq(chatId))
                .limit(5)
                .orderDesc(ChatDao.Properties.Time)
                .build()
                .list();
    } else {
        chats = chatDao.queryBuilder()
                .where(ChatDao.Properties.ChatType.eq(chatType), ChatDao.Properties.ToId.eq(chatId))
                .limit(5)
                .orderDesc(ChatDao.Properties.Time)
                .build()
                .list();
    }

    if (!chats.isEmpty()) {
        latestId = chats.get(chats.size() - 1).getId();
        LogUtils.e("数据的索引" + latestId);
        //倒序排列下
        Collections.reverse(chats);
        //为了加载和其他人聊天信息的时候清空屏幕
        chatListData.clear();
        chatListData.addAll(chats);

        adapter.notifyDataSetChanged();
        int itemCount = adapter.getItemCount() - 1;
        if (itemCount > 0) {
            recyclerView.smoothScrollToPosition(itemCount);
        }
    }
}
 
Example 9
Source File: ChatActivity.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
private void getData() {
    Intent intent = getIntent();
    chatId = intent.getIntExtra("chatId", 0);                       //好友或者群组的ID
    chatType = intent.getStringExtra("chatType");                   //群组还是好友
    chatName = intent.getStringExtra("chatName");                   //群组名或者好友名
    LogUtils.e("聊天信息" + "当前在跟" + chatType + ":ID为" + chatId + "的" + chatName + "聊天");
    initToolbar(chatName);

    //保存当前聊天对象的信息
    AppConfig.setUserCurrentChatId(ChatActivity.this, chatId);
    AppConfig.setUserCurrentChatType(ChatActivity.this, chatType);
}
 
Example 10
Source File: MyEditText.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
    if (event.getAction() == KeyEvent.KEYCODE_SOFT_LEFT) {
        LogUtils.e("dispatchKeyEventPreIme", "按下了返回键");
        if (mOnCancelInputLayout != null) {
            mOnCancelInputLayout.onCancelInputLayout();
        }
        return false;
    }
    return super.dispatchKeyEventPreIme(event);
}
 
Example 11
Source File: ConversationFragment.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
/**
 * 将数据从数据库删除
 */
private void deleteFromDB(Conversation conversation) {
    LogUtils.e("要删除的ID:" + conversation.getId() + "");
    conversationDao.delete(conversation);
    //更新页面
    handleConversation.sendEmptyMessage(0);
}
 
Example 12
Source File: MyService.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
private void updateChatData(int deleteMsgId) {
    ChatDao chatDao = GreenDAOUtils.getInstance(this).getChatDao();
    Chat deleteChat = chatDao.queryBuilder().where(ChatDao.Properties.MsgId.eq(deleteMsgId)).build().unique();
    if (null != deleteChat) {
        LogUtils.e("查到的信息:", deleteChat.getMsgId());
        deleteChat.setContentType("delete");
        chatDao.update(deleteChat);
    }
}
 
Example 13
Source File: CalcUtils.java    From SmallGdufe-Android with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 获取当前登陆学号的大一那年的年份,如2013级则返回13(即使现在是2017年),从而构造2013-2014(大一) 这种选择框
 * @return int 13
 */
public static int getFirstYear(){
    int firstYear = 13; //校友则学年根据个人信息的班级获取,正常账号直接截学号
    if(AppConfig.schoolmateSno.equals(AppConfig.sno)) {
        BasicInfo basicInfo = DataSupport.findFirst(BasicInfo.class);
        if(basicInfo == null){
            LogUtils.e("校友学年获取失败");
        }
        firstYear = Integer.parseInt(basicInfo != null ? basicInfo.getClassroom().substring(2, 4) : "13");
    }else {
        firstYear = Integer.parseInt(AppConfig.sno.substring(0, 2));
    }
    return firstYear;
}
 
Example 14
Source File: ApiUtils.java    From SmallGdufe-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public T apply(HttpResult<T> httpResult) throws Exception {
    if (!httpResult.isSuccess()) {  //业务错误到onError里获取
        LogUtils.e("httpres "+httpResult.getMsg());
        throw new ApiException(httpResult.getCode(),httpResult.getMsg());
    }
    return httpResult.getData();
}
 
Example 15
Source File: GreenDAOUtils.java    From CoolChat with Apache License 2.0 4 votes vote down vote up
public GreenDAOUtils(Context context) {
    String dataBaseName = AppConfig.getUserDB(context);
    LogUtils.e("加载的用户的数据库:" + dataBaseName);
    devOpenHelper = new DaoMaster.DevOpenHelper(context, dataBaseName, null);
}
 
Example 16
Source File: TietuUtil.java    From AppApis with Apache License 2.0 4 votes vote down vote up
public void getTietuListByType(Context mContext, Document doc) {

        Elements imgtcEles = doc.getElementsByClass("imgtc");

        Element imgtcEle = imgtcEles.get(0);

        if (imgtcEle != null) {

            Elements bannerLists = imgtcEle.select("li");

            List<TieTuListBean> tieTuListBeens = new ArrayList<>();

            for (int i = 0; i < bannerLists.size(); i++) {

                TieTuListBean tieTuListBean = new TieTuListBean();

                Element banners = bannerLists.get(i);

                Elements b_hrefs = banners.select("a");
                if (b_hrefs != null && b_hrefs.size() > 0) {
                    String href = "http://m.51tietu.net" + b_hrefs.get(0).attr("href");
                    String title = b_hrefs.get(0).attr("title");

                    tieTuListBean.title = title;
                    tieTuListBean.detailUrl = href;
                }

                Elements b_imgs = banners.select("img");
                if (b_imgs != null && b_imgs.size() > 0) {
                    String src = b_imgs.get(0).attr("src");

                    tieTuListBean.imgUrl = src;
                }

                LogUtils.e(tieTuListBean);
                tieTuListBeens.add(tieTuListBean);
            }


            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < tieTuListBeens.size(); i++) {
                String data = tieTuListBeens.get(i).toString();
                sb.append(data).append("\n");
            }

            Intent intent = new Intent(mContext, ShowActivity.class);
            intent.putExtra("data", sb.toString());
            mContext.startActivity(intent);
        }
    }
 
Example 17
Source File: L.java    From ZhiHu-TopAnswer with Apache License 2.0 4 votes vote down vote up
public static void e(String value) {
    if (isDEBUG) {
        LogUtils.e(value);
    }
}