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


Java MainActivity类代码示例

本文整理汇总了Java中com.lqr.wechat.ui.activity.MainActivity的典型用法代码示例。如果您正苦于以下问题:Java MainActivity类的具体用法?Java MainActivity怎么用?Java MainActivity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MainActivity类属于com.lqr.wechat.ui.activity包,在下文中一共展示了MainActivity类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initView

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
public void initView(View rootView) {
    mIvQRCordCard.setOnClickListener(v -> showQRCard());
    mOivAlbum.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToWebViewActivity(AppConst.WeChatUrl.MY_JIAN_SHU));
    mOivCollection.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToWebViewActivity(AppConst.WeChatUrl.MY_CSDN));
    mOivWallet.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToWebViewActivity(AppConst.WeChatUrl.MY_OSCHINA));
    mOivCardPaket.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToWebViewActivity(AppConst.WeChatUrl.MY_GITHUB));
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:9,代码来源:MeFragment.java

示例2: initListener

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
public void initListener() {
    mHeaderView.findViewById(R.id.llNewFriend).setOnClickListener(v -> {
        ((MainActivity) getActivity()).jumpToActivity(NewFriendActivity.class);
        ((MainActivity) getActivity()).mTvContactRedDot.setVisibility(View.GONE);
        mTvNewFriendUnread.setVisibility(View.GONE);
    });
    mHeaderView.findViewById(R.id.llGroup).setOnClickListener(v -> ((MainActivity) getActivity()).jumpToActivity(GroupListActivity.class));
    mQib.setOnLetterUpdateListener(new QuickIndexBar.OnLetterUpdateListener() {
        @Override
        public void onLetterUpdate(String letter) {
            //显示对话框
            showLetter(letter);
            //滑动到第一个对应字母开头的联系人
            if ("↑".equalsIgnoreCase(letter)) {
                mRvContacts.moveToPosition(0);
            } else if ("☆".equalsIgnoreCase(letter)) {
                mRvContacts.moveToPosition(0);
            } else {
                List<Friend> data = ((LQRAdapterForRecyclerView) ((LQRHeaderAndFooterAdapter) mRvContacts.getAdapter()).getInnerAdapter()).getData();
                for (int i = 0; i < data.size(); i++) {
                    Friend friend = data.get(i);
                    String c = friend.getDisplayNameSpelling().charAt(0) + "";
                    if (c.equalsIgnoreCase(letter)) {
                        mRvContacts.moveToPosition(i);
                        break;
                    }
                }
            }
        }

        @Override
        public void onLetterCancel() {
            //隐藏对话框
            hideLetter();
        }
    });
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:39,代码来源:ContactsFragment.java

示例3: updateTotalUnreadView

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
private void updateTotalUnreadView() {
    if (mUnreadCountTotal > 0) {
        ((MainActivity) mContext).getTvMessageCount().setText(mUnreadCountTotal + "");
        ((MainActivity) mContext).getTvMessageCount().setVisibility(View.VISIBLE);
        ((MainActivity) mContext).setToolbarTitle(UIUtils.getString(R.string.app_name) + "(" + mUnreadCountTotal + ")");
    } else {
        ((MainActivity) mContext).getTvMessageCount().setVisibility(View.GONE);
        ((MainActivity) mContext).setToolbarTitle(UIUtils.getString(R.string.app_name));
    }
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:11,代码来源:RecentMessageFgPresenter.java

示例4: login

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
public void login() {
    String phone = getView().getEtPhone().getText().toString().trim();
    String pwd = getView().getEtPwd().getText().toString().trim();

    if (TextUtils.isEmpty(phone)) {
        UIUtils.showToast(UIUtils.getString(R.string.phone_not_empty));
        return;
    }
    if (TextUtils.isEmpty(pwd)) {
        UIUtils.showToast(UIUtils.getString(R.string.password_not_empty));
        return;
    }

    mContext.showWaitingDialog(UIUtils.getString(R.string.please_wait));
    ApiRetrofit.getInstance().login(AppConst.REGION, phone, pwd)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(loginResponse -> {
                int code = loginResponse.getCode();
                mContext.hideWaitingDialog();
                if (code == 200) {
                    UserCache.save(loginResponse.getResult().getId(), phone, loginResponse.getResult().getToken());
                    mContext.jumpToActivityAndClearTask(MainActivity.class);
                    mContext.finish();
                } else {
                    loginError(new ServerException(UIUtils.getString(R.string.login_error) + code));
                }
            }, this::loginError);
}
 
开发者ID:GitLqr,项目名称:LQRWeChat,代码行数:30,代码来源:LoginAtPresenter.java

示例5: login

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
public void login() {
    String phone = getView().getEtPhone().getText().toString().trim();
    String pwd = getView().getEtPwd().getText().toString().trim();

    if (TextUtils.isEmpty(phone)) {
        UIUtils.showToast(UIUtils.getString(R.string.phone_not_empty));
        return;
    }
    if (TextUtils.isEmpty(pwd)) {
        UIUtils.showToast(UIUtils.getString(R.string.password_not_empty));
        return;
    }

    mContext.showWaitingDialog(UIUtils.getString(R.string.please_wait));
    /**
     * 通过自己写的Retrofit封装类对象调用登录方法传入参数 执行请求返回jsonBean对象
     */
    ApiRetrofit.getInstance().login(AppConst.REGION, phone, pwd)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(loginResponse -> {
                int code = loginResponse.getCode();
                mContext.hideWaitingDialog();
                if (code == 200) {
                    /**
                     * 缓存Token ,Phone,token
                     */
                    UserCache.save(loginResponse.getResult().getId(), phone, loginResponse.getResult().getToken());
                    mContext.jumpToActivityAndClearTask(MainActivity.class);
                    mContext.finish();
                } else {
                    loginError(new ServerException(UIUtils.getString(R.string.login_error) + code));//有错误抛出错误
                }
            }, this::loginError);
}
 
开发者ID:lo625090140,项目名称:lqrwechatrongcloud,代码行数:36,代码来源:LoginAtPresenter.java

示例6: initListener

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
public void initListener() {
    mOivScan.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToActivity(ScanActivity.class));
    mOivShop.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToWebViewActivity(AppConst.WeChatUrl.JD));
    mOivGame.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToWebViewActivity(AppConst.WeChatUrl.GAME));
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:7,代码来源:DiscoveryFragment.java

示例7: createPresenter

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
protected DiscoveryFgPresenter createPresenter() {
    return new DiscoveryFgPresenter((MainActivity) getActivity());
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:5,代码来源:DiscoveryFragment.java

示例8: createPresenter

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
protected RecentMessageFgPresenter createPresenter() {
    return new RecentMessageFgPresenter((MainActivity) getActivity());
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:5,代码来源:RecentMessageFragment.java

示例9: initListener

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
public void initListener() {
    mLlMyInfo.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToActivityAndClearTop(MyInfoActivity.class));
    mOivSetting.setOnClickListener(v -> ((MainActivity) getActivity()).jumpToActivityAndClearTop(SettingActivity.class));
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:6,代码来源:MeFragment.java

示例10: createPresenter

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
protected MeFgPresenter createPresenter() {
    return new MeFgPresenter((MainActivity) getActivity());
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:5,代码来源:MeFragment.java

示例11: createPresenter

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
@Override
protected ContactsFgPresenter createPresenter() {
    return new ContactsFgPresenter((MainActivity) getActivity());
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:5,代码来源:ContactsFragment.java

示例12: createPresenter

import com.lqr.wechat.ui.activity.MainActivity; //导入依赖的package包/类
/**
 * 创建MVp
 * @return
 */
@Override
protected RecentMessageFgPresenter createPresenter() {
    return new RecentMessageFgPresenter((MainActivity) getActivity());
}
 
开发者ID:lo625090140,项目名称:lqrwechatrongcloud,代码行数:9,代码来源:RecentMessageFragment.java


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