Search in sources :

Example 6 with MyDialogFragment

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

the class MsgTransListUI method onItemLongClick.

@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
    MyDialogFragment mdf = new MyDialogFragment(MyDialogFragment.DIALOG_LIST, R.array.delete_trans_array);
    mdf.setItemClickCallback(new MyDialogFragment.ItemClickCallback() {

        @Override
        public void itemClickCallback(int which) {
            ChatMsg msg = mList.get(position);
            FinalUserDataBase.getInstance().deleteChatEventTransByMessageId(msg.getMessageId());
            MyToast.showToast(MsgTransListUI.this, getString(R.string.delete_success));
            mList.remove(position);
            mAdapter.updateList(mList);
        }
    });
    mdf.show(getSupportFragmentManager(), "mdf");
    return true;
}
Also used : MyDialogFragment(com.lingtuan.firefly.util.MyDialogFragment) ChatMsg(com.lingtuan.firefly.vo.ChatMsg)

Example 7 with MyDialogFragment

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

the class MainContactFragmentUI method ShowDeleteDialog.

/**
 * Remove buddy bounced
 */
private void ShowDeleteDialog(final String uid, final boolean isOfflineFriend) {
    MyDialogFragment mdf = new MyDialogFragment(MyDialogFragment.DIALOG_LIST, R.array.delete_friend_array);
    mdf.setItemClickCallback(new MyDialogFragment.ItemClickCallback() {

        @Override
        public void itemClickCallback(int which) {
            deleteFriends(uid, isOfflineFriend);
        }
    });
    mdf.show(getFragmentManager(), "mdf");
}
Also used : MyDialogFragment(com.lingtuan.firefly.util.MyDialogFragment) SuppressLint(android.annotation.SuppressLint)

Example 8 with MyDialogFragment

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

the class MainFoundFragmentUI method selectGenderMethod.

/**
 * Screening of gender box
 */
private void selectGenderMethod() {
    MyDialogFragment mdf = new MyDialogFragment(MyDialogFragment.DIALOG_LIST, R.array.sex_list_all);
    mdf.setItemClickCallback(new MyDialogFragment.ItemClickCallback() {

        @Override
        public void itemClickCallback(int which) {
            if (which == 0) {
                // male
                updateDatas("1");
            } else if (which == 1) {
                // female
                updateDatas("2");
            } else {
                // all
                if (mDatas != null) {
                    mAdapter.resetSource(mDatas);
                }
            }
        }
    });
    mdf.show(getFragmentManager(), "mdf");
}
Also used : MyDialogFragment(com.lingtuan.firefly.util.MyDialogFragment)

Aggregations

MyDialogFragment (com.lingtuan.firefly.util.MyDialogFragment)8 SuppressLint (android.annotation.SuppressLint)4 ChatMsg (com.lingtuan.firefly.vo.ChatMsg)3 ActivityNotFoundException (android.content.ActivityNotFoundException)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 ClipboardManager (android.text.ClipboardManager)1 ChatMsgComparable (com.lingtuan.firefly.custom.ChatMsgComparable)1 ScanLargePic (com.lingtuan.firefly.imagescan.ScanLargePic)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 JSONException (org.json.JSONException)1