当前位置: 首页>>代码示例>>Java>>正文


Java SherlockDialogFragment类代码示例

本文整理汇总了Java中com.actionbarsherlock.app.SherlockDialogFragment的典型用法代码示例。如果您正苦于以下问题:Java SherlockDialogFragment类的具体用法?Java SherlockDialogFragment怎么用?Java SherlockDialogFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SherlockDialogFragment类属于com.actionbarsherlock.app包,在下文中一共展示了SherlockDialogFragment类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onDialogPositiveClick

import com.actionbarsherlock.app.SherlockDialogFragment; //导入依赖的package包/类
@Override
public void onDialogPositiveClick() {
	setSendPaymentControlsState(false);
	if (lastBluetoothAddress != null)
		maybePrepareBluetoothBroadcast(lastBluetoothAddress);
	this.parentActivity.getServiceUtils().sendCommand(lastSendPayment, new ParameterizedRunnable() {
		@Override
		public void run(WebsocketReply reply) {
			String tx = null;
			
			if (reply.getReplyType() == WebsocketReply.TYPE_WS_SEND_FAILED) {
				WSSendFailed wsSF = (WSSendFailed)reply;
				String message = getString(R.string.send_payment_error)
										+ " " + wsSF.getReason(); 
				SherlockDialogFragment dialog = ErrorMessageDialogFragment.newInstance(message);
				dialog.show(getActivity().getSupportFragmentManager(), "errormessage");
			}
			
			if (reply.getReplyType() == WebsocketReply.TYPE_WS_SEND_SUCCESSFUL) {
				recipientAddressEditText.setText("");
				amountEditText.setText("");
				
				WSSendSuccessful wsSS = (WSSendSuccessful)reply;
				tx = wsSS.getTx();
				
				Toast.makeText(getActivity()
						, R.string.send_payment_success, Toast.LENGTH_SHORT).show();
			}

			maybeBroadcastViaBluetooth(tx);
			setSendPaymentControlsState(true);
		}
	});
}
 
开发者ID:javgh,项目名称:Bridgewalker-Android,代码行数:35,代码来源:SendFragment.java

示例2: onOptionsItemSelected

import com.actionbarsherlock.app.SherlockDialogFragment; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.record:
            // record the data
            SherlockDialogFragment dialog = new RecordOptionDialogFragment(chartTitle);
            dialog.show(getSupportFragmentManager(), "RecordOptionDialogFragment");
            return true;
        case R.id.about:
            // about
            return true;
        default:
            return false;
    }
}
 
开发者ID:dumbfingers,项目名称:SensorFun,代码行数:16,代码来源:PlotActivity.java

示例3: onItemClick

import com.actionbarsherlock.app.SherlockDialogFragment; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> av, View v, int position, long id) {
       Log.i(THIS_FILE, "Item clicked : " + id +" " + position);
	HelpArrayAdapter haa = (HelpArrayAdapter) av.getAdapter();
	HelpEntry he = haa.getItem(position);
	
	SherlockDialogFragment newFragment;
	switch (he.choiceTag) {
	case FAQ:
		newFragment = Faq.newInstance();
        newFragment.show(getFragmentManager(), "faq");
		break;
	case LEGALS:
		newFragment = Legal.newInstance();
        newFragment.show(getFragmentManager(), "issues");
		break;
	case OPEN_ISSUES:
		Intent it = new Intent(Intent.ACTION_VIEW);
		it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		it.setData(Uri.parse("http://code.google.com/p/csipsimple/issues"));
		startActivity(it);
		break;
	case NIGHTLY:
		// We have to check for an update
		final NightlyUpdater nu = new NightlyUpdater(getActivity());
		Thread t = new Thread() {
			public void run() {
				UpdaterPopupLauncher ru = nu.getUpdaterPopup(true);
				if (ru != null) {
					getActivity().runOnUiThread(ru);
				}
			};
		};
		t.start();
		break;
	case SEND_LOGS:
		prefsWrapper.setPreferenceStringValue(SipConfigManager.LOG_LEVEL, "1");
		try {
			startActivityForResult(CollectLogs.getLogReportIntent("<<<PLEASE ADD THE BUG DESCRIPTION HERE>>>", getActivity()), REQUEST_SEND_LOGS);
		}catch(Exception e) {
			Log.e(THIS_FILE, "Impossible to send logs...", e);
		}
		Log.setLogLevel(1);
		break;
	case START_LOGS:
		prefsWrapper.setPreferenceStringValue(SipConfigManager.LOG_LEVEL, "4");
		Log.setLogLevel(4);
		Intent intent = new Intent(SipManager.ACTION_SIP_REQUEST_RESTART);
		getActivity().sendBroadcast(intent);
		dismiss();
		break;
	default:
		break;
	}
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:56,代码来源:Help.java

示例4: onClick

import com.actionbarsherlock.app.SherlockDialogFragment; //导入依赖的package包/类
@Override
public void onClick(View v) {
	String address = recipientAddressEditText.getText().toString();
	double amount = parseAmount();
	long adjustedAmount = 0;
	AmountType type = getAmountType();
	
	if (type == AmountType.AMOUNT_BASED_ON_BTC) {
		adjustedAmount = Math.round(amount * BackendService.BTC_BASE_AMOUNT);
	} else {
		adjustedAmount = Math.round(amount * BackendService.USD_BASE_AMOUNT);
	}
	
	// double check; should not be necessary
	// though, as the button should be disabled then
	if (!isReadyToSendPayment().isReady())
		return;
	
	// always use 0 as request id; we will not track it
	SendPayment sp = new SendPayment(0, address, type, adjustedAmount);
	
	// prepare confirmation text
	String message = "";
	WSQuote quote = null;
	if (lastSuccessfulRequestQuote != null
			&& lastSuccessfulRequestQuote.isSimilarRequest(sp)) {
		quote = lastSuccessfulQuote;
	}
	
	switch (type) {
		case AMOUNT_BASED_ON_BTC:
			if (quote == null)
				message = getString(
						R.string.send_payment_confirmation_text_based_on_btc
						, formatBTC(adjustedAmount), address);
			else
				message = getString(
						R.string.send_payment_confirmation_text_based_on_btc_with_quote
						, formatBTC(adjustedAmount)
						, formatUSD(quote.getUsdRecipient(), Rounding.NO_ROUNDING), address);
			break;
		case AMOUNT_BASED_ON_USD_BEFORE_FEES:
			if (quote == null)
				message = getString(
						R.string.send_payment_confirmation_text_based_on_usd_before_fees
						, formatUSD(adjustedAmount, Rounding.NO_ROUNDING), address);
			else
				message = getString(
						R.string.send_payment_confirmation_text_based_on_usd_before_fees_with_quote
						, formatUSD(adjustedAmount, Rounding.NO_ROUNDING)
						, formatBTC(quote.getBtc()), address);
			break;
		case AMOUNT_BASED_ON_USD_AFTER_FEES:
			if (quote == null)
				message = getString(
						R.string.send_payment_confirmation_text_based_on_usd_after_fees
						, formatUSD(adjustedAmount, Rounding.NO_ROUNDING), address);
			else
				message = getString(
						R.string.send_payment_confirmation_text_based_on_usd_after_fees_with_quote
						, formatUSD(adjustedAmount, Rounding.NO_ROUNDING)
						, formatBTC(quote.getBtc()), address);
			break;
	}
	
	lastSendPayment = sp;
	SherlockDialogFragment dialog = SendConfirmationDialogFragment.newInstance(message);
	dialog.show(getActivity().getSupportFragmentManager(), "sendconfirmation");
}
 
开发者ID:javgh,项目名称:Bridgewalker-Android,代码行数:70,代码来源:SendFragment.java


注:本文中的com.actionbarsherlock.app.SherlockDialogFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。