Search in sources :

Example 1 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class RaidenChannelList method changeChannel.

@Override
public void changeChannel(final int position, boolean isOpen) {
    if (isOpen) {
        MyViewDialogFragment mdf = new MyViewDialogFragment();
        mdf.setTitleAndContentText(getString(R.string.raiden_channel_close), null);
        mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

            @Override
            public void okBtn() {
                channelCloseMethod(position);
            }
        });
        mdf.show(getSupportFragmentManager(), "mdf");
    }
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Example 2 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class WalletCopyActivity method showDelSacnWalletDialog.

/**
 * Observe purse to delete
 */
private void showDelSacnWalletDialog() {
    MyViewDialogFragment mdf = new MyViewDialogFragment();
    mdf.setTitleAndContentText(getString(R.string.wallet_delete), getString(R.string.wallet_scan_del));
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            delWallet();
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Example 3 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class FriendReportUI method addBlackMethod.

/**
 * Add a blacklist
 */
private void addBlackMethod() {
    MyViewDialogFragment mdf = new MyViewDialogFragment();
    mdf.setTitleAndContentText(getString(R.string.report_sent), getString(R.string.info_shield_user));
    mdf.setSubmitNamContentText(getString(R.string.info_block));
    mdf.setCancelCallback(new MyViewDialogFragment.CancelCallback() {

        @Override
        public void cancelBtn() {
            finish();
        }
    });
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            toAddBlack();
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Example 4 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class ChattingUI method deleteMethod.

/**
 * Forward delete methods
 */
private void deleteMethod() {
    if (mAdapter.getSelectedList() == null || mAdapter.getSelectedList().size() == 0) {
        showToast(getString(R.string.chat_file_empty));
        return;
    }
    int titleIds = isSceneDelete ? R.string.chatting_selected_delete : R.string.chatting_selected_relay;
    if (isSceneDelete) {
        // delete
        MyViewDialogFragment mdf = new MyViewDialogFragment();
        mdf.setTitleAndContentText(getString(titleIds), null);
        mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

            @Override
            public void okBtn() {
                if (isSceneDelete) {
                    // Delete
                    Map<String, ChatMsg> selectedList = mAdapter.getSelectedList();
                    ChatMsg msg = null;
                    if (!selectedList.isEmpty()) {
                        for (Map.Entry<String, ChatMsg> s : selectedList.entrySet()) {
                            FinalUserDataBase.getInstance().deleteChatMsgBymessageId(s.getValue().getMessageId());
                            if (msg != null && s.getValue().getMsgTime() > msg.getMsgTime()) {
                                continue;
                            }
                            msg = s.getValue();
                        }
                    }
                    mAdapter.removeSelectList();
                    if (msg == null) {
                        return;
                    }
                    if (msg != null) {
                        msg.setUsername(userName);
                        msg.setUserImage(avatarUrl);
                    }
                    FinalUserDataBase.getInstance().updateChatEventContent(uid, msg);
                    MyToast.showToast(ChattingUI.this, getString(R.string.delete_success));
                } else {
                // Forwarding
                }
                rollbackScene();
            }
        });
        mdf.show(getSupportFragmentManager(), "mdf");
    } else {
        // Forwarding
        ArrayList<ChatMsg> list = new ArrayList<>();
        for (Map.Entry<String, ChatMsg> s : mAdapter.getSelectedList().entrySet()) {
            list.add(s.getValue());
        }
        Intent intent = new Intent(this, ContactSelectedUI.class);
        intent.putExtra("msglist", list);
        startActivity(intent);
        Utils.openNewActivityAnim(this, false);
    }
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment) ArrayList(java.util.ArrayList) Intent(android.content.Intent) Map(java.util.Map) ChatMsg(com.lingtuan.firefly.vo.ChatMsg)

Example 5 with MyViewDialogFragment

use of com.lingtuan.firefly.util.MyViewDialogFragment in project SmartMesh_Android by SmartMeshFoundation.

the class DiscussGroupMemberListUI method onItemLongClick.

@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
    if (position == 0) {
        return true;
    }
    MyViewDialogFragment mdf = new MyViewDialogFragment();
    mdf.setTitleAndContentText(getString(R.string.notif), getString(R.string.tip_del_member));
    mdf.setOkCallback(new MyViewDialogFragment.OkCallback() {

        @Override
        public void okBtn() {
            removeMember(position);
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
    return true;
}
Also used : MyViewDialogFragment(com.lingtuan.firefly.util.MyViewDialogFragment)

Aggregations

MyViewDialogFragment (com.lingtuan.firefly.util.MyViewDialogFragment)16 Intent (android.content.Intent)4 ChatMsg (com.lingtuan.firefly.vo.ChatMsg)2 FragmentManager (android.support.v4.app.FragmentManager)1 CaptureActivity (com.lingtuan.firefly.quickmark.CaptureActivity)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1