private void insertCheckBox() { android.view.LayoutInflater inflater = getInflater(); mCheckBox = (android.widget.CheckBox)inflater.inflate([email protected]. list_menu_item_checkbox, this, false); addView(mCheckBox); }
//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_cash_drawer, 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_POS_PRINTER, getString([email protected]_drawer)); 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; deviceEnabledCheckBox = (CheckBox) view.findViewById(R.id.checkBoxDeviceEnabled); deviceEnabledCheckBox.OnCheckedChangeListener = this; view.findViewById(R.id.buttonOpenDrawer).OnClickListener = this; view.findViewById(R.id.buttonGetDrawerOpened).OnClickListener = this; stateTextView = (TextView) view.findViewById(R.id.textViewState); deviceMessagesTextView = (TextView) view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; return view; }
//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); }
//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_cash_drawer, 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_POS_PRINTER, getString([email protected]_drawer)); 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; deviceEnabledCheckBox = (CheckBox)view.findViewById(R.id.checkBoxDeviceEnabled); deviceEnabledCheckBox.OnCheckedChangeListener = this; view.findViewById(R.id.buttonOpenDrawer).OnClickListener = this; view.findViewById(R.id.buttonGetDrawerOpened).OnClickListener = this; stateTextView = (TextView)view.findViewById(R.id.textViewState); deviceMessagesTextView = (TextView)view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; 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); }
//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_pos_printer_common, 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_POS_PRINTER, getString([email protected]_printer)); 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; deviceEnabledCheckBox = (CheckBox)view.findViewById(R.id.checkBoxDeviceEnabled); deviceEnabledCheckBox.OnCheckedChangeListener = this; asyncModeCheckBox = (CheckBox)view.findViewById(R.id.checkBoxAsyncMode); asyncModeCheckBox.OnCheckedChangeListener = this; try { deviceEnabledCheckBox.Checked = posPrinter.DeviceEnabled; } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } try { asyncModeCheckBox.Checked = posPrinter.AsyncMode; } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } stateTextView = (TextView)view.findViewById(R.id.textViewState); deviceMessagesTextView = (TextView)view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; return(view); }
//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_pos_printer_common, 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_POS_PRINTER, getString([email protected]_printer)); 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; deviceEnabledCheckBox = (CheckBox) view.findViewById(R.id.checkBoxDeviceEnabled); deviceEnabledCheckBox.OnCheckedChangeListener = this; asyncModeCheckBox = (CheckBox) view.findViewById(R.id.checkBoxAsyncMode); asyncModeCheckBox.OnCheckedChangeListener = this; try { deviceEnabledCheckBox.Checked = posPrinter.DeviceEnabled; } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } try { asyncModeCheckBox.Checked = posPrinter.AsyncMode; } catch (JposException e) { // TODO Auto-generated catch block Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } stateTextView = (TextView) view.findViewById(R.id.textViewState); deviceMessagesTextView = (TextView) view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; return view; }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_direct_io; mCommandEdit = (EditText) findViewById(R.id.editText1); mResponseLengthEdit = (EditText) findViewById(R.id.editText2); mCheckBox = (CheckBox) findViewById(R.id.checkBox1); mCheckBox.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); Button button = (Button) findViewById(R.id.button1); button.OnClickListener = this; button = (Button) findViewById(R.id.button2); button.OnClickListener = this; }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_direct_io; mCommandEdit = (EditText)findViewById(R.id.editText1); mResponseLengthEdit = (EditText)findViewById(R.id.editText2); mCheckBox = (CheckBox)findViewById(R.id.checkBox1); mCheckBox.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this); Button button = (Button)findViewById(R.id.button1); button.OnClickListener = this; button = (Button)findViewById(R.id.button2); button.OnClickListener = this; }
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 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); }
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); }
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 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); } }