當前位置: 首頁>>代碼示例>>Java>>正文


Java WizardInfo類代碼示例

本文整理匯總了Java中com.csipsimple.wizards.WizardUtils.WizardInfo的典型用法代碼示例。如果您正苦於以下問題:Java WizardInfo類的具體用法?Java WizardInfo怎麽用?Java WizardInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WizardInfo類屬於com.csipsimple.wizards.WizardUtils包,在下文中一共展示了WizardInfo類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateContextMenu

import com.csipsimple.wizards.WizardUtils.WizardInfo; //導入依賴的package包/類
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    final SipProfile account = profileFromContextMenuInfo(menuInfo);
    if(account == null) {
        return;
    }
    WizardInfo wizardInfos = WizardUtils.getWizardClass(account.wizard);

    // Setup the menu header
    menu.setHeaderTitle(account.display_name);
    if(wizardInfos != null) {
        menu.setHeaderIcon(wizardInfos.icon);
    }
    
    menu.add(0, MENU_ITEM_ACTIVATE, 0, account.active ? R.string.deactivate_account
            : R.string.activate_account);
    menu.add(0, MENU_ITEM_MODIFY, 0, R.string.modify_account);
    menu.add(0, MENU_ITEM_DELETE, 0, R.string.delete_account);
    menu.add(0, MENU_ITEM_WIZARD, 0, R.string.choose_wizard);

}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:AccountsEditListFragment.java

示例2: addAccountInfos

import com.csipsimple.wizards.WizardUtils.WizardInfo; //導入依賴的package包/類
/**
 * Apply account information to remote view
 * 
 * @param context application context for resources retrieval
 * @param activeAccountsInfos List of sip profile state to show in this
 *            notification view
 */
public void addAccountInfos(Context context, ArrayList<SipProfileState> activeAccountsInfos) {
    int i = 0;
    for (SipProfileState accountInfo : activeAccountsInfos) {
        // Clamp to max possible notifications in remote view
        if (i < cells.length) {
            setViewVisibility(cells[i], View.VISIBLE);
            WizardInfo wizardInfos = WizardUtils.getWizardClass(accountInfo.getWizard());
            if (wizardInfos != null) {
                CharSequence dName = accountInfo.getDisplayName();

                setImageViewResource(icons[i], wizardInfos.icon);
                if (!TextUtils.isEmpty(dName)) {
                    setTextViewText(texts[i], dName);
                    // setCharSequence(icons[i], "setContentDescription",
                    // dName);
                }
            }
            i++;
        }
    }

}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:30,代碼來源:RegistrationNotification.java

示例3: onCreateOptionsMenu

import com.csipsimple.wizards.WizardUtils.WizardInfo; //導入依賴的package包/類
@Override
public boolean onCreateOptionsMenu(Menu menu) {

    int actionRoom = getResources().getBoolean(R.bool.menu_in_bar) ? MenuItem.SHOW_AS_ACTION_IF_ROOM : MenuItem.SHOW_AS_ACTION_NEVER;
    
    WizardInfo distribWizard = CustomDistribution.getCustomDistributionWizard();
    if (distribWizard != null) {
        menu.add(Menu.NONE, DISTRIB_ACCOUNT_MENU, Menu.NONE, "My " + distribWizard.label)
                .setIcon(distribWizard.icon)
                .setShowAsAction(actionRoom);
    }
    if (CustomDistribution.distributionWantsOtherAccounts()) {
        int accountRoom = actionRoom;
        if(Compatibility.isCompatible(13)) {
            accountRoom |= MenuItem.SHOW_AS_ACTION_WITH_TEXT;
        }
        menu.add(Menu.NONE, ACCOUNTS_MENU, Menu.NONE,
                (distribWizard == null) ? R.string.accounts : R.string.other_accounts)
                .setIcon(R.drawable.ic_menu_account_list)
                .setAlphabeticShortcut('a')
                .setShowAsAction( accountRoom );
    }
    menu.add(Menu.NONE, PARAMS_MENU, Menu.NONE, R.string.prefs)
            .setIcon(android.R.drawable.ic_menu_preferences)
            .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

    menu.add(Menu.NONE, HELP_MENU, Menu.NONE, R.string.help)
            .setIcon(android.R.drawable.ic_menu_help)
            .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    menu.add(Menu.NONE, CLOSE_MENU, Menu.NONE, R.string.menu_disconnect)
            .setIcon(R.drawable.ic_lock_power_off)
            .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

    return super.onCreateOptionsMenu(menu);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:36,代碼來源:SipHome.java

示例4: bindView

import com.csipsimple.wizards.WizardUtils.WizardInfo; //導入依賴的package包/類
@Override
public void bindView(View view, Context context, Cursor cursor) {
    super.bindView(view, context, cursor);

    AccountListItemViews tagView = (AccountListItemViews) view.getTag();
    if (tagView == null) {
        tagView = tagRowView(view);
    }

    // Get the view object and account object for the row
    final SipProfile account = new SipProfile(cursor);
    AccountRowTag tagIndicator = new AccountRowTag();
    tagIndicator.accountId = account.id;
    tagIndicator.activated = account.active;
    tagView.indicator.setTag(tagIndicator);

    tagView.indicator.setVisibility(draggable ? View.GONE : View.VISIBLE);
    tagView.grabber.setVisibility(draggable ? View.VISIBLE : View.GONE);

    // Get the status of this profile

    tagView.labelView.setText(account.display_name);

    // Update status label and color
    if (account.active) {
        AccountStatusDisplay accountStatusDisplay = AccountListUtils.getAccountDisplay(context,
                account.id);
        tagView.statusView.setText(accountStatusDisplay.statusLabel);
        tagView.labelView.setTextColor(accountStatusDisplay.statusColor);

        // Update checkbox selection
        tagView.activeCheckbox.setChecked(true);
        tagView.barOnOff.setImageResource(accountStatusDisplay.checkBoxIndicator);

    } else {
        tagView.statusView.setText(R.string.acct_inactive);
        tagView.labelView.setTextColor(mContext.getResources().getColor(
                R.color.account_inactive));

        // Update checkbox selection
        tagView.activeCheckbox.setChecked(false);
        tagView.barOnOff.setImageResource(R.drawable.ic_indicator_off);

    }

    // Update account image
    final WizardInfo wizardInfos = WizardUtils.getWizardClass(account.wizard);
    if (wizardInfos != null) {
        tagView.activeCheckbox.setBackgroundResource(wizardInfos.icon);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:52,代碼來源:AccountsEditListAdapter.java

示例5: onOptionsItemSelected

import com.csipsimple.wizards.WizardUtils.WizardInfo; //導入依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case ACCOUNTS_MENU:
            startActivity(new Intent(this, AccountsEditList.class));
            return true;
        case PARAMS_MENU:
            startActivityForResult(new Intent(SipManager.ACTION_UI_PREFS_GLOBAL), CHANGE_PREFS);
            return true;
        case CLOSE_MENU:
            Log.d(THIS_FILE, "CLOSE");
            boolean currentlyActiveForIncoming = prefProviderWrapper.isValidConnectionForIncoming();
            boolean futureActiveForIncoming = (prefProviderWrapper.getAllIncomingNetworks().size() > 0);
            if (currentlyActiveForIncoming || futureActiveForIncoming) {
                // Alert user that we will disable for all incoming calls as
                // he want to quit
                new AlertDialog.Builder(this)
                        .setTitle(R.string.warning)
                        .setMessage(
                                getString(currentlyActiveForIncoming ? R.string.disconnect_and_incoming_explaination
                                        : R.string.disconnect_and_future_incoming_explaination))
                        .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                prefProviderWrapper.setPreferenceBooleanValue(PreferencesWrapper.HAS_BEEN_QUIT, true);
                                disconnect(true);
                            }
                        })
                        .setNegativeButton(R.string.cancel, null)
                        .show();
            } else {
                disconnect(true);
            }
            return true;
        case HELP_MENU:
            // Create the fragment and show it as a dialog.
            DialogFragment newFragment = Help.newInstance();
            newFragment.show(getSupportFragmentManager(), "dialog");
            return true;
        case DISTRIB_ACCOUNT_MENU:
            WizardInfo distribWizard = CustomDistribution.getCustomDistributionWizard();

            Cursor c = getContentResolver().query(SipProfile.ACCOUNT_URI, new String[] {
                    SipProfile.FIELD_ID
            }, SipProfile.FIELD_WIZARD + "=?", new String[] {
                    distribWizard.id
            }, null);

            Intent it = new Intent(this, BasePrefsWizard.class);
            it.putExtra(SipProfile.FIELD_WIZARD, distribWizard.id);
            Long accountId = null;
            if (c != null && c.getCount() > 0) {
                try {
                    c.moveToFirst();
                    accountId = c.getLong(c.getColumnIndex(SipProfile.FIELD_ID));
                } catch (Exception e) {
                    Log.e(THIS_FILE, "Error while getting wizard", e);
                } finally {
                    c.close();
                }
            }
            if (accountId != null) {
                it.putExtra(SipProfile.FIELD_ID, accountId);
            }
            startActivityForResult(it, REQUEST_EDIT_DISTRIBUTION_ACCOUNT);

            return true;
        default:
            break;
    }
    return super.onOptionsItemSelected(item);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:72,代碼來源:SipHome.java

示例6: getCustomDistributionWizard

import com.csipsimple.wizards.WizardUtils.WizardInfo; //導入依賴的package包/類
/**
 * The default wizard info for this distrib. If none no custom distribution wizard is shown
 * @return the default wizard info
 */
public static WizardInfo getCustomDistributionWizard() {
	return null; 
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:CustomDistribution.java


注:本文中的com.csipsimple.wizards.WizardUtils.WizardInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。