use of android.view.LayoutInflater in project cw-omnibus by commonsguy.
the class MenuItemImpl method setActionView.
public MenuItem setActionView(int resId) {
final Context context = mMenu.getContext();
final LayoutInflater inflater = LayoutInflater.from(context);
setActionView(inflater.inflate(resId, new LinearLayout(context), false));
return this;
}
use of android.view.LayoutInflater in project UltimateAndroid by cymcsg.
the class DownloadDialogShower method showDownloadDialog.
private void showDownloadDialog() {
builder = new AlertDialog.Builder(mContext);
final LayoutInflater inflater = LayoutInflater.from(mContext);
View v = inflater.inflate(R.layout.progress_update, null);
mProgress = (ProgressBar) v.findViewById(R.id.progress);
updatePercentTextView = (TextView) v.findViewById(R.id.updatePercentTextView);
updateCurrentTextView = (TextView) v.findViewById(R.id.updateCurrentTextView);
updateCurrentTextView.setText(prepareDownloadingTextViewString);
updateTotalTextView = (TextView) v.findViewById(R.id.updateTotalTextView);
// builder.setCustomTitle(inflater.inflate(R.layout.progress_update_title, null));
builder.setTitle(downloadTitle);
builder.setView(v);
builder.setNegativeButton(downloadCancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
interceptFlag = true;
}
});
progressDialog = builder.create();
progressDialog.show();
}
use of android.view.LayoutInflater in project UltimateAndroid by cymcsg.
the class DownloadDialogShower method showDownloadDialog.
private void showDownloadDialog() {
builder = new AlertDialog.Builder(mContext);
final LayoutInflater inflater = LayoutInflater.from(mContext);
View v = inflater.inflate(R.layout.progress_update, null);
mProgress = (ProgressBar) v.findViewById(R.id.progress);
updatePercentTextView = (TextView) v.findViewById(R.id.updatePercentTextView);
updateCurrentTextView = (TextView) v.findViewById(R.id.updateCurrentTextView);
updateCurrentTextView.setText(prepareDownloadingTextViewString);
updateTotalTextView = (TextView) v.findViewById(R.id.updateTotalTextView);
// builder.setCustomTitle(inflater.inflate(R.layout.progress_update_title, null));
builder.setTitle(downloadTitle);
builder.setView(v);
builder.setNegativeButton(downloadCancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
interceptFlag = true;
}
});
progressDialog = builder.create();
progressDialog.show();
}
use of android.view.LayoutInflater in project SimplifyReader by chentao0707.
the class PluginSimplePlayer method initLoadInfoPage.
/**
* 初始化加载页面
*/
private void initLoadInfoPage() {
if (null == mActivity)
return;
LayoutInflater mLayoutInflater = LayoutInflater.from(mActivity);
if (null == mLayoutInflater)
return;
loadingInfoLayout = (RelativeLayout) mLayoutInflater.inflate(R.layout.yp_detail_loading_info_page, null);
if (null == loadingInfoLayout)
return;
infoSeekBar = (SeekBar) loadingInfoLayout.findViewById(R.id.loading_info_seekbar);
}
use of android.view.LayoutInflater in project SimplifyReader by chentao0707.
the class PluginSimplePlayer method initEndPage.
/**
* 初始化播放完成的显示
*/
private void initEndPage() {
if (null == mActivity)
return;
LayoutInflater mLayoutInflater = LayoutInflater.from(mActivity);
if (null == mLayoutInflater)
return;
endPageView = mLayoutInflater.inflate(R.layout.yp_detail_play_end_page, null);
if (null == endPageView)
return;
nextLayout = (LinearLayout) endPageView.findViewById(R.id.ll_next_play);
replayLayout = (LinearLayout) endPageView.findViewById(R.id.ll_replay);
if (null != nextLayout)
nextLayout.setOnClickListener(new // 播放下一集
OnClickListener() {
@Override
public void onClick(View v) {
if (!Util.hasInternet())
return;
playNextVideo();
hideEndPage();
restartFromComplete();
}
});
if (null != replayLayout)
replayLayout.setOnClickListener(new // 重播
OnClickListener() {
@Override
public void onClick(View v) {
if (null != mMediaPlayerDelegate) {
mMediaPlayerDelegate.release();
mMediaPlayerDelegate.setFirstUnloaded();
onVideoInfoGetted();
mMediaPlayerDelegate.start();
if (null != mMediaPlayerDelegate.videoInfo)
mMediaPlayerDelegate.videoInfo.setProgress(0);
mMediaPlayerDelegate.seekTo(0);
hideEndPage();
restartFromComplete();
}
}
});
}
Aggregations