當前位置: 首頁>>代碼示例>>Java>>正文


Java MaterialEditText.setText方法代碼示例

本文整理匯總了Java中com.rengwuxian.materialedittext.MaterialEditText.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java MaterialEditText.setText方法的具體用法?Java MaterialEditText.setText怎麽用?Java MaterialEditText.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.rengwuxian.materialedittext.MaterialEditText的用法示例。


在下文中一共展示了MaterialEditText.setText方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initTimePicker

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
/**
 * Initializes time picker edit text and sets current time as text
 */
private void initTimePicker(MaterialDialog dialog, Activity activity, int id) {
    try {
        View view = dialog.getCustomView();
        MaterialEditText timePickerEditText = (MaterialEditText) view.findViewById(id);
        if (timePickerEditText != null) {
            timePickerEditText.setInputType(InputType.TYPE_NULL);
            DialogHelper.onFocusOpenTimePicker(activity, timePickerEditText);
            String currentHourAndMinutes = UtilsRG.timeFormat.format(new Date());
            timePickerEditText.setText(currentHourAndMinutes);
        }
    } catch (Exception e) {
        UtilsRG.error("Unexpected error: " + e.getLocalizedMessage());
    }
}
 
開發者ID:lidox,項目名稱:reaction-test,代碼行數:18,代碼來源:MedicamentDetailDialog.java

示例2: setupEditionView

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
public View setupEditionView(Object value)
{
    if (value != null)
    {
        editionValue = value;
    }

    View vr = inflater.inflate(R.layout.form_usergroup_picker, null);
    editText = (MaterialEditText) vr.findViewById(R.id.group_picker);
    editText.setText(getHumanReadableEditionValue());

    // Asterix if required
    editText.setFloatingLabelText(getLabelText(data.getName()));

    if (TextUtils.isEmpty(data.getPlaceholder()))
    {
        editText.setHint(getLabelText(data.getName()));
    }
    else
    {
        editText.setFloatingLabelAlwaysShown(true);
        editText.setHint(data.getPlaceholder());
    }
    editText.setFocusable(false);

    editText.setIconRight(R.drawable.ic_group_grey);

    editionView = vr;

    return vr;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:33,代碼來源:UserGroupPickerField.java

示例3: setupEditionView

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
public View setupEditionView(Object value)
{
    editionValue = value;
    if (value instanceof String)
    {
        editionValue = ISO8601Utils.parse((String) value);
    }

    View vr = inflater.inflate(R.layout.form_date, null);
    editText = (MaterialEditText) vr.findViewById(R.id.date_picker);
    editText.setText(getHumanReadableEditionValue());

    // Asterix if required
    editText.setFloatingLabelText(getLabelText(data.getName()));

    if (TextUtils.isEmpty(data.getPlaceholder()))
    {
        editText.setHint(getLabelText(data.getName()));
    }
    else
    {
        editText.setFloatingLabelAlwaysShown(true);
        editText.setHint(data.getPlaceholder());
    }
    editText.setFocusable(false);

    editText.setIconRight(R.drawable.ic_event_grey);

    editionView = vr;

    return vr;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:34,代碼來源:DateField.java

示例4: setupEditionView

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
public View setupEditionView(Object value)
{
    if (value != null)
    {
        editionValue = value;
    }

    View vr = inflater.inflate(R.layout.form_user_picker, null);
    editText = (MaterialEditText) vr.findViewById(R.id.user_picker);
    editText.setText(getHumanReadableEditionValue());

    // Asterix if required
    editText.setFloatingLabelText(getLabelText(data.getName()));

    if (TextUtils.isEmpty(data.getPlaceholder()))
    {
        editText.setHint(getLabelText(data.getName()));
    }
    else
    {
        editText.setFloatingLabelAlwaysShown(true);
        editText.setHint(data.getPlaceholder());
    }
    editText.setFocusable(false);

    editText.setIconRight(R.drawable.ic_account_circle_grey);

    editionView = vr;

    return vr;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:33,代碼來源:UserPickerField.java

示例5: setupdReadView

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
public View setupdReadView()
{
    if (!(data instanceof HyperlinkRepresentation)) { return null; }
    View vr = inflater.inflate(R.layout.form_hyperlink, null);
    vr.findViewById(R.id.button_container).setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            Intent i = new Intent(Intent.ACTION_VIEW);
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            i.setData(Uri.parse((((HyperlinkRepresentation) data).getHyperlinkUrl())));
            getFragment().getActivity().startActivity(i);
        }
    });

    MaterialEditText editText = (MaterialEditText) vr.findViewById(R.id.hyperlink);
    editText.setText((((HyperlinkRepresentation) data).getDisplayText()));
    editText.setHideUnderline(true);
    editText.setHelperTextAlwaysShown(true);
    try
    {
        editText.setHelperText(Uri.parse(((HyperlinkRepresentation) data).getHyperlinkUrl()).getHost());
    }
    catch (Exception e)
    {

    }

    // Asterix if required
    editText.setFloatingLabelText(data.getName());
    editText.setFloatingLabelAlwaysShown(true);
    editText.setIconRight(R.drawable.ic_link_grey);

    editionView = vr;
    readView = vr;

    return vr;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:40,代碼來源:HyperlinkField.java

示例6: onActivityCreated

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState)
{
    super.onActivityCreated(savedInstanceState);

    if (getArguments() != null)
    {
        accountId = getArguments().getLong(ARGUMENT_ACCOUNT_ID);
    }
    acc = ActivitiAccountManager.getInstance(getActivity()).getByAccountId(accountId);
    Uri serverUri = Uri.parse(acc.getServerUrl());

    if (serverUri.getPath().equals("/activiti-app"))
    {
        // It's default url
        https = ("https".equals(serverUri.getScheme().toLowerCase()));
        hostname = serverUri.getAuthority();
    }
    else
    {
        // It's not default we display full url in hostname
        hostname = acc.getServerUrl();
        hide(R.id.signing_https);
    }

    // TITLE
    TextView tv = (TextView) viewById(R.id.signin_title);
    tv.setText(R.string.settings_userinfo_account_summary);

    // USERNAME
    mEmailView = (MaterialAutoCompleteTextView) viewById(R.id.username);
    Account[] accounts = AccountManager.get(getActivity()).getAccounts();
    List<String> names = new ArrayList<>(accounts.length);
    String accountName;
    for (int i = 0; i < accounts.length; i++)
    {
        accountName = accounts[i].name;
        if (!TextUtils.isEmpty(accountName) && !names.contains(accountName))
        {
            names.add(accounts[i].name);
        }
    }
    ArrayAdapter adapter = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1, names);
    mEmailView.setAdapter(adapter);
    mEmailView.setText(acc.getUsername());

    // PASSWORD
    mPasswordView = (EditText) viewById(R.id.password);
    mPasswordView.setText(acc.getPassword());

    Button mEmailSignInButton = (Button) viewById(R.id.email_sign_in_button);
    mEmailSignInButton.setText(R.string.general_action_confirm);
    mEmailSignInButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View view)
        {
            attemptLogin();
        }
    });

    mProgressView = viewById(R.id.login_progress);
    mFormView = viewById(R.id.login_form);

    // Server part
    httpsView = (CheckBox) viewById(R.id.signing_https);
    httpsView.setChecked(https);
    hostnameView = (MaterialEditText) viewById(R.id.signing_hostname);
    hostnameView.setText(hostname);

    show(R.id.server_form);
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:73,代碼來源:AccountEditFragment.java

示例7: onActivityCreated

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState)
{
    super.onActivityCreated(savedInstanceState);

    if (getArguments() != null)
    {
        hostname = getArguments().getString(ARGUMENT_HOSTNAME);
        https = getArguments().getBoolean(ARGUMENT_HTTPS);
        String url = ServerFragment.createHostnameURL(hostname, https);
        endpoint = TextUtils.isEmpty(url) ? null : Uri.parse(url);
    }

    // We retrieve emails from accounts.
    mEmailView = (MaterialAutoCompleteTextView) viewById(R.id.username);
    Account[] accounts = AccountManager.get(getActivity()).getAccounts();
    List<String> names = new ArrayList<>(accounts.length);
    String accountName;
    for (int i = 0; i < accounts.length; i++)
    {
        accountName = accounts[i].name;
        if (!TextUtils.isEmpty(accountName) && !names.contains(accountName))
        {
            names.add(accounts[i].name);
        }
    }
    ArrayAdapter adapter = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1, names);
    mEmailView.setAdapter(adapter);

    mPasswordView = (EditText) viewById(R.id.password);

    Button mEmailSignInButton = (Button) viewById(R.id.email_sign_in_button);
    mEmailSignInButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View view)
        {
            attemptLogin();
        }
    });

    mProgressView = viewById(R.id.login_progress);
    mFormView = viewById(R.id.login_form);

    // Server part
    httpsView = (CheckBox) viewById(R.id.signing_https);
    httpsView.setChecked(https);
    hostnameView = (MaterialEditText) viewById(R.id.signing_hostname);
    hostnameView.setText(hostname);
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:51,代碼來源:SignInFragment.java

示例8: setupEditionView

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
public View setupEditionView(Object value)
{
    editionValue = value;

    View vr = inflater.inflate(R.layout.form_hyperlink, null);
    vr.findViewById(R.id.button_container).setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            Intent i = new Intent(Intent.ACTION_VIEW);
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            i.setData(Uri.parse(((HyperlinkRepresentation) data).getHyperlinkUrl()));
            getFragment().getActivity().startActivity(i);
        }
    });

    MaterialEditText editText = (MaterialEditText) vr.findViewById(R.id.hyperlink);
    editText.setText(((HyperlinkRepresentation) data).getDisplayText());
    StringBuilder builder = new StringBuilder(data.getName());
    editText.setHideUnderline(true);
    try
    {
        builder.append(" (");
        builder.append(Uri.parse(((HyperlinkRepresentation) data).getHyperlinkUrl()).getAuthority()
                .replaceFirst("^(http://|http://www\\.|www\\.)", ""));
        builder.append(")");
    }
    catch (Exception e)
    {

    }
    editText.setFloatingLabelText(builder.toString());

    editText.setFloatingLabelAlwaysShown(true);
    editText.setIconRight(R.drawable.ic_link_grey);

    editionView = vr;
    return vr;
}
 
開發者ID:Alfresco,項目名稱:activiti-android-app,代碼行數:42,代碼來源:HyperlinkField.java

示例9: onCreate

import com.rengwuxian.materialedittext.MaterialEditText; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.repost_weibo_activity_layout_new);

    mComments = (CheckBox) findViewById(R.id.repostCommentsCheck);

    Toolbar mToolbar = (Toolbar) findViewById(R.id.writeWeiboToolBar);

    keyboardLayout = ViewUtility.findViewById(this, R.id.keyboardLayout);
    keyboardLayout.setOnKeyboardStateListener(new OnKeyboardStateChangeListener() {
        @Override
        public void onKeyBoardShow(int height) {
            if (isSmileClicked) {
                RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mEditPicScrollView.getLayoutParams();
                params.height = RelativeLayout.LayoutParams.MATCH_PARENT;
                mEditPicScrollView.requestLayout();

            }
        }

        @Override
        public void onKeyBoardHide() {
            if (isSmileClicked) {
                showViewWithAnim(mSmileyPicker);
            }
        }
    });
    disPlayHomeAsUp(mToolbar);

    AccountBean mAccountBean = BeeboApplication.getInstance().getAccountBean();
    // mAccountBean = getAccount();
    Log.d("RpostWeiBo_activity", "AccountBean == null ? : " + (mAccountBean == null));

    mEditPicScrollView = (ScrollView) findViewById(R.id.scrollview);

    weiTextCountTV = (TextView) findViewById(R.id.weiTextCountTV);

    ImageButton mSelectPhoto = (ImageButton) findViewById(R.id.imageButton1);
    mSelectPhoto.setVisibility(View.GONE);
    mEditText = (MaterialEditText) findViewById(R.id.weiboContentET);
    mSmileyPicker = (SmileyPicker) findViewById(R.id.smileLayout_ref);
    mSmileyPicker.setEditText(mEditText);

    ImageButton smileButton = (ImageButton) findViewById(R.id.smileImgButton);
    ImageButton mSendBtn = (ImageButton) findViewById(R.id.sendWeiBoBtn);

    ImageButton mTopicBtn = (ImageButton) findViewById(R.id.menu_topic);
    ImageButton mAtButton = (ImageButton) findViewById(R.id.menu_at);
    mTopicBtn.setOnClickListener(this);
    mAtButton.setOnClickListener(this);

    // findAllEmotionImageView((ViewGroup) findViewById(R.id.emotionTL));
    mSelectPhoto.setOnClickListener(this);
    smileButton.setOnClickListener(this);
    mSendBtn.setOnClickListener(this);
    mEditPicScrollView.setOnClickListener(this);
    mEditText.addTextChangedListener(watcher);

    Intent intent = getIntent();
    if (WriteRepostActivity.ACTION_SEND_FAILED.equals(intent.getAction())) {
        mAccountBean = intent.getParcelableExtra(Constants.ACCOUNT);
        mEditText.setText(intent.getStringExtra("content"));
        msg = intent.getParcelableExtra("oriMsg");
    } else {
        handleNormalOperation(intent);
    }


}
 
開發者ID:andforce,項目名稱:iBeebo,代碼行數:71,代碼來源:RepostWeiboWithAppSrcActivity.java


注:本文中的com.rengwuxian.materialedittext.MaterialEditText.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。