public override void onCheckedChanged(RadioGroup group, int checkedId) { try { switch (checkedId) { case R.id.radioSmartCard: smartCardRW.SCSlot = 0x01 << (sizeof(int) - 1); break; case R.id.radioSam1: smartCardRW.SCSlot = 0x01 << (sizeof(int) - 2); break; case R.id.radioSam2: smartCardRW.SCSlot = 0x01 << (sizeof(int) - 3); break; case R.id.radioApdu: smartCardRW.IsoEmvMode = SmartCardRWConst.SC_CMODE_EMV; break; case R.id.radioTpdu: smartCardRW.IsoEmvMode = SmartCardRWConst.SC_CMODE_ISO; break; } } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radio0: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE0; break; case R.id.radio1: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE2; break; case R.id.radio2: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE3; break; case R.id.radio3: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE4; break; } }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radio0: outerInstance.mEditText.Enabled = false; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_LINE_OVERWRITING; break; case R.id.radio1: outerInstance.mEditText.Enabled = false; outerInstance.exclusiveOrOption(true); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_LINE_EXCLUSIVE_OR; break; case R.id.radio2: outerInstance.mEditText.Enabled = false; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_LINE_DELETE; break; case R.id.radio3: outerInstance.mEditText.Enabled = true; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_SLOPE; break; case R.id.radio4: outerInstance.mEditText.Enabled = true; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_BOX; break; } }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radio0: outerInstance.mEditText.Enabled = false; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_LINE_OVERWRITING; break; case R.id.radio1: outerInstance.mEditText.Enabled = false; outerInstance.exclusiveOrOption(true); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_LINE_EXCLUSIVE_OR; break; case R.id.radio2: outerInstance.mEditText.Enabled = false; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_LINE_DELETE; break; case R.id.radio3: outerInstance.mEditText.Enabled = true; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_SLOPE; break; case R.id.radio4: outerInstance.mEditText.Enabled = true; outerInstance.exclusiveOrOption(false); outerInstance.mOption = BixolonLabelPrinter.BLOCK_OPTION_BOX; break; } }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radio0: // UPC-A outerInstance.mDataEdit.Text = "012345678905"; break; case R.id.radio1: // UPC-E outerInstance.mDataEdit.Text = "012345678905"; break; case R.id.radio2: // EAN13 outerInstance.mDataEdit.Text = "4711234567899"; break; case R.id.radio3: // EAN8 outerInstance.mDataEdit.Text = "47112346"; break; case R.id.radio4: // CODE39 outerInstance.mDataEdit.Text = "*ANDY*"; break; case R.id.radio5: // ITF outerInstance.mDataEdit.Text = "1234567895"; break; case R.id.radio6: // CODABAR outerInstance.mDataEdit.Text = "A1234567B"; break; case R.id.radio7: // CODE93 outerInstance.mDataEdit.Text = "12341555"; break; case R.id.radio8: // CODE128 outerInstance.mDataEdit.Text = "12345"; break; } }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radio0: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE0; break; case R.id.radio1: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE2; break; case R.id.radio2: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE3; break; case R.id.radio3: outerInstance.mEditText.Text = [email protected]_data; outerInstance.mMode = BixolonLabelPrinter.MAXICODE_MODE4; break; } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_smart_card_rw, container, false); SharedPreferences settings = Activity.getSharedPreferences(MainActivity.PREFS_NAME, Context.MODE_PRIVATE); logicalNameEditText = (EditText)view.findViewById(R.id.editTextLogicalName); logicalNameEditText.Text = settings.getString(MainActivity.KEY_LOGICAL_NAME_SMART_CARD_RW, getString([email protected]_card_rw)); view.findViewById(R.id.buttonOpen).OnClickListener = this; view.findViewById(R.id.buttonClaim).OnClickListener = this; view.findViewById(R.id.buttonRelease).OnClickListener = this; view.findViewById(R.id.buttonClose).OnClickListener = this; view.findViewById(R.id.buttonInfo).OnClickListener = this; view.findViewById(R.id.buttonCheckHealth).OnClickListener = this; view.findViewById(R.id.buttonReadData).OnClickListener = this; CheckBox checkBox = (CheckBox)view.findViewById(R.id.checkBoxDeviceEnabled); checkBox.OnCheckedChangeListener = this; RadioGroup radioGroup = (RadioGroup)view.findViewById(R.id.radioGroup1); radioGroup.OnCheckedChangeListener = this; radioGroup = (RadioGroup)view.findViewById(R.id.radioGroup2); radioGroup.OnCheckedChangeListener = this; readDataTextView = (TextView)view.findViewById(R.id.textViewReadData); stateTextView = (TextView)view.findViewById(R.id.textViewState); return(view); }
private void printDataMatrix() { EditText editText = (EditText)findViewById(R.id.editText1); if (editText.Text.ToString().Equals("")) { editText.Text = "BIXOLON Label Printer"; } string data = editText.Text.ToString(); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "200"; } int horizontalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int verticalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText4); if (editText.Text.ToString().Equals("")) { editText.Text = "2"; } int size = int.Parse(editText.Text.ToString()); CheckBox checkBox = (CheckBox)findViewById(R.id.checkBox1); bool isReversed = checkBox.Checked; int rotation = BixolonLabelPrinter.ROTATION_NONE; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio2: rotation = BixolonLabelPrinter.ROTATION_90_DEGREES; break; case R.id.radio3: rotation = BixolonLabelPrinter.ROTATION_180_DEGREES; break; case R.id.radio4: rotation = BixolonLabelPrinter.ROTATION_270_DEGREES; break; } MainActivity.mBixolonLabelPrinter.drawDataMatrix(data, horizontalPosition, verticalPosition, size, isReversed, rotation); MainActivity.mBixolonLabelPrinter.print(1, 1); }
private void printCircle() { EditText editText = (EditText)findViewById(R.id.editText1); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int horizontalStartPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "200"; } int verticalStartPosition = int.Parse(editText.Text.ToString()); int size = BixolonLabelPrinter.CIRCLE_SIZE_DIAMETER5; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio1: size = BixolonLabelPrinter.CIRCLE_SIZE_DIAMETER7; break; case R.id.radio2: size = BixolonLabelPrinter.CIRCLE_SIZE_DIAMETER9; break; case R.id.radio3: size = BixolonLabelPrinter.CIRCLE_SIZE_DIAMETER11; break; case R.id.radio4: size = BixolonLabelPrinter.CIRCLE_SIZE_DIAMETER13; break; case R.id.radio5: size = BixolonLabelPrinter.CIRCLE_SIZE_DIAMETER21; break; } editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "2"; } int multiplier = int.Parse(editText.Text.ToString()); MainActivity.mBixolonLabelPrinter.drawCircle(horizontalStartPosition, verticalStartPosition, size, multiplier); MainActivity.mBixolonLabelPrinter.print(1, 1); }
void android.widget.RadioGroup.OnCheckedChangeListener.onCheckedChanged(android.widget.RadioGroup arg0, int arg1) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::android.widget.RadioGroup.OnCheckedChangeListener_._onCheckedChanged11723, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.widget.RadioGroup.OnCheckedChangeListener_.staticClass, global::android.widget.RadioGroup.OnCheckedChangeListener_._onCheckedChanged11723, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1)); } }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_draw_maxicode; Button button = (Button) findViewById(R.id.button1); button.OnClickListener = this; mEditText = (EditText) findViewById(R.id.editText1); mRadioGroup = (RadioGroup) findViewById(R.id.radioGroup1); mRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_draw_maxicode; Button button = (Button)findViewById(R.id.button1); button.OnClickListener = this; mEditText = (EditText)findViewById(R.id.editText1); mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup1); mRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_draw_block_two; mEditText = (EditText) findViewById(R.id.editText5); mExOrEditText7 = (EditText) findViewById(R.id.editText7); mExOrEditText8 = (EditText) findViewById(R.id.editText8); mExOrEditText9 = (EditText) findViewById(R.id.editText9); mExOrEditText10 = (EditText) findViewById(R.id.editText10); mRadioGroup = (RadioGroup) findViewById(R.id.radioGroup1); mRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); Button button = (Button) findViewById(R.id.button1); button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_draw_block_two; mEditText = (EditText)findViewById(R.id.editText5); mExOrEditText7 = (EditText)findViewById(R.id.editText7); mExOrEditText8 = (EditText)findViewById(R.id.editText8); mExOrEditText9 = (EditText)findViewById(R.id.editText9); mExOrEditText10 = (EditText)findViewById(R.id.editText10); mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup1); mRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); Button button = (Button)findViewById(R.id.button1); button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radio0: // UPC-A outerInstance.mDataEdit.Text = "012345678905"; break; case R.id.radio1: // UPC-E outerInstance.mDataEdit.Text = "012345678905"; break; case R.id.radio2: // EAN13 outerInstance.mDataEdit.Text = "4711234567899"; break; case R.id.radio3: // EAN8 outerInstance.mDataEdit.Text = "47112346"; break; case R.id.radio4: // CODE39 outerInstance.mDataEdit.Text = "*ANDY*"; break; case R.id.radio5: // ITF outerInstance.mDataEdit.Text = "1234567895"; break; case R.id.radio6: // CODABAR outerInstance.mDataEdit.Text = "A1234567B"; break; case R.id.radio7: // CODE93 outerInstance.mDataEdit.Text = "12341555"; break; case R.id.radio8: // CODE128 outerInstance.mDataEdit.Text = "12345"; break; } }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_print_bitmap; mImageView = (ImageView) findViewById(R.id.imageView1); mTextView = (TextView) findViewById(R.id.textView4); mWidthEdit = (EditText) findViewById(R.id.editText2); mWidthRadioGroup = (RadioGroup) findViewById(R.id.radioGroup2); mWidthRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); Button button = (Button) findViewById(R.id.button1); button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); button = (Button) findViewById(R.id.button2); button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this); IntentFilter filter = new IntentFilter(); filter.addAction(MainActivity.ACTION_COMPLETE_PROCESS_BITMAP); registerReceiver(mReceiver, filter); }
public override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_print_bitmap; mImageView = (ImageView)findViewById(R.id.imageView1); mTextView = (TextView)findViewById(R.id.textView4); mWidthEdit = (EditText)findViewById(R.id.editText2); mWidthRadioGroup = (RadioGroup)findViewById(R.id.radioGroup2); mWidthRadioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); Button button = (Button)findViewById(R.id.button1); button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); button = (Button)findViewById(R.id.button2); button.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this); IntentFilter filter = new IntentFilter(); filter.addAction(MainActivity.ACTION_COMPLETE_PROCESS_BITMAP); registerReceiver(mReceiver, filter); }
public virtual void onClick(View v) { EditText editText = (EditText)findViewById(R.id.editText1); if (editText.Text.ToString().Equals("")) { editText.Text = "BIXOLON Label Printer"; } string data = editText.Text.ToString(); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "200"; } int horizontalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int verticalPosition = int.Parse(editText.Text.ToString()); int model = BixolonLabelPrinter.QR_CODE_MODEL1; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); if (radioGroup.CheckedRadioButtonId == R.id.radio1) { model = BixolonLabelPrinter.QR_CODE_MODEL2; } int eccLevel = BixolonLabelPrinter.ECC_LEVEL_7; radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio3: eccLevel = BixolonLabelPrinter.ECC_LEVEL_15; break; case R.id.radio4: eccLevel = BixolonLabelPrinter.ECC_LEVEL_25; break; case R.id.radio5: eccLevel = BixolonLabelPrinter.ECC_LEVEL_30; break; } editText = (EditText)findViewById(R.id.editText4); if (editText.Text.ToString().Equals("")) { editText.Text = "4"; } int size = int.Parse(editText.Text.ToString()); int rotation = BixolonLabelPrinter.ROTATION_NONE; radioGroup = (RadioGroup)findViewById(R.id.radioGroup3); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio7: rotation = BixolonLabelPrinter.ROTATION_90_DEGREES; break; case R.id.radio8: rotation = BixolonLabelPrinter.ROTATION_180_DEGREES; break; case R.id.radio9: rotation = BixolonLabelPrinter.ROTATION_270_DEGREES; break; } MainActivity.mBixolonLabelPrinter.drawQrCode(data, horizontalPosition, verticalPosition, model, eccLevel, size, rotation); MainActivity.mBixolonLabelPrinter.print(1, 1); }
private void printText() { EditText editText = (EditText)findViewById(R.id.editText1); string text = editText.Text.ToString(); int alignment = BixolonPrinter.ALIGNMENT_LEFT; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio0: alignment = BixolonPrinter.ALIGNMENT_LEFT; break; case R.id.radio1: alignment = BixolonPrinter.ALIGNMENT_CENTER; break; case R.id.radio2: alignment = BixolonPrinter.ALIGNMENT_RIGHT; break; } int attribute = 0; radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio3: attribute |= BixolonPrinter.TEXT_ATTRIBUTE_FONT_A; break; case R.id.radio4: attribute |= BixolonPrinter.TEXT_ATTRIBUTE_FONT_B; break; case R.id.radio5: attribute |= BixolonPrinter.TEXT_ATTRIBUTE_FONT_C; break; } radioGroup = (RadioGroup)findViewById(R.id.radioGroup3); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio7: attribute |= BixolonPrinter.TEXT_ATTRIBUTE_UNDERLINE1; break; case R.id.radio8: attribute |= BixolonPrinter.TEXT_ATTRIBUTE_UNDERLINE2; break; } CheckBox checkBox = (CheckBox)findViewById(R.id.checkBox1); if (checkBox.Checked) { attribute |= BixolonPrinter.TEXT_ATTRIBUTE_EMPHASIZED; } checkBox = (CheckBox)findViewById(R.id.checkBox2); if (checkBox.Checked) { attribute |= BixolonPrinter.TEXT_ATTRIBUTE_REVERSE; } int size = 0; SeekBar seekBar = (SeekBar)findViewById(R.id.seekBar1); switch (seekBar.Progress) { case 0: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL1; break; case 1: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL2; break; case 2: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL3; break; case 3: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL4; break; case 4: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL5; break; case 5: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL6; break; case 6: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL7; break; case 7: size = BixolonPrinter.TEXT_SIZE_HORIZONTAL8; break; } seekBar = (SeekBar)findViewById(R.id.seekBar2); switch (seekBar.Progress) { case 0: size |= BixolonPrinter.TEXT_SIZE_VERTICAL1; break; case 1: size |= BixolonPrinter.TEXT_SIZE_VERTICAL2; break; case 2: size |= BixolonPrinter.TEXT_SIZE_VERTICAL3; break; case 3: size |= BixolonPrinter.TEXT_SIZE_VERTICAL4; break; case 4: size |= BixolonPrinter.TEXT_SIZE_VERTICAL5; break; case 5: size |= BixolonPrinter.TEXT_SIZE_VERTICAL6; break; case 6: size |= BixolonPrinter.TEXT_SIZE_VERTICAL7; break; case 7: size |= BixolonPrinter.TEXT_SIZE_VERTICAL8; break; } checkBox = (CheckBox)findViewById(R.id.checkBox3); bool formFeed = checkBox.Checked; checkBox = (CheckBox)findViewById(R.id.checkBox4); if (checkBox.Checked) { MainActivity.mBixolonPrinter.printDotMatrixText(text, alignment, attribute, size, false); } else { if (formFeed) { MainActivity.mBixolonPrinter.printText(text, alignment, attribute, size, false); MainActivity.mBixolonPrinter.formFeed(false); } else { MainActivity.mBixolonPrinter.printText(text, alignment, attribute, size, false); } } MainActivity.mBixolonPrinter.lineFeed(3, false); MainActivity.mBixolonPrinter.cutPaper(true); MainActivity.mBixolonPrinter.kickOutDrawer(BixolonPrinter.DRAWER_CONNECTOR_PIN5); }
public override void onCheckedChanged(RadioGroup group, int checkedId) { try { switch (checkedId) { case R.id.radioSmartCard: smartCardRW.SCSlot = 0x01 << (sizeof(int) - 1); break; case R.id.radioSam1: smartCardRW.SCSlot = 0x01 << (sizeof(int) - 2); break; case R.id.radioSam2: smartCardRW.SCSlot = 0x01 << (sizeof(int) - 3); break; case R.id.radioApdu: smartCardRW.IsoEmvMode = SmartCardRWConst.SC_CMODE_EMV; break; case R.id.radioTpdu: smartCardRW.IsoEmvMode = SmartCardRWConst.SC_CMODE_ISO; break; } } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } }
private void printBitmap() { string pathName = mTextView.Text.ToString(); mAlignment = BixolonPrinter.ALIGNMENT_CENTER; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio0: mAlignment = BixolonPrinter.ALIGNMENT_LEFT; break; case R.id.radio1: mAlignment = BixolonPrinter.ALIGNMENT_CENTER; break; case R.id.radio2: mAlignment = BixolonPrinter.ALIGNMENT_RIGHT; break; } int width = 0; radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio3: width = BixolonPrinter.BITMAP_WIDTH_NONE; break; case R.id.radio4: width = BixolonPrinter.BITMAP_WIDTH_FULL; break; case R.id.radio5: string @string = mWidthEdit.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the width", Toast.LENGTH_SHORT).show(); } else { width = int.Parse(@string); } break; } EditText editText = (EditText)findViewById(R.id.editText1); int level = int.Parse(editText.Text.ToString()); CheckBox checkBox = (CheckBox)findViewById(R.id.checkBox1); mFormFeed = checkBox.Checked; checkBox = (CheckBox)findViewById(R.id.checkBox2); bool dither = ((CheckBox)findViewById(R.id.checkBox3)).Checked; bool compress = ((CheckBox)findViewById(R.id.checkBox4)).Checked; if (checkBox.Checked) { if (pathName != null && pathName.Length > 0) { MainActivity.mBixolonPrinter.printDotMatrixBitmap(pathName, mAlignment, width, level, false); } else { BitmapDrawable drawable = (BitmapDrawable)Resources.getDrawable(R.drawable.bixolon); Bitmap bitmap = drawable.Bitmap; MainActivity.mBixolonPrinter.printDotMatrixBitmap(bitmap, mAlignment, width, level, false); } } else { if (pathName != null && pathName.Length > 0) { MainActivity.mBixolonPrinter.printBitmap(pathName, mAlignment, width, level, dither, compress, true); /* * You can choose the method. Please reference attached document. * MainActivity.mBixolonPrinter.getMonoPixels(pathName, width, level); */ } else { BitmapDrawable drawable = (BitmapDrawable)Resources.getDrawable(R.drawable.bixolon); Bitmap bitmap = drawable.Bitmap; MainActivity.mBixolonPrinter.printBitmap(bitmap, mAlignment, width, level, dither, compress, true); /* * You can choose the method. Please reference attached document. * MainActivity.mBixolonPrinter.getMonoPixels(bitmap, width, level); */ } } }
private void setPageMode() { RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); if (radioGroup.CheckedRadioButtonId == R.id.radio0) { MainActivity.mBixolonPrinter.setStandardMode(); } else { MainActivity.mBixolonPrinter.setPageMode(); radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio2: MainActivity.mBixolonPrinter.PrintDirection = BixolonPrinter.DIRECTION_0_DEGREE_ROTATION; break; case R.id.radio3: MainActivity.mBixolonPrinter.PrintDirection = BixolonPrinter.DIRECTION_90_DEGREE_ROTATION; break; case R.id.radio4: MainActivity.mBixolonPrinter.PrintDirection = BixolonPrinter.DIRECTION_180_DEGREE_ROTATION; break; case R.id.radio5: MainActivity.mBixolonPrinter.PrintDirection = BixolonPrinter.DIRECTION_270_DEGREE_ROTATION; break; } EditText editText = (EditText)findViewById(R.id.editText1); string @string = editText.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the horizontal start position again", Toast.LENGTH_SHORT).show(); return; } int x = int.Parse(@string); editText = (EditText)findViewById(R.id.editText2); @string = editText.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the vertical start position again", Toast.LENGTH_SHORT).show(); return; } int y = int.Parse(@string); editText = (EditText)findViewById(R.id.editText3); @string = editText.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the horizontal print area again", Toast.LENGTH_SHORT).show(); return; } int width = int.Parse(@string); editText = (EditText)findViewById(R.id.editText4); @string = editText.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the vertical print area again", Toast.LENGTH_SHORT).show(); return; } int height = int.Parse(@string); MainActivity.mBixolonPrinter.setPrintArea(x, y, width, height); } }
private void printLabel() { EditText editText = (EditText)findViewById(R.id.editText1); string data = editText.Text.ToString(); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "50"; } int horizontalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int verticalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText4); if (editText.Text.ToString().Equals("")) { editText.Text = "25"; } int width = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText5); if (editText.Text.ToString().Equals("")) { editText.Text = "25"; } int height = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText6); if (editText.Text.ToString().Equals("")) { editText.Text = "0"; } int rightSpace = int.Parse(editText.Text.ToString()); CheckBox checkBox = (CheckBox)findViewById(R.id.checkBox1); bool bold = checkBox.Checked; checkBox = (CheckBox)findViewById(R.id.checkBox2); bool reverse = checkBox.Checked; checkBox = (CheckBox)findViewById(R.id.checkBox3); bool italic = checkBox.Checked; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); int rotation = BixolonLabelPrinter.ROTATION_NONE; switch (radioGroup.CheckedRadioButtonId) { case R.id.radio1: rotation = BixolonLabelPrinter.ROTATION_90_DEGREES; break; case R.id.radio2: rotation = BixolonLabelPrinter.ROTATION_180_DEGREES; break; case R.id.radio3: rotation = BixolonLabelPrinter.ROTATION_270_DEGREES; break; } radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); int alignment = BixolonLabelPrinter.VECTOR_FONT_TEXT_ALIGNMENT_LEFT; switch (radioGroup.CheckedRadioButtonId) { case R.id.radio5: rotation = BixolonLabelPrinter.VECTOR_FONT_TEXT_ALIGNMENT_RIGHT; break; case R.id.radio6: rotation = BixolonLabelPrinter.VECTOR_FONT_TEXT_ALIGNMENT_CENTER; break; } radioGroup = (RadioGroup)findViewById(R.id.radioGroup3); int direction = BixolonLabelPrinter.VECTOR_FONT_TEXT_DIRECTION_LEFT_TO_RIGHT; if (radioGroup.CheckedRadioButtonId == R.id.radio8) { direction = BixolonLabelPrinter.VECTOR_FONT_TEXT_DIRECTION_RIGHT_TO_LEET; } MainActivity.mBixolonLabelPrinter.drawVectorFontText(data, horizontalPosition, verticalPosition, mFont, width, height, rightSpace, bold, reverse, italic, rotation, alignment, direction); MainActivity.mBixolonLabelPrinter.print(1, 1); }
public override void onClick(View v) { switch (v.Id) { case R.id.button1: RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio0: MainActivity.mBcd.ScrollMode = BixolonCustomerDisplay.MODE_OVERWRITE; break; case R.id.radio1: MainActivity.mBcd.ScrollMode = BixolonCustomerDisplay.MODE_VERTICAL; break; case R.id.radio2: MainActivity.mBcd.ScrollMode = BixolonCustomerDisplay.MODE_HORIZONTAL; break; } EditText editText = (EditText)findViewById(R.id.editText3); string @string = editText.Text.ToString(); if (@string.Length > 0) { int interval = int.Parse(@string); MainActivity.mBcd.BlinkInterval = interval; } radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio3: MainActivity.mBcd.DimmingControl = BixolonCustomerDisplay.BRIGHTNESS_20; break; case R.id.radio4: MainActivity.mBcd.DimmingControl = BixolonCustomerDisplay.BRIGHTNESS_40; break; case R.id.radio5: MainActivity.mBcd.DimmingControl = BixolonCustomerDisplay.BRIGHTNESS_60; break; case R.id.radio6: MainActivity.mBcd.DimmingControl = BixolonCustomerDisplay.BRIGHTNESS_100; break; } radioGroup = (RadioGroup)findViewById(R.id.radioGroup3); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio7: MainActivity.mBcd.clearLineBlinking(BixolonCustomerDisplay.UPPER_LINE); MainActivity.mBcd.clearLineBlinking(BixolonCustomerDisplay.LOWER_LINE); break; case R.id.radio8: MainActivity.mBcd.LineBlinking = BixolonCustomerDisplay.UPPER_LINE; break; case R.id.radio9: MainActivity.mBcd.LineBlinking = BixolonCustomerDisplay.LOWER_LINE; break; } editText = (EditText)findViewById(R.id.editText1); string text = editText.Text.ToString(); MainActivity.mBcd.writeString(text, BixolonCustomerDisplay.UPPER_LINE); editText = (EditText)findViewById(R.id.editText2); text = editText.Text.ToString(); MainActivity.mBcd.writeString(text, BixolonCustomerDisplay.LOWER_LINE); break; case R.id.button2: MainActivity.mBcd.clearScreen(); break; } }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { outerInstance.mWidthEdit.Enabled = checkedId == R.id.radio5; }
private void print1dBarcode() { EditText editText = (EditText)findViewById(R.id.editText1); if (editText.Text.ToString().Equals("")) { editText.Text = "1234567890"; } string data = editText.Text.ToString(); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "78"; } int horizontalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "196"; } int verticalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText4); if (editText.Text.ToString().Equals("")) { editText.Text = "2"; } int narrowBarWidth = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText5); if (editText.Text.ToString().Equals("")) { editText.Text = "6"; } int wideBarWidth = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText6); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int height = int.Parse(editText.Text.ToString()); RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); int rotation = BixolonLabelPrinter.ROTATION_NONE; switch (radioGroup.CheckedRadioButtonId) { case R.id.radio1: rotation = BixolonLabelPrinter.ROTATION_90_DEGREES; break; case R.id.radio2: rotation = BixolonLabelPrinter.ROTATION_180_DEGREES; break; case R.id.radio3: rotation = BixolonLabelPrinter.ROTATION_270_DEGREES; break; } editText = (EditText)findViewById(R.id.editText7); if (editText.Text.ToString().Equals("")) { editText.Text = "0"; } int quietZoneWidth = int.Parse(editText.Text.ToString()); MainActivity.mBixolonLabelPrinter.draw1dBarcode(data, horizontalPosition, verticalPosition, mBarcodeSelection, narrowBarWidth, wideBarWidth, height, rotation, mHri, quietZoneWidth); MainActivity.mBixolonLabelPrinter.print(1, 1); }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { outerInstance.mWidthEdit.Enabled = checkedId == R.id.radio5; }
private void printBarCode() { int barCodeSystem = 0; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio0: barCodeSystem = BixolonPrinter.BAR_CODE_UPC_A; break; case R.id.radio1: barCodeSystem = BixolonPrinter.BAR_CODE_UPC_E; break; case R.id.radio2: barCodeSystem = BixolonPrinter.BAR_CODE_EAN13; break; case R.id.radio3: barCodeSystem = BixolonPrinter.BAR_CODE_EAN8; break; case R.id.radio4: barCodeSystem = BixolonPrinter.BAR_CODE_CODE39; break; case R.id.radio5: barCodeSystem = BixolonPrinter.BAR_CODE_ITF; break; case R.id.radio6: barCodeSystem = BixolonPrinter.BAR_CODE_CODABAR; break; case R.id.radio7: barCodeSystem = BixolonPrinter.BAR_CODE_CODE93; break; case R.id.radio8: barCodeSystem = BixolonPrinter.BAR_CODE_CODE128; break; } string data = mDataEdit.Text.ToString(); if (data == null || data.Length == 0) { Toast.makeText(ApplicationContext, "Input bar code data", Toast.LENGTH_SHORT).show(); return; } int alignment = BixolonPrinter.ALIGNMENT_LEFT; radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio9: alignment = BixolonPrinter.ALIGNMENT_LEFT; break; case R.id.radio10: alignment = BixolonPrinter.ALIGNMENT_CENTER; break; case R.id.radio11: alignment = BixolonPrinter.ALIGNMENT_RIGHT; break; } EditText editText = (EditText)findViewById(R.id.editText2); string @string = editText.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the width again.", Toast.LENGTH_SHORT).show(); return; } int width = int.Parse(@string); editText = (EditText)findViewById(R.id.editText3); @string = editText.Text.ToString(); if (@string.Length == 0) { Toast.makeText(ApplicationContext, "Please enter the height again.", Toast.LENGTH_SHORT).show(); return; } int height = int.Parse(@string); int characterPosition = 0; radioGroup = (RadioGroup)findViewById(R.id.radioGroup3); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio12: characterPosition = BixolonPrinter.HRI_CHARACTER_NOT_PRINTED; break; case R.id.radio13: characterPosition = BixolonPrinter.HRI_CHARACTERS_ABOVE_BAR_CODE; break; case R.id.radio14: characterPosition = BixolonPrinter.HRI_CHARACTERS_BELOW_BAR_CODE; break; case R.id.radio15: characterPosition = BixolonPrinter.HRI_CHARACTERS_ABOVE_AND_BELOW_BAR_CODE; break; } CheckBox checkBox = (CheckBox)findViewById(R.id.checkBox1); if (checkBox.Checked) { MainActivity.mBixolonPrinter.print1dBarcode(data, barCodeSystem, alignment, width, height, characterPosition, false); MainActivity.mBixolonPrinter.formFeed(true); } else { MainActivity.mBixolonPrinter.print1dBarcode(data, barCodeSystem, alignment, width, height, characterPosition, true); } }
private void printLabel() { EditText editText = (EditText)findViewById(R.id.editText1); string data = editText.Text.ToString(); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "50"; } int horizontalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int verticalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText4); if (editText.Text.ToString().Equals("")) { editText.Text = "0"; } int rightSpace = int.Parse(editText.Text.ToString()); RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); int rotation = BixolonLabelPrinter.ROTATION_NONE; switch (radioGroup.CheckedRadioButtonId) { case R.id.radio1: rotation = BixolonLabelPrinter.ROTATION_90_DEGREES; break; case R.id.radio2: rotation = BixolonLabelPrinter.ROTATION_180_DEGREES; break; case R.id.radio3: rotation = BixolonLabelPrinter.ROTATION_270_DEGREES; break; } CheckBox checkBox = (CheckBox)findViewById(R.id.checkBox1); bool reverse = checkBox.Checked; checkBox = (CheckBox)findViewById(R.id.checkBox2); bool bold = checkBox.Checked; radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); int alignment = BixolonLabelPrinter.TEXT_ALIGNMENT_NONE; switch (radioGroup.CheckedRadioButtonId) { case R.id.radio5: alignment = BixolonLabelPrinter.TEXT_ALIGNMENT_LEFT; break; case R.id.radio6: alignment = BixolonLabelPrinter.TEXT_ALIGNMENT_RIGHT; break; case R.id.radio7: alignment = BixolonLabelPrinter.TEXT_ALIGNMENT_RIGHT_TO_LEFT; break; } MainActivity.mBixolonLabelPrinter.drawText(data, horizontalPosition, verticalPosition, mFontSize, mHorizontalMultiplier, mVerticalMultiplier, rightSpace, rotation, reverse, bold, alignment); MainActivity.mBixolonLabelPrinter.print(1, 1); }
private void printPdf417() { EditText editText = (EditText)findViewById(R.id.editText1); if (editText.Text.ToString().Equals("")) { editText.Text = "BIXOLON Label Printer"; } string data = editText.Text.ToString(); editText = (EditText)findViewById(R.id.editText2); if (editText.Text.ToString().Equals("")) { editText.Text = "100"; } int horizontalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText3); if (editText.Text.ToString().Equals("")) { editText.Text = "750"; } int verticalPosition = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText4); if (editText.Text.ToString().Equals("")) { editText.Text = "30"; } int maxRow = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText5); if (editText.Text.ToString().Equals("")) { editText.Text = "5"; } int maxColumn = int.Parse(editText.Text.ToString()); int compression = BixolonLabelPrinter.DATA_COMPRESSION_TEXT; RadioGroup radioGroup = (RadioGroup)findViewById(R.id.radioGroup1); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio1: compression = BixolonLabelPrinter.DATA_COMPRESSION_NUMERIC; break; case R.id.radio2: compression = BixolonLabelPrinter.DATA_COMPRESSION_BINARY; break; } int hri = BixolonLabelPrinter.PDF417_HRI_NOT_PRINTED; radioGroup = (RadioGroup)findViewById(R.id.radioGroup2); if (radioGroup.CheckedRadioButtonId == R.id.radio4) { hri = BixolonLabelPrinter.PDF417_HRI_BELOW_BARCODE; } int originPoint = BixolonLabelPrinter.BARCODE_ORIGIN_POINT_UPPER_LEFT; radioGroup = (RadioGroup)findViewById(R.id.radioGroup3); if (radioGroup.CheckedRadioButtonId == R.id.radio5) { originPoint = BixolonLabelPrinter.BARCODE_ORIGIN_POINT_CENTER; } editText = (EditText)findViewById(R.id.editText6); if (editText.Text.ToString().Equals("")) { editText.Text = "3"; } int width = int.Parse(editText.Text.ToString()); editText = (EditText)findViewById(R.id.editText7); if (editText.Text.ToString().Equals("")) { editText.Text = "10"; } int height = int.Parse(editText.Text.ToString()); int rotation = BixolonLabelPrinter.ROTATION_NONE; radioGroup = (RadioGroup)findViewById(R.id.radioGroup4); switch (radioGroup.CheckedRadioButtonId) { case R.id.radio8: rotation = BixolonLabelPrinter.ROTATION_90_DEGREES; break; case R.id.radio9: rotation = BixolonLabelPrinter.ROTATION_180_DEGREES; break; case R.id.radio10: rotation = BixolonLabelPrinter.ROTATION_270_DEGREES; break; } MainActivity.mBixolonLabelPrinter.drawPdf417(data, horizontalPosition, verticalPosition, maxRow, maxColumn, mErrorCorrectionLevel, compression, hri, originPoint, width, height, rotation); MainActivity.mBixolonLabelPrinter.print(1, 1); }