本文整理了Java中android.support.v7.app.AppCompatActivity.getLayoutInflater()
方法的一些代码示例,展示了AppCompatActivity.getLayoutInflater()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AppCompatActivity.getLayoutInflater()
方法的具体详情如下:
包路径:android.support.v7.app.AppCompatActivity
类名称:AppCompatActivity
方法名:getLayoutInflater
暂无
代码示例来源:origin: TeamNewPipe/NewPipe
protected View getListFooter() {
return activity.getLayoutInflater().inflate(R.layout.pignate_footer, itemsList, false);
}
代码示例来源:origin: TeamNewPipe/NewPipe
protected View getListFooter() {
return activity.getLayoutInflater().inflate(R.layout.pignate_footer, itemsList, false);
}
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
protected View getListHeader() {
final View headerRootLayout = activity.getLayoutInflater().inflate(R.layout.statistic_playlist_control,
itemsList, false);
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
sortButton = headerRootLayout.findViewById(R.id.sortButton);
sortButtonIcon = headerRootLayout.findViewById(R.id.sortButtonIcon);
sortButtonText = headerRootLayout.findViewById(R.id.sortButtonText);
return headerRootLayout;
}
代码示例来源:origin: TeamNewPipe/NewPipe
protected View getListHeader() {
headerRootLayout = activity.getLayoutInflater().inflate(R.layout.channel_header, itemsList, false);
headerChannelBanner = headerRootLayout.findViewById(R.id.channel_banner_image);
headerAvatarView = headerRootLayout.findViewById(R.id.channel_avatar_view);
headerTitleView = headerRootLayout.findViewById(R.id.channel_title_view);
headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view);
headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button);
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
return headerRootLayout;
}
代码示例来源:origin: TeamNewPipe/NewPipe
protected View getListHeader() {
headerRootLayout = activity.getLayoutInflater().inflate(R.layout.playlist_header, itemsList, false);
headerTitleView = headerRootLayout.findViewById(R.id.playlist_title_view);
headerUploaderLayout = headerRootLayout.findViewById(R.id.uploader_layout);
headerUploaderName = headerRootLayout.findViewById(R.id.uploader_name);
headerUploaderAvatar = headerRootLayout.findViewById(R.id.uploader_avatar_view);
headerStreamCount = headerRootLayout.findViewById(R.id.playlist_stream_count);
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
return headerRootLayout;
}
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
protected View getListHeader() {
headerRootLayout = activity.getLayoutInflater().inflate(R.layout.local_playlist_header,
itemsList, false);
headerTitleView = headerRootLayout.findViewById(R.id.playlist_title_view);
headerTitleView.setSelected(true);
headerStreamCount = headerRootLayout.findViewById(R.id.playlist_stream_count);
playlistControl = headerRootLayout.findViewById(R.id.playlist_control);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
return headerRootLayout;
}
代码示例来源:origin: Yalantis/Side-Menu.Android
double size = list.size();
for (int i = 0; i < size; i++) {
View viewMenu = appCompatActivity.getLayoutInflater().inflate(R.layout.menu_list_item, null);
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
protected void initViews(View rootView, Bundle savedInstanceState) {
super.initViews(rootView, savedInstanceState);
final boolean useGrid = isGridLayout();
infoListAdapter = new InfoListAdapter(getActivity());
itemsList = rootView.findViewById(R.id.items_list);
itemsList.setLayoutManager(useGrid ? getGridLayoutManager() : getListLayoutManager());
View headerRootLayout;
infoListAdapter.setHeader(headerRootLayout = activity.getLayoutInflater().inflate(R.layout.subscription_header, itemsList, false));
whatsNewItemListHeader = headerRootLayout.findViewById(R.id.whats_new);
importExportListHeader = headerRootLayout.findViewById(R.id.import_export);
importExportOptions = headerRootLayout.findViewById(R.id.import_export_options);
infoListAdapter.useMiniItemVariants(true);
infoListAdapter.setGridItemVariants(useGrid);
itemsList.setAdapter(infoListAdapter);
setupImportFromItems(headerRootLayout.findViewById(R.id.import_from_options));
setupExportToItems(headerRootLayout.findViewById(R.id.export_to_options));
if (importExportOptionsState != null) {
importExportOptions.onRestoreInstanceState(importExportOptionsState);
importExportOptionsState = null;
}
importExportOptions.addListener(getExpandIconSyncListener(headerRootLayout.findViewById(R.id.import_export_expand_icon)));
importExportOptions.ready();
}
代码示例来源:origin: konradrenner/kolabnotes-android
@Override
public void onClick(View v) {
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_seekbar_draweditor, null);
AlertDialog dialog = brushSizeDialog(view);
dialog.show();
}
});
代码示例来源:origin: konradrenner/kolabnotes-android
@Override
public void onClick(View v) {
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_text_input, null);
AlertDialog newTagDialog = createTagDialog(view, new CreateTagButtonListener((EditText)view.findViewById(R.id.dialog_text_input_field)));
newTagDialog.show();
}
}
代码示例来源:origin: zeleven/mua
/**
* statistics dialog
*/
public void statistics() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(R.string.dialog_title_statistics);
LayoutInflater inflater = ((AppCompatActivity) context).getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_statistics, null);
TextView textLengthTV = view.findViewById(R.id.text_length);
textLengthTV.setText(editText.getText().length() + "");
builder.setView(view);
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
}
代码示例来源:origin: konradrenner/kolabnotes-android
private AlertDialog createNotebookDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.dialog_input_text_notebook);
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_text_input, null);
builder.setView(view);
builder.setPositiveButton(R.string.ok, new CreateNotebookButtonListener((EditText) view.findViewById(R.id.dialog_text_input_field)));
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//nothing at the moment
}
});
return builder.create();
}
代码示例来源:origin: konradrenner/kolabnotes-android
@Override
public void onClick(View v) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.dialog_input_link);
LayoutInflater inflater = activity.getLayoutInflater();
final View view = inflater.inflate(R.layout.dialog_link_input, null);
builder.setView(view);
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
TextView text = (TextView) view.findViewById(R.id.dialog_text_input_field);
CharSequence input = text.getText();
if (input == null || input.toString().trim().length() == 0) {
Toast.makeText(activity, R.string.error_field_required, Toast.LENGTH_SHORT).show();
} else {
editor.insertLink(input.toString(), input.toString());
}
}
});
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//nothing
}
});
builder.show();
}
});
代码示例来源:origin: zeleven/mua
inputDialog.setTitle(R.string.dialog_title_insert_image);
LayoutInflater inflater = context.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_insert_image, null);
final EditText imageDisplayText = view.findViewById(R.id.image_display_text);
代码示例来源:origin: anitaa1990/TrailersApp
public void displayMenuContent() {
setViewsClickable(false);
viewList.clear();
double size = slideMenuItems.size();
for (int i = 0; i < size; i++) {
final View viewMenu = appCompatActivity.getLayoutInflater().inflate(R.layout.list_item_menu, null);
updateMenuItemImageView(i, viewMenu);
updateMenuItemContainerView(i, viewMenu);
viewList.add(viewMenu);
animatorListener.addViewToContainer(viewMenu);
if(i == selectedPosition) {
viewList.get(i).setSelected(true);
}
animateMenuItem((double)i, size);
}
}
代码示例来源:origin: konradrenner/kolabnotes-android
void showMetainformation(){
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.title_metainformation);
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_metainformation, null);
builder.setView(view);
builder.setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//just close dialog
}
});
final DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.DEFAULT);
final Timestamp now = new Timestamp(System.currentTimeMillis());
final String productID = note == null ? "kolabnotes-android" : note.getIdentification().getProductId();
final String uid = note == null ? "" : note.getIdentification().getUid();
final Timestamp createdAt = note == null ? now : note.getAuditInformation().getCreationDate();
final Timestamp modification = note == null ? now : note.getAuditInformation().getLastModificationDate();
((TextView) view.findViewById(R.id.createdDate)).setText(dateFormat.format(createdAt));
((TextView) view.findViewById(R.id.modificationDate)).setText(dateFormat.format(modification));
((TextView) view.findViewById(R.id.productID)).setText(productID);
((TextView) view.findViewById(R.id.UID)).setText(uid);
builder.show();
}
代码示例来源:origin: zeleven/mua
AlertDialog.Builder linkDialog = new AlertDialog.Builder(context);
linkDialog.setTitle(R.string.dialog_title_insert_link);
LayoutInflater inflater = ((AppCompatActivity) context).getLayoutInflater();
final View view = inflater.inflate(R.layout.dialog_insert_link, null);
final EditText linkDisplayTextET = view.findViewById(R.id.link_display_text);
代码示例来源:origin: konradrenner/kolabnotes-android
void editClassification(){
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.dialog_change_classification);
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_classification, null);
builder.setView(view);
builder.setPositiveButton(R.string.ok, new OnClassificationChange(view));
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//nothing
}
});
if(selectedClassification == null){
((RadioButton) view.findViewById(R.id.radio_public)).toggle();
}else {
switch (selectedClassification) {
case PUBLIC:
((RadioButton) view.findViewById(R.id.radio_public)).toggle();
break;
case CONFIDENTIAL:
((RadioButton) view.findViewById(R.id.radio_confidential)).toggle();
break;
case PRIVATE:
((RadioButton) view.findViewById(R.id.radio_private)).toggle();
break;
}
}
builder.show();
}
代码示例来源:origin: zeleven/mua
blockCodeDialog.setTitle(R.string.editor_dialog_title_insert_block_code);
LayoutInflater inflater = ((AppCompatActivity) context).getLayoutInflater();
final View view = inflater.inflate(R.layout.dialog_insert_code, null);
blockCodeDialog.setView(view);
代码示例来源:origin: konradrenner/kolabnotes-android
@Override
public void onItemClicked(int position, Tag tag) {
if (mActionMode == null) {
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_text_input, null);
AlertDialog newTagDialog = updateTagDialog(view, new UpdateTagButtonListener(
(EditText) view.findViewById(R.id.dialog_text_input_field), tag.getIdentification().getUid()));
newTagDialog.show();
} else {
toggleSelection(position);
mSelectedTags.put(position, tag.getIdentification().getUid());
}
}
内容来源于网络,如有侵权,请联系作者删除!