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


Java Dialog.findViewById方法代码示例

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


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

示例1: onPreExecute

import android.app.Dialog; //导入方法依赖的package包/类
@Override
protected void onPreExecute() {
    isFinalizing = true;
    recordFinish = true;
    runAudioThread = false;

    //创建处理进度条
    creatingProgress = new Dialog(FFmpegRecorderActivity.this, R.style.Dialog_loading_noDim);
    Window dialogWindow = creatingProgress.getWindow();
    WindowManager.LayoutParams lp = dialogWindow.getAttributes();
    lp.width = (int) (getResources().getDisplayMetrics().density * 240);
    lp.height = (int) (getResources().getDisplayMetrics().density * 80);
    lp.gravity = Gravity.CENTER;
    dialogWindow.setAttributes(lp);
    creatingProgress.setCanceledOnTouchOutside(false);
    creatingProgress.setContentView(R.layout.activity_recorder_progress);

    progress = (TextView) creatingProgress.findViewById(R.id.recorder_progress_progresstext);
    bar = (ProgressBar) creatingProgress.findViewById(R.id.recorder_progress_progressbar);
    creatingProgress.show();


    //txtTimer.setVisibility(View.INVISIBLE);
    //handler.removeCallbacks(mUpdateTimeTask);
    super.onPreExecute();
}
 
开发者ID:feigxj,项目名称:VideoRecorder-master,代码行数:27,代码来源:FFmpegRecorderActivity.java

示例2: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final BitmapDrawable bitmap = new BitmapDrawable(getResources(), (Bitmap) args.getParcelable(KEY_BITMAP));
    bitmap.setFilterBitmap(false);

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.bitmap_dialog);
    dialog.setCanceledOnTouchOutside(true);

    final ImageView imageView = (ImageView) dialog.findViewById(R.id.bitmap_dialog_image);
    imageView.setImageDrawable(bitmap);
    imageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View v) {
            dismiss();
        }
    });

    return dialog;
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:23,代码来源:BitmapFragment.java

示例3: createDialog

import android.app.Dialog; //导入方法依赖的package包/类
public void createDialog() {
    motherboardActivityDialog = new Dialog(this);
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View layout =  inflater.inflate(R.layout.motherboard_filter_dialogue,(ViewGroup) findViewById(R.id.motherboardFilterDialogRootElement));
    motherboardActivityDialog.setContentView(layout);

    closeBtn = (ImageView)motherboardActivityDialog.findViewById(R.id.motherboardcloseButton);

    closeBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            motherboardActivityDialog.dismiss();
        }
    });

}
 
开发者ID:asdiamond,项目名称:CodeMineProject1,代码行数:17,代码来源:MotherboardActivity.java

示例4: createEditPwdDialog

import android.app.Dialog; //导入方法依赖的package包/类
public static EditPwdDialog createEditPwdDialog(Context context, String textLeft, String textRight, String title, View.OnClickListener left, View.OnClickListener right) {
    EditPwdDialog dialogProxy = EditPwdDialog.getInstance();
    if (dialogProxy.hasDialog()) {
        return dialogProxy;
    }
    Dialog dialog = setEditPwdDialogContentView(context);
    TextView tvMsg = (TextView) dialog.findViewById(R.id.title);
    TextView btnLeft = (TextView) dialog.findViewById(R.id.left);
    TextView btnRight = (TextView) dialog.findViewById(R.id.right);
    tvMsg.setText(title);
    btnLeft.setText(textLeft);
    btnRight.setText(textRight);
    btnLeft.setOnClickListener(left);
    btnRight.setOnClickListener(right);
    dialogProxy.setDialog(dialog);
    return dialogProxy;
}
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:18,代码来源:DialogCreater.java

示例5: onViewClicked

import android.app.Dialog; //导入方法依赖的package包/类
@OnClick(R.id.activity_write_position_keep)
public void onViewClicked() {
    progressDialog = new Dialog(WritePositionActivity.this,R.style.progress_dialog);
    progressDialog.setContentView(R.layout.dialog);
    progressDialog.setCancelable(true);
    progressDialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
    TextView msg = (TextView) progressDialog.findViewById(R.id.id_tv_loadingmsg);
    msg.setText("卖力上传中");
    progressDialog.show();
    StringBuilder builder = new StringBuilder();
    StringBuilder builders = new StringBuilder();

    String sqlresult;
     name="'"+activityWritePositionName.getText().toString().trim()+"'";
    number="'"+activityWritePositionNumber.getText().toString().trim()+"'";
    pos="'"+activityWritePositionPos.getText().toString().trim()+"'";
    if (isChecked){
        builder.append("INSERT into position value(").append(username).append(",").append(name).append(",").append(number).append(",").append(pos)
                .append(") ON DUPLICATE KEY UPDATE").append(" name=").append(name).append(",number=").append(number).append(",positions=")
                .append(pos).append(";");
        builders.append("INSERT into positions value(").append("null,").append(username).append(",").append(name).append(",").append(number).append(",").append(pos).append(");");

        sqlresult=String.valueOf(builder);
        String sqlresults=String.valueOf(builders);

        Log.i("builder",sqlresult);
        Log.i("builder",sqlresults);

        send(sqlresult,sqlresults);
    }else{
        builders.append("INSERT into positions value(").append("null,").append(username).append(",").append(name).append(",").append(number).append(",").append(pos).append(");");
        sqlresult=String.valueOf(builders);
        Log.i("builder",sqlresult);
        send(sqlresult);

    }

}
 
开发者ID:Shmilyz,项目名称:Swap,代码行数:39,代码来源:WritePositionActivity.java

示例6: doCaptureKey

import android.app.Dialog; //导入方法依赖的package包/类
public Dialog doCaptureKey(){
	
	final Dialog d = new Dialog(_gamePadActivity);
	d.setContentView(R.layout.prefs_capture_key);
	d.setCanceledOnTouchOutside(true);
	d.setOnKeyListener(new Dialog.OnKeyListener() {
           @Override
           public boolean onKey(DialogInterface arg0, int keyCode,
                   KeyEvent event) {
           	_setActionKey(keyCode);
           	d.dismiss();
               return true;
           }
       });
	
	Button b = (Button)d.findViewById(R.id.buttonResetToDefault);
	b.setOnClickListener(new Button.OnClickListener(){
		@Override
		public void onClick(View v) {
			switch(_captureKey){
			case PICK_UP: _setActionKey(KeyEvent.KEYCODE_BUTTON_Y); break;
			case JUMP: _setActionKey(KeyEvent.KEYCODE_BUTTON_A); break;
			case PUNCH: _setActionKey(KeyEvent.KEYCODE_BUTTON_X); break;
			case BOMB: _setActionKey(KeyEvent.KEYCODE_BUTTON_B); break;
			case RUN1: _setActionKey(KeyEvent.KEYCODE_BUTTON_L1); break;
			case RUN2: _setActionKey(KeyEvent.KEYCODE_BUTTON_R1); break;
			case START: _setActionKey(KeyEvent.KEYCODE_BUTTON_START); break;
			default:
				LogThread.log("Error: unrecognized key in doActionKey",null);
				break;
			}
			d.dismiss();
		}});

	d.setTitle(R.string.capturing);
	d.show();
	return d;
}
 
开发者ID:efroemling,项目名称:bombsquad-remote-android,代码行数:39,代码来源:GamePadActivity.java

示例7: AddDoctor

import android.app.Dialog; //导入方法依赖的package包/类
public void AddDoctor(View view) {
    final Dialog dialog = new Dialog(DoctorActivity.this);
    dialog.setTitle("Add Doctor");
    dialog.setContentView(R.layout.doctor_dialog);


    Button button = (Button) dialog.findViewById(R.id.add_doctor);
    button.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            //edit text
            EditText name =(EditText)dialog.findViewById(R.id.name);
            EditText surname =(EditText)dialog.findViewById(R.id.surname);
            EditText address =(EditText)dialog.findViewById(R.id.address);
            EditText phone =(EditText)dialog.findViewById(R.id.phone);

            //get text
            String task = name.getText().toString();
            String task2 = surname.getText().toString();
            String task3 = address.getText().toString();
            String task4 = phone.getText().toString();

            SQLiteDatabase db = mHelper.getWritableDatabase();
            ContentValues values = new ContentValues();
            values.put(DoctorContract.TaskEntry.DOCTOR_NAME, task);
            db.insertWithOnConflict(DoctorContract.TaskEntry.TABLE,
                    null,
                    values,
                    SQLiteDatabase.CONFLICT_REPLACE);
            db.close();

            //refresh listview
            updateUI();

            dialog.dismiss();

        }
    });

    dialog.show();
}
 
开发者ID:Francescopaolo44,项目名称:MedicalMe,代码行数:41,代码来源:DoctorActivity.java

示例8: setUpRadioButton

import android.app.Dialog; //导入方法依赖的package包/类
public static void setUpRadioButton(Dialog dialog, @IdRes int checkBoxId, final IChartModifier modifier) {
    final RadioButton radioButton = (RadioButton) dialog.findViewById(checkBoxId);
    radioButton.setChecked(modifier.getIsEnabled());
    radioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            modifier.setIsEnabled(isChecked);
        }
    });
}
 
开发者ID:ABTSoftware,项目名称:SciChart.Android.Examples,代码行数:11,代码来源:ViewSettingsUtil.java

示例9: onAboutClick

import android.app.Dialog; //导入方法依赖的package包/类
private boolean onAboutClick(MenuItem item)
{
    AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setTitle(R.string.about);

    DateFormat dateFormat = DateFormat.getDateTimeInstance();
    String format = getString(R.string.version);

    String message =
        String.format(Locale.getDefault(),
                      format, BuildConfig.VERSION_NAME,
                      dateFormat.format(BuildConfig.BUILT));
    builder.setMessage(message);

    // Add the button
    builder.setPositiveButton(android.R.string.ok, null);

    // Create the AlertDialog
    Dialog dialog = builder.show();

    // Set movement method
    TextView text = (TextView) dialog.findViewById(android.R.id.message);
    if (text != null)
        text.setMovementMethod(LinkMovementMethod.getInstance());

    return true;
}
 
开发者ID:billthefarmer,项目名称:crossword,代码行数:28,代码来源:Main.java

示例10: saveFile

import android.app.Dialog; //导入方法依赖的package包/类
private void saveFile() {
    if (isNewFile) {
        isNewFile = false;
        final Dialog dialog = UiUtils.createDialog(
                this,
                "Save File",
                "Save"
        );

        final EditText folderEditText = (EditText) dialog.findViewById(R.id.foldername_edittext);
        Button okayButton = (Button) dialog.findViewById(R.id.create_file_button);

        okayButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String folderName = folderEditText.getText().toString();
                if (folderName.length() < 1) {
                    folderEditText.setError("Give me the file name");
                } else {
                    dialog.dismiss();
                    new FileSaveTask().execute(folderName,mEditText.getText().toString());
                }
            }
        });
    }else{
        new FileSaveTask().execute("",mEditText.getText().toString());
    }

}
 
开发者ID:mosamabinomar,项目名称:RootPGPExplorer,代码行数:30,代码来源:TextEditorActivity.java

示例11: createDialog

import android.app.Dialog; //导入方法依赖的package包/类
public void createDialog() {
    cpuCoolerFilterDialog = new Dialog(this);
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.cpu_cooler_filter_dialog, (ViewGroup) findViewById(R.id.cpuCoolerRootElement));
    cpuCoolerFilterDialog.setContentView(layout);
    closeBtn = (ImageView) cpuCoolerFilterDialog.findViewById(R.id.cpuCoolerCloseButton);
    closeBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            cpuCoolerFilterDialog.dismiss();
        }
    });
}
 
开发者ID:asdiamond,项目名称:CodeMineProject1,代码行数:14,代码来源:CPUCoolerActivity.java

示例12: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    Dialog mDialog = new Dialog(getActivity(), R.style.BottomDialog);
    mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mDialog.setContentView(R.layout.dialog_fragment_comment_layout);
    mDialog.setCanceledOnTouchOutside(true);

    Window window = mDialog.getWindow();
    WindowManager.LayoutParams layoutParams;
    if (window != null) {
        layoutParams = window.getAttributes();
        layoutParams.gravity = Gravity.BOTTOM;
        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
        window.setAttributes(layoutParams);
    }

    commentEditText = (EditText) mDialog.findViewById(R.id.edit_comment);
    photoButton = (ImageView) mDialog.findViewById(R.id.image_btn_photo);
    atButton = (ImageView) mDialog.findViewById(R.id.image_btn_at);
    sendButton = (ImageView) mDialog.findViewById(R.id.image_btn_comment_send);

    fillEditText();
    setSoftKeyboard();

    commentEditText.addTextChangedListener(mTextWatcher);
    photoButton.setOnClickListener(this);
    atButton.setOnClickListener(this);

    sendButton.setOnClickListener(this);

    return mDialog;
}
 
开发者ID:showzeng,项目名称:PureComment,代码行数:34,代码来源:CommentDialogFragment.java

示例13: showChangeLangDialog

import android.app.Dialog; //导入方法依赖的package包/类
public void showChangeLangDialog() {

        final Dialog dialog = new Dialog(MainActivity.this);
        dialog.setContentView(R.layout.custom_dialog);
        dialog.setCanceledOnTouchOutside(true);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
        final EditText edt = (EditText) dialog.findViewById(R.id.edit1);

        edt.setText(alertmsg);
        dialog.show();

        Button ok_btn = (Button) dialog.findViewById(R.id.ok_btn);

        ok_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!edt.getText().toString().isEmpty()) {
                    editor = preferences.edit();
                    editor.putString("alert_msg", edt.getText().toString());
                    editor.apply();
                    dialog.dismiss();
                } else {
                    Toast.makeText(MainActivity.this, "please enter the msg", Toast.LENGTH_SHORT).show();
                }

            }
        });


    }
 
开发者ID:spritlesoftware,项目名称:low-battery-alert,代码行数:31,代码来源:MainActivity.java

示例14: initializeViews

import android.app.Dialog; //导入方法依赖的package包/类
private void initializeViews(Dialog dialog) {
    thirtySecond = (ToggleButton) dialog.findViewById(R.id.thirty_second);
    sixteenth = (ToggleButton) dialog.findViewById(R.id.sixteenth);
    eighth = (ToggleButton) dialog.findViewById(R.id.eighth);
    quarter = (ToggleButton) dialog.findViewById(R.id.quarter);

    View thirtySecondParent = dialog.findViewById(R.id.thirty_second_parent);
    View sixteenthParent = dialog.findViewById(R.id.sixteenth_parent);
    View eighthParent = dialog.findViewById(R.id.eighth_parent);
    View QuarterParent = dialog.findViewById(R.id.quarter_parent);

    if (minimumPrecision <= DurationHandler.PRECISION_THIRTY_SECOND) {
        thirtySecondParent.setOnClickListener(__ -> onThirtySecondClicked());
    } else {
        thirtySecondParent.setVisibility(View.GONE);
    }
    if (minimumPrecision <= DurationHandler.PRECISION_SIXTEENTH) {
        sixteenthParent.setOnClickListener(__ -> onSixteenthClicked());
    } else {
        sixteenthParent.setVisibility(View.GONE);
    }
    if (minimumPrecision <= DurationHandler.PRECISION_EIGHTH) {
        eighthParent.setOnClickListener(__ -> onEighthClicked());
    } else {
        eighthParent.setVisibility(View.GONE);
    }
    if (minimumPrecision <= DurationHandler.PRECISION_QUARTER) {
        QuarterParent.setOnClickListener(__ -> onQuarterClicked());
    } else {
        QuarterParent.setVisibility(View.GONE);
    }

    onEighthClicked();
}
 
开发者ID:joshschriever,项目名称:LiveNotes,代码行数:35,代码来源:PrecisionDialogFragment.java

示例15: initializeViews

import android.app.Dialog; //导入方法依赖的package包/类
private void initializeViews(Dialog dialog) {
    simple = (ToggleButton) dialog.findViewById(R.id.simple);
    compound = (ToggleButton) dialog.findViewById(R.id.compound);
    beats = (TextView) dialog.findViewById(R.id.beats);
    beatValue = (TextView) dialog.findViewById(R.id.beat_value);
    decrementBeats = (Button) dialog.findViewById(R.id.decrement_beats);
    incrementBeats = (Button) dialog.findViewById(R.id.increment_beats);
    decrementBeatValue = (Button) dialog.findViewById(R.id.decrement_beat_value);
    incrementBeatValue = (Button) dialog.findViewById(R.id.increment_beat_value);

    dialog.findViewById(R.id.simple_parent).setOnClickListener(__ -> onSimpleClicked());
    dialog.findViewById(R.id.compound_parent).setOnClickListener(__ -> onCompoundClicked());

    decrementBeats.setOnClickListener(__ -> onDecrementBeatsClicked());
    incrementBeats.setOnClickListener(__ -> onIncrementBeatsClicked());
    decrementBeatValue.setOnClickListener(__ -> onDecrementBeatValueClicked());
    incrementBeatValue.setOnClickListener(__ -> onIncrementBeatValueClicked());

    tempoNote = (ImageView) dialog.findViewById(R.id.tempo_note);
    tempo = (NumberPicker) dialog.findViewById(R.id.tempo);
    tempo.setMinValue(getResources().getInteger(R.integer.min_tempo));
    tempo.setMaxValue(getResources().getInteger(R.integer.max_tempo));
    tempo.setValue(getResources().getInteger(R.integer.default_tempo));
    tempo.setWrapSelectorWheel(false);

    simple.setChecked(false);
    onSimpleClicked();
}
 
开发者ID:joshschriever,项目名称:LiveNotes,代码行数:29,代码来源:TimeDialogFragment.java


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