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


Java TextInputLayout.setVisibility方法代码示例

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


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

示例1: CommonDialog

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
public CommonDialog(Context context) {
    view = LayoutInflater.from(context).inflate(R.layout.dialog_common, null, false);
    tvMessage = (TextView) view.findViewById(R.id.tv_message);
    btOk = (Button) view.findViewById(R.id.bt_ok);
    btCancel = (Button) view.findViewById(R.id.bt_cancel);
    tvTitle = (TextView) view.findViewById(R.id.tv_title);
    tvMessageRoot = (LinearLayout) view.findViewById(R.id.tv_message_root);

    inputArea = (TextInputEditText) view.findViewById(R.id.input_area);
    inputRoot = (TextInputLayout) view.findViewById(R.id.input_root);

    inputRoot.setVisibility(View.GONE);
    tvMessageRoot.setVisibility(View.GONE);
    tvTitle.setVisibility(View.GONE);
    tvMessage.setVisibility(View.GONE);
    btOk.setVisibility(View.GONE);
    btCancel.setVisibility(View.GONE);

    builder = new AlertDialog.Builder(context)
            .setView(view);
}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:22,代码来源:CommonDialog.java

示例2: onItemSelected

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
    TextInputLayout server = (TextInputLayout) rootView.findViewById(R.id.servertextinput);
    if (pos == 2) {
        server.setVisibility(View.VISIBLE);
    } else {
        server.setVisibility(View.GONE);
    }
}
 
开发者ID:DecentralizedAmateurPagingNetwork,项目名称:DAPNETApp,代码行数:9,代码来源:CustomOnItemSelectedListener.java

示例3: onPostExecute

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
@Override
protected void onPostExecute(final Integer messageID) {
    showProgress(false);

    switch (messageID) {
        // if success
        case R.string.login_accepted_text:
            logFirstLoginAction(true, activity.get().getString(messageID));
            Intent intent = new Intent(activity.get(), DashboardActivity.class);
            activity.get().finish();
            activity.get().startActivity(intent);
            break;

        // if bad credentials entered
        case R.string.login_bad_credentials_text:
            logFirstLoginAction(false, activity.get().getString(messageID));
            EditText passwordView = activity.get().findViewById(R.id.password);
            passwordView.setError(activity.get().getString(R.string.error_incorrect_password));
            passwordView.requestFocus();
            KeyboardUtils.showSoftInput(passwordView, activity.get());
            break;

        // if no permission
        case R.string.error_bad_account_permission:
            logFirstLoginAction(false, activity.get().getString(messageID));
            // Change to visible symbol input view
            TextInputLayout symbolLayout = activity.get().findViewById(R.id.to_symbol_input_layout);
            symbolLayout.setVisibility(View.VISIBLE);

            EditText symbolView = activity.get().findViewById(R.id.symbol);
            symbolView.setError(activity.get().getString(R.string.error_bad_account_permission));
            symbolView.requestFocus();
            KeyboardUtils.showSoftInput(symbolView, activity.get());
            break;

        // if rooted and SDK < 18
        case -1:
            logFirstLoginAction(false, "Device rooted");
            final AlertDialog.Builder alertDialog = new AlertDialog.Builder(activity.get())
                    .setIcon(android.R.drawable.ic_dialog_alert)
                    .setTitle(R.string.alert_dialog_blocked_app)
                    .setMessage(R.string.alert_dialog_blocked_app_message)
                    .setPositiveButton(R.string.generic_dialog_close, new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            dialogInterface.dismiss();
                        }
                    });
            alertDialog.show();
            break;

        default:
            logFirstLoginAction(false, activity.get().getString(messageID));
            Snackbar.make(activity.get().findViewById(R.id.fragment_container),
                    messageID, Snackbar.LENGTH_LONG).show();
            break;
    }
}
 
开发者ID:wulkanowy,项目名称:wulkanowy,代码行数:59,代码来源:LoginTask.java

示例4: enableError

import android.support.design.widget.TextInputLayout; //导入方法依赖的package包/类
/**
 * @author Soussi
 *
 * @param msg
 * @param textInputLayout
 * Function Checks for validity  TextInputLayout (Error = true)
 */

private static void enableError(TextInputLayout textInputLayout, String msg)

{
    textInputLayout.setVisibility(View.VISIBLE);
    textInputLayout.setError(msg.toString());

}
 
开发者ID:datalink747,项目名称:Rx_java2_soussidev,代码行数:16,代码来源:RxTextInputLayout.java


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