Search in sources :

Example 11 with LayoutInflater

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;
}
Also used : Context(android.content.Context) LayoutInflater(android.view.LayoutInflater) LinearLayout(android.widget.LinearLayout)

Example 12 with LayoutInflater

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();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 13 with LayoutInflater

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();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 14 with LayoutInflater

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);
}
Also used : LayoutInflater(android.view.LayoutInflater)

Example 15 with LayoutInflater

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();
                }
            }
        });
}
Also used : LayoutInflater(android.view.LayoutInflater) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

LayoutInflater (android.view.LayoutInflater)1227 View (android.view.View)743 TextView (android.widget.TextView)570 ImageView (android.widget.ImageView)242 ViewGroup (android.view.ViewGroup)127 Context (android.content.Context)123 ListView (android.widget.ListView)115 LinearLayout (android.widget.LinearLayout)102 AdapterView (android.widget.AdapterView)94 RecyclerView (android.support.v7.widget.RecyclerView)87 Intent (android.content.Intent)81 DialogInterface (android.content.DialogInterface)74 AlertDialog (android.app.AlertDialog)71 FrameLayout (android.widget.FrameLayout)48 TypedArray (android.content.res.TypedArray)43 OnClickListener (android.view.View.OnClickListener)40 Button (android.widget.Button)40 Bundle (android.os.Bundle)39 Activity (android.app.Activity)38 AlertDialog (android.support.v7.app.AlertDialog)37