當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。