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


Java MergeAdapter.addView方法代码示例

本文整理汇总了Java中com.commonsware.cwac.merge.MergeAdapter.addView方法的典型用法代码示例。如果您正苦于以下问题:Java MergeAdapter.addView方法的具体用法?Java MergeAdapter.addView怎么用?Java MergeAdapter.addView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.commonsware.cwac.merge.MergeAdapter的用法示例。


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

示例1: appendIBeaconInfo

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
private void appendIBeaconInfo(final MergeAdapter adapter, final IBeaconManufacturerData iBeaconData) {
    final View lt = getLayoutInflater().inflate(R.layout.list_item_view_ibeacon_details, null);
    final TextView tvCompanyId = (TextView) lt.findViewById(R.id.companyId);
    final TextView tvUUID = (TextView) lt.findViewById(R.id.uuid);
    final TextView tvMajor = (TextView) lt.findViewById(R.id.major);
    final TextView tvMinor = (TextView) lt.findViewById(R.id.minor);
    final TextView tvTxPower = (TextView) lt.findViewById(R.id.txpower);

    tvCompanyId.setText(
            CompanyIdentifierResolver.getCompanyName(iBeaconData.getCompanyIdentifier(), "Not Available")
                    + " (" + hexEncode(iBeaconData.getCompanyIdentifier()) + ")");
    tvUUID.setText(iBeaconData.getUUID());
    tvMajor.setText(iBeaconData.getMajor() + " (" + hexEncode(iBeaconData.getMajor()) + ")");
    tvMinor.setText(iBeaconData.getMinor() + " (" + hexEncode(iBeaconData.getMinor()) + ")");
    tvTxPower.setText(iBeaconData.getCalibratedTxPower() + " (" + hexEncode(iBeaconData.getCalibratedTxPower()) + ")");

    adapter.addView(lt);
}
 
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:20,代码来源:DeviceActivity.java

示例2: appendDeviceInfo

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
private void appendDeviceInfo(final MergeAdapter adapter, final BluetoothLeDevice device) {
    final View layout = getLayoutInflater().inflate(R.layout.list_item_view_device_info, null);
    final TextView textViewName = (TextView) layout.findViewById(R.id.deviceName);
    final TextView textViewAddress = (TextView) layout.findViewById(R.id.deviceAddress);

    textViewName.setText(device.getName());
    textViewAddress.setText(device.getAddress());

    adapter.addView(layout);
}
 
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:12,代码来源:DeviceActivity.java

示例3: appendHeader

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
/**
 * Append a header to the MergeAdapter
 *
 * @param adapter {@link MergeAdapter} to be used
 * @param title   String title to be appended
 */
@SuppressLint("InflateParams")
private void appendHeader(final MergeAdapter adapter, final String title) {
    final View layout = getLayoutInflater().inflate(R.layout.list_item_view_header, null);
    final TextView textViewTitle = (TextView) layout.findViewById(R.id.title);
    textViewTitle.setText(title);

    adapter.addView(layout);
}
 
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:15,代码来源:DeviceActivity.java

示例4: appendSimpleText

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
/**
 * Append body text to the MergeAdapter
 *
 * @param adapter {@link MergeAdapter} to be used
 * @param data    String text to be appended
 */
@SuppressLint("InflateParams")
private void appendSimpleText(final MergeAdapter adapter, final String data) {
    final View lt = getLayoutInflater().inflate(R.layout.list_item_view_textview, null);
    final TextView tvData = (TextView) lt.findViewById(R.id.data);

    tvData.setText(data);

    adapter.addView(lt);
}
 
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:16,代码来源:DeviceActivity.java

示例5: appendRssiInfo

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
private void appendRssiInfo(final MergeAdapter adapter, final BluetoothLeDevice device) {
    final View lt = getLayoutInflater().inflate(R.layout.list_item_view_rssi_info, null);
    final TextView tvLastTimestamp = (TextView) lt.findViewById(R.id.lastTimestamp);
    final TextView tvLastRssi = (TextView) lt.findViewById(R.id.lastRssi);

    tvLastTimestamp.setText(formatTime(device.getTimestamp()));
    tvLastRssi.setText(formatRssi(device.getRssi()));

    adapter.addView(lt);
}
 
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:12,代码来源:DeviceActivity.java

示例6: BuildConfigurationOverviewDBEngine

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
BuildConfigurationOverviewDBEngine(@NotNull String buildConfigurationId,
                                   @NotNull Context context,
                                   @NotNull DB db,
                                   @NotNull ViewGroup root) {
    myDB = db;
    myMainAdapter = new MergeAdapter();
    myClickListener = new MyBuildClickListener();

    myFavouriteEngine = new BuildDBEngine(
            buildConfigurationId,
            true,
            context,
            db,
            root,
            myClickListener,
            context.getString(R.string.favourite) + " " + context.getString(R.string.builds)
    );

    myAllEngine = new BuildDBEngine(
            buildConfigurationId,
            false,
            context,
            db,
            root,
            myClickListener,
            context.getString(R.string.builds)
    );

    myMainAdapter.addView(myFavouriteEngine.getHeader());
    myMainAdapter.addAdapter(myFavouriteEngine.getAdapter());

    myMainAdapter.addView(myAllEngine.getHeader());
    myMainAdapter.addAdapter(myAllEngine.getAdapter());

    handleHeaders();

    myDBListener = new MySchemaListener();

    myDB.addBuildsListener(myDBListener);
}
 
开发者ID:sproshev,项目名称:tcity,代码行数:41,代码来源:BuildConfigurationOverviewDBEngine.java

示例7: updateListView

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
/**
 * Updates the listview by creating a new merge adapater, and then adds the individual list adapters that are needed.
 */
private void updateListView()
{
	MergeAdapter mergeAdapter = new MergeAdapter();

	OKScore topScore;
	OKScoresListAdapter scoresAdapater;

	switch (currentLeaderboard.getDisplayedTimeRange()) {
	case AllTime:
		topScore = topScoreAllTime;
		scoresAdapater = allTimeScoresAdapter;
		break;
	case OneDay:
		topScore = topScoreToday;
		scoresAdapater = todayScoresAdapter;
		break;
	default:
		topScore = topScoreThisWeek;
		scoresAdapater = thisWeekScoresAdapater;
		break;
	}

	if(topScore != null)
	{
		mergeAdapter.addView(getHeaderView("Your High Score"));
		List<OKScore> list = new ArrayList<OKScore>();
		list.add(topScore);
		mergeAdapter.addAdapter(new OKScoresListAdapter(this.getActivity(), android.R.layout.simple_list_item_1, list));
	}

	if(scoresAdapater != null)
	{
		mergeAdapter.addView(getHeaderView(currentLeaderboard.getPlayerCountString() + " Players"));
		mergeAdapter.addAdapter(scoresAdapater);
		mergeAdapter.addView(moreScoresButton);
	}

	this.setListAdapter(mergeAdapter);
}
 
开发者ID:Gameeso,项目名称:openkit-android,代码行数:43,代码来源:OKScoresFragment.java

示例8: ProjectOverviewDBEngine

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
ProjectOverviewDBEngine(@NotNull String projectId,
                        @NotNull Context context,
                        @NotNull DB db,
                        @NotNull ViewGroup root) {
    myDB = db;
    myMainAdapter = new MergeAdapter();
    myProjectClickListener = new MyProjectClickListener();
    myBuildConfigurationClickListener = new MyBuildConfigurationClickListener();

    myFavouriteBuildConfigurationsEngine = new BuildConfigurationDBEngine(
            projectId,
            true,
            context,
            db,
            root,
            myBuildConfigurationClickListener,
            context.getString(R.string.favourite) + " " + context.getString(R.string.build_configurations)
    );

    myAllBuildConfigurationsEngine = new BuildConfigurationDBEngine(
            projectId,
            false,
            context,
            db,
            root,
            myBuildConfigurationClickListener,
            context.getString(R.string.build_configurations)
    );

    String projectSectionName = calculateProjectSectionName(projectId, context);

    myFavouriteProjectsEngine = new ProjectDBEngine(
            projectId,
            true,
            context,
            db,
            root,
            myProjectClickListener,
            context.getString(R.string.favourite) + " " + projectSectionName
    );

    myAllProjectsEngine = new ProjectDBEngine(
            projectId,
            false,
            context,
            db,
            root,
            myProjectClickListener,
            projectSectionName
    );

    myMainAdapter.addView(myFavouriteBuildConfigurationsEngine.getHeader());
    myMainAdapter.addAdapter(myFavouriteBuildConfigurationsEngine.getAdapter());

    myMainAdapter.addView(myFavouriteProjectsEngine.getHeader());
    myMainAdapter.addAdapter(myFavouriteProjectsEngine.getAdapter());

    myMainAdapter.addView(myAllProjectsEngine.getHeader());
    myMainAdapter.addAdapter(myAllProjectsEngine.getAdapter());

    myMainAdapter.addView(myAllBuildConfigurationsEngine.getHeader());
    myMainAdapter.addAdapter(myAllBuildConfigurationsEngine.getAdapter());

    handleHeader(myFavouriteBuildConfigurationsEngine);
    handleHeader(myFavouriteProjectsEngine);
    handleHeader(myAllProjectsEngine);
    handleHeader(myAllBuildConfigurationsEngine);

    myBuildConfigurationsListener = new BuildConfigurationsListener();
    myProjectsListener = new ProjectsListener();

    myDB.addProjectsListener(myProjectsListener);
    myDB.addBuildConfigurationsListener(myBuildConfigurationsListener);
}
 
开发者ID:sproshev,项目名称:tcity,代码行数:75,代码来源:ProjectOverviewDBEngine.java

示例9: updateListView

import com.commonsware.cwac.merge.MergeAdapter; //导入方法依赖的package包/类
private void updateListView()
{
	if(this.getActivity() == null)
		return;

	MergeAdapter mergeAdapter = new MergeAdapter();

	mergeAdapter.addView(getHeaderView("Friends"));

	if(friendsScoresListAdapter != null && friendsScoresListAdapter.getCount() > 0) {
		mergeAdapter.addAdapter(friendsScoresListAdapter);
	}

	if (isShowingSocialScoresProgressBar()) {
		mergeAdapter.addView(getSpinnerRow());
	}

	if (!FacebookUtilities.isFBSessionOpen()) {
		mergeAdapter.addView(getFBLoginRow());
	} else if(FacebookUtilities.isFBSessionOpen() && friendsScoresListAdapter != null && friendsScoresListAdapter.getCount() <= 1 && !isShowingSocialScoresProgressBar()) {
		// Show invite friends
		mergeAdapter.addView(getFBInviteRow());
	}

	mergeAdapter.addView(getHeaderView("All Players"));

	if(scoresListAdapter != null && scoresListAdapter.getCount() > 0) {
		mergeAdapter.addAdapter(scoresListAdapter);
		//mergeAdapter.addView(moreScoresButton);
	}

	// Show the top score if the rank of the top score == 0 || rank < numTopScores shown
	if(topScoreAdapter != null && scoresListAdapter != null) {
		int playerRank = topScoreAdapter.getItem(0).getRank();

		if(playerRank == 0 || playerRank > scoresListAdapter.getCount()) {
			mergeAdapter.addAdapter(topScoreAdapter);
		}
	}

	if(scoresListAdapter != null && scoresListAdapter.getCount() > 0) {
		mergeAdapter.addView(moreScoresButton);
	}

	this.setListAdapter(mergeAdapter);

	showPromptForFBIfNecessary();
}
 
开发者ID:Gameeso,项目名称:openkit-android,代码行数:49,代码来源:OKSocialLeaderboardFragment.java


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