PatientIdElement.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:sana.mobile 作者:
/** {@inheritDoc} */
@Override
protected View createView(Context c) {

    et = new EditText(c);
    et.setPadding(10,5,10,5);
    et.setText(answer);
    et.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
            LayoutParams.WRAP_CONTENT));
    et.setGravity(Gravity.CENTER_HORIZONTAL);
    et.setKeyListener(new DialerKeyListener());

    LinearLayout ll = new LinearLayout(c);
    ll.setOrientation(LinearLayout.VERTICAL);

    ll.addView(et, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, 
            LayoutParams.WRAP_CONTENT));
    ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
            LayoutParams.WRAP_CONTENT));

    //SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(c);
    boolean barcodeEnable = true; //sp.getBoolean(Constants.PREFERENCE_BARCODE_ENABLED, false);

    if (barcodeEnable) {
    barcodeButton = new Button(c);
     barcodeButton.setText(c.getResources().getString(
            R.string.procedurerunner_scan_id));
     barcodeButton.setOnClickListener(this);
     barcodeButton.setGravity(Gravity.CENTER_HORIZONTAL);
    ll.addView(barcodeButton, new LinearLayout.LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
    }
    return encapsulateQuestion(c, ll);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号