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


Java ResourceCursorAdapter类代码示例

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


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

示例1: SpinnerHelper

import android.support.v4.widget.ResourceCursorAdapter; //导入依赖的package包/类
public SpinnerHelper(Spinner spinner, int loaderID, ResourceCursorAdapter adapter, @LayoutRes int dropDownLayout, OnItemSelectedListener onSelected) {
    Spinner = spinner;
    mLoaderID = loaderID;
    Spinner.setOnItemSelectedListener(onSelected);
    Spinner.setAdapter(adapter);
    adapter.setDropDownViewResource(dropDownLayout);

}
 
开发者ID:SelvinPL,项目名称:SyncFrameworkAndroid,代码行数:9,代码来源:SpinnerHelper.java

示例2: onActivityCreated

import android.support.v4.widget.ResourceCursorAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(final Bundle savedInstanceState)
{
	super.onActivityCreated(savedInstanceState);

	setEmptyText(getString(R.string.exchange_rates_fragment_empty_text));

	adapter = new ResourceCursorAdapter(activity, R.layout.exchange_rate_row, null, true)
	{
		@Override
		public void bindView(final View view, final Context context, final Cursor cursor)
		{
			final ExchangeRate exchangeRate = ExchangeRatesProvider.getExchangeRate(cursor);
			final boolean isDefaultCurrency = exchangeRate.currencyCode.equals(defaultCurrency);

			view.setBackgroundResource(isDefaultCurrency ? R.color.bg_less_bright : R.color.bg_bright);

			final View defaultView = view.findViewById(R.id.exchange_rate_row_default);
			defaultView.setVisibility(isDefaultCurrency ? View.VISIBLE : View.INVISIBLE);

			final TextView currencyCodeView = (TextView) view.findViewById(R.id.exchange_rate_row_currency_code);
			currencyCodeView.setText(exchangeRate.currencyCode);

			final CurrencyTextView rateView = (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_rate);
			rateView.setPrecision(Constants.LOCAL_PRECISION);
			rateView.setAmount(WalletUtils.localValue(Utils.COIN, exchangeRate.rate));

			final CurrencyTextView walletView = (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_balance);
			walletView.setPrecision(Constants.LOCAL_PRECISION);
			walletView.setAmount(WalletUtils.localValue(balance, exchangeRate.rate));
			walletView.setStrikeThru(Constants.TEST);
			walletView.setTextColor(getResources().getColor(R.color.fg_less_significant));
		}
	};
	setListAdapter(adapter);

	loaderManager.initLoader(0, null, this);
}
 
开发者ID:goldcoin,项目名称:goldcoin-android,代码行数:39,代码来源:ExchangeRatesFragment.java


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