本文整理汇总了Java中com.commonsware.cwac.merge.MergeAdapter类的典型用法代码示例。如果您正苦于以下问题:Java MergeAdapter类的具体用法?Java MergeAdapter怎么用?Java MergeAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MergeAdapter类属于com.commonsware.cwac.merge包,在下文中一共展示了MergeAdapter类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.commonsware.cwac.merge.MergeAdapter; //导入依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAdapter = new MergeAdapter();
if (Utils.hasCamera(getActivity())) {
mAdapter.addAdapter(new CameraBaseAdapter(getActivity()));
}
mPhotoAdapter = new UsersPhotosCursorAdapter(getActivity(), null);
mAdapter.addAdapter(mPhotoAdapter);
mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
mBucketAdapter = new ArrayAdapter<MediaStoreBucket>(getActivity(),
Utils.getSpinnerItemResId(), mBuckets);
mBucketAdapter
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
}
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:20,代码来源:UserPhotosFragment.java
示例2: 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
示例3: populateDetails
import com.commonsware.cwac.merge.MergeAdapter; //导入依赖的package包/类
private void populateDetails(final ListView listView, final BluetoothLeDevice device) {
final MergeAdapter adapter = new MergeAdapter();
if (device == null) {
appendHeader(adapter, "Device Info");
appendSimpleText(adapter, "Invalid Device");
} else {
appendHeader(adapter, "Device Info");
appendDeviceInfo(adapter, device);
if (BeaconUtils.getBeaconType(device) == BeaconType.IBEACON) {
final IBeaconManufacturerData iBeaconData = new IBeaconManufacturerData(device);
appendHeader(adapter, "iBeacon Data");
appendIBeaconInfo(adapter, iBeaconData);
}
appendHeader(adapter, "RSSI Info");
appendRssiInfo(adapter, device);
}
listView.setAdapter(adapter);
}
开发者ID:MikeFot,项目名称:Android--Beacon-Scanner-Service,代码行数:24,代码来源:DeviceActivity.java
示例4: 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
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: iconload
import com.commonsware.cwac.merge.MergeAdapter; //导入依赖的package包/类
public void iconload() {
String[] foldernames = new String[directoryNames.size()];
foldernames = directoryNames.toArray(foldernames);
String[] filenames = new String[fileNames.size()];
filenames = fileNames.toArray(filenames);
MergeAdapter adap = new MergeAdapter();
CustomListSingleOnly adapter1 = new CustomListSingleOnly(FileSelectionActivity.this, directoryNames.toArray(foldernames), mainPath.getPath());
CustomList adapter2 = new CustomList(FileSelectionActivity.this, fileNames.toArray(filenames), mainPath.getPath());
adap.addAdapter(adapter1);
adap.addAdapter(adapter2);
directoryView.setAdapter(adap);
}
开发者ID:w0pw0p,项目名称:MaterialFilePicker,代码行数:19,代码来源:FileSelectionActivity.java
示例11: iconload
import com.commonsware.cwac.merge.MergeAdapter; //导入依赖的package包/类
public void iconload(){
String[] foldernames = new String[directoryNames.size()];
foldernames = directoryNames.toArray(foldernames);
String[] filenames = new String[fileNames.size()];
filenames = fileNames.toArray(filenames);
CustomListSingleOnly adapter1 = new CustomListSingleOnly(FolderSelectionActivity.this, directoryNames.toArray(foldernames), mainPath.getPath());
CustomListSingleOnly adapter2 = new CustomListSingleOnly(FolderSelectionActivity.this, fileNames.toArray(filenames), mainPath.getPath());
MergeAdapter adap = new MergeAdapter();
adap.addAdapter(adapter1);
adap.addAdapter(adapter2);
directoryView.setAdapter(adap);
}
开发者ID:paulasiimwe,项目名称:Android-Multiple-file-Selector-Dialog,代码行数:20,代码来源:FolderSelectionActivity.java
示例12: onCreateOptionsMenu
import com.commonsware.cwac.merge.MergeAdapter; //导入依赖的package包/类
/**@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_file_selection, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}**/
public void iconload(){
String[] foldernames = new String[directoryNames.size()];
foldernames = directoryNames.toArray(foldernames);
String[] filenames = new String[fileNames.size()];
filenames = fileNames.toArray(filenames);
CustomListSingleOnly adapter1 = new CustomListSingleOnly(FileSelectionActivity.this, directoryNames.toArray(foldernames), mainPath.getPath());
CustomList adapter2 = new CustomList(FileSelectionActivity.this, fileNames.toArray(filenames), mainPath.getPath());
MergeAdapter adap = new MergeAdapter();
adap.addAdapter(adapter1);
adap.addAdapter(adapter2);
directoryView.setAdapter(adap);
}
开发者ID:paulasiimwe,项目名称:Android-Multiple-file-Selector-Dialog,代码行数:36,代码来源:FileSelectionActivity.java
示例13: 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
示例14: 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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论