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


Java TextInputLayout.addView方法代码示例

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


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

示例1: addAnswerByButton

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
@OnClick(R.id.addAnswerButton)
public void addAnswerByButton(View view) {
	if (getAnswersCount() >= MAX_ANSWERS) {
		Snackbar.make(view, getString(R.string.maxOfAnswers), Snackbar.LENGTH_SHORT).show();
		return;
	}
	TextInputLayout textInputLayout = createTextInputLayout();
	textInputLayout.addView(createEditText());
	inputLayout.addView(textInputLayout);
}
 
开发者ID:Komdosh,项目名称:SocEltech,代码行数:11,代码来源:QuestionFragment.java

示例2: addAnswer

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
public void addAnswer(String answer) {
	TextInputLayout textInputLayout = createTextInputLayout();
	EditText editText = createEditText();
	editText.setText(answer);
	textInputLayout.addView(editText);
	inputLayout.addView(textInputLayout);
}
 
开发者ID:Komdosh,项目名称:SocEltech,代码行数:8,代码来源:QuestionFragment.java

示例3: createAndAddEditText

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
private void createAndAddEditText(String res){
	TextInputLayout textInputLayout = createTextInputLayout();
	EditText editText = createEditText();
	editText.setText(res);
	textInputLayout.addView(editText);
	linearLayout.addView(textInputLayout);
}
 
开发者ID:Komdosh,项目名称:SocEltech,代码行数:8,代码来源:EditResultActivity.java

示例4: onCreateDialog

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

    // creazione 'manuale' del dialog
    int margin = getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin);

    LinearLayout rootView = new LinearLayout(getActivity());
    rootView.setOrientation(LinearLayout.VERTICAL);
    rootView.setPadding(margin, margin, margin, margin);
    mTxtInput = new TextInputLayout(getActivity());
    mTxtInput.addView(new EditText(getActivity()));
    mTxtInput.setHint(getString(R.string.api_key_title));
    if (mTxtInput.getEditText() != null) {
        mTxtInput.getEditText().setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        mTxtInput.getEditText().setHighlightColor(Color.YELLOW);
    }

    rootView.addView(mTxtInput);

    // Setto l'edit text con il testo dell'api key se presente
    String apiKey = SharedPrefsHelper.getInstance().getApiKey(getActivity());
    if(apiKey != null)
        mTxtInput.getEditText().setText(apiKey);

    AlertDialog dialog = new AlertDialog.Builder(getActivity())
            .setTitle(getString(R.string.title_insert_api_key))
            .setView(rootView)
            //.setCancelable(false)
            .setPositiveButton(getString(R.string.salva), null)
            .setNegativeButton(SharedPrefsHelper.getInstance()
                    .isApiKeyRegistered(getActivity()) ? getString(R.string.annulla) : getString(R.string.esci_app), this)
            .create();

    dialog.setOnShowListener(this);

    return dialog;
}
 
开发者ID:IelloDevTeam,项目名称:IelloAndroidAdminApp,代码行数:39,代码来源:DialogAPIKey.java


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