本文整理汇总了Java中com.csipsimple.utils.CustomDistribution类的典型用法代码示例。如果您正苦于以下问题:Java CustomDistribution类的具体用法?Java CustomDistribution怎么用?Java CustomDistribution使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomDistribution类属于com.csipsimple.utils包,在下文中一共展示了CustomDistribution类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeCallWithOptions
import com.csipsimple.utils.CustomDistribution; //导入依赖的package包/类
@Override
public void makeCallWithOptions(final String callee, final int accountId, final Bundle options)
throws RemoteException {
SipService.this.enforceCallingOrSelfPermission(SipManager.PERMISSION_USE_SIP, null);
//We have to ensure service is properly started and not just binded
SipService.this.startService(new Intent(SipService.this, SipService.class));
if(pjService == null) {
Log.e(THIS_FILE, "Can't place call if service not started");
// TODO - we should return a failing status here
return;
}
if(!supportMultipleCalls) {
// Check if there is no ongoing calls if so drop this request by alerting user
SipCallSession activeCall = pjService.getActiveCallInProgress();
if(activeCall != null) {
if(!CustomDistribution.forceNoMultipleCalls()) {
notifyUserOfMessage(R.string.not_configured_multiple_calls);
}
return;
}
}
Intent intent = new Intent(SipManager.ACTION_SIP_CALL_LAUNCH);
intent.putExtra(SipProfile.FIELD_ID, accountId);
intent.putExtra(SipManager.EXTRA_SIP_CALL_TARGET, callee);
intent.putExtra(SipManager.EXTRA_SIP_CALL_OPTIONS, options);
sendOrderedBroadcast (intent , SipManager.PERMISSION_USE_SIP, mPlaceCallResultReceiver, null, Activity.RESULT_OK, null, null);
}
示例2: getCustomView
import com.csipsimple.utils.CustomDistribution; //导入依赖的package包/类
public View getCustomView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.help, container, false);
ListView lv = (ListView) v.findViewById(android.R.id.list);
lv.setOnItemClickListener(this);
ArrayList<HelpEntry> items = new ArrayList<HelpEntry>();
// FAQ
if(!TextUtils.isEmpty(CustomDistribution.getFaqLink())) {
items.add(new HelpEntry(android.R.drawable.ic_menu_info_details, R.string.faq, FAQ));
}
// Issue list
if(CustomDistribution.showIssueList()) {
items.add(new HelpEntry(android.R.drawable.ic_menu_view, R.string.view_existing_issues, OPEN_ISSUES));
}
// Log collector
if(!TextUtils.isEmpty(CustomDistribution.getSupportEmail()) ) {
if(isRecording()) {
items.add(new HelpEntry( android.R.drawable.ic_menu_send , R.string.send_logs, SEND_LOGS));
}else {
items.add(new HelpEntry( android.R.drawable.ic_menu_save , R.string.record_logs, START_LOGS));
}
}
items.add(new HelpEntry(android.R.drawable.ic_menu_gallery, R.string.legal_information, LEGALS));
if(NightlyUpdater.isNightlyBuild(getActivity())){
items.add(new HelpEntry(R.drawable.ic_launcher_nightly, R.string.update_nightly_build, NIGHTLY));
}
lv.setAdapter(new HelpArrayAdapter(getActivity(), items));
TextView tv = (TextView) v.findViewById(android.R.id.text1);
tv.setText(CollectLogs.getApplicationInfo(getActivity()));
return v;
}
示例3: onCreateOptionsMenu
import com.csipsimple.utils.CustomDistribution; //导入依赖的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);
}
示例4: onCreate
import com.csipsimple.utils.CustomDistribution; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
//prefWrapper = new PreferencesWrapper(this);
prefProviderWrapper = new PreferencesProviderWrapper(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.sip_home);
final ActionBar ab = getSupportActionBar();
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayShowTitleEnabled(false);
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// ab.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
// showAbTitle = Compatibility.hasPermanentMenuKey
Tab dialerTab = ab.newTab()
.setContentDescription(R.string.dial_tab_name_text)
.setIcon(R.drawable.ic_ab_dialer_holo_dark);
Tab callLogTab = ab.newTab()
.setContentDescription(R.string.calllog_tab_name_text)
.setIcon(R.drawable.ic_ab_history_holo_dark);
Tab favoritesTab = null;
if(CustomDistribution.supportFavorites()) {
favoritesTab = ab.newTab()
.setContentDescription(R.string.favorites_tab_name_text)
.setIcon(R.drawable.ic_ab_favourites_holo_dark);
}
Tab messagingTab = null;
if (CustomDistribution.supportMessaging()) {
messagingTab = ab.newTab()
.setContentDescription(R.string.messages_tab_name_text)
.setIcon(R.drawable.ic_ab_text_holo_dark);
}
warningTab = ab.newTab().setIcon(android.R.drawable.ic_dialog_alert);
warningTabfadeAnim = ObjectAnimator.ofInt(warningTab.getIcon(), "alpha", 255, 100);
warningTabfadeAnim.setDuration(1500);
warningTabfadeAnim.setRepeatCount(ValueAnimator.INFINITE);
warningTabfadeAnim.setRepeatMode(ValueAnimator.REVERSE);
mDualPane = getResources().getBoolean(R.bool.use_dual_panes);
mViewPager = (ViewPager) findViewById(R.id.pager);
mTabsAdapter = new TabsAdapter(this, getSupportActionBar(), mViewPager);
mTabsAdapter.addTab(dialerTab, DialerFragment.class, TAB_ID_DIALER);
mTabsAdapter.addTab(callLogTab, CallLogListFragment.class, TAB_ID_CALL_LOG);
if(favoritesTab != null) {
mTabsAdapter.addTab(favoritesTab, FavListFragment.class, TAB_ID_FAVORITES);
}
if (messagingTab != null) {
mTabsAdapter.addTab(messagingTab, ConversationsListFragment.class, TAB_ID_MESSAGES);
}
hasTriedOnceActivateAcc = false;
if (!prefProviderWrapper.getPreferenceBooleanValue(SipConfigManager.PREVENT_SCREEN_ROTATION)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}
selectTabWithAction(getIntent());
Log.setLogLevel(prefProviderWrapper.getLogLevel());
// Async check
asyncSanityChecker = new Thread() {
public void run() {
asyncSanityCheck();
};
};
asyncSanityChecker.start();
}
示例5: onOptionsItemSelected
import com.csipsimple.utils.CustomDistribution; //导入依赖的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);
}