mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
|||
package com.adins.mss.odr.tool;
|
||||
|
||||
import com.adins.mss.dao.TaskD;
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JsonResponseImage extends MssResponseType {
|
||||
@SerializedName("img")
|
||||
List<TaskD> img;
|
||||
|
||||
public List<TaskD> getImg() {
|
||||
return this.img;
|
||||
}
|
||||
|
||||
public void setImg(List<TaskD> value) {
|
||||
this.img = value;
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,707 @@
|
|||
package com.adins.mss.base.log;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.dao.LogoPrint;
|
||||
import com.adins.mss.dao.PrintResult;
|
||||
import com.adins.mss.foundation.db.dataaccess.LogoPrintDataAccess;
|
||||
import com.bixolon.printer.BixolonPrinter;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class BixolonPrintManager extends AbstractPrintManager {
|
||||
|
||||
public static final int LINE_LENGTH = 32;
|
||||
// bong Oct 28th, 2014 adding code from fif
|
||||
protected static final String TAG = null;
|
||||
/* PRINT ITEM TYPE */
|
||||
public static String PRINT_NO_ANSWER = "001";
|
||||
public static String PRINT_ANSWER = "002";
|
||||
//Glen 9 Aug 2014, new type : timestamp
|
||||
public static String PRINT_TIMESTAMP = "004";
|
||||
// bong Oct 28th, 2014 - adding from fif
|
||||
public static String PRINT_LOGO = "005";
|
||||
public static String PRINT_USER = "006";
|
||||
public static String PRINT_LABEL_CENTER = "007";
|
||||
public static String PRINT_LABEL_CENTER_BOLD = "008";
|
||||
public static String PRINT_PRINTER_ID = "003";
|
||||
Context context;
|
||||
// bong Oct 28th, 2014 - adding code from fif
|
||||
public final Handler mHandler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
switch (msg.what) {
|
||||
case BixolonPrinter.MESSAGE_STATE_CHANGE:
|
||||
switch (msg.arg1) {
|
||||
case BixolonPrinter.STATE_CONNECTING:
|
||||
|
||||
break;
|
||||
case BixolonPrinter.STATE_CONNECTED:
|
||||
connected = true;
|
||||
break;
|
||||
case BixolonPrinter.STATE_NONE:
|
||||
connected = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case BixolonPrinter.MESSAGE_DEVICE_NAME:
|
||||
break;
|
||||
case BixolonPrinter.MESSAGE_TOAST:
|
||||
Toast.makeText(
|
||||
context.getApplicationContext(),
|
||||
msg.getData()
|
||||
.getString(BixolonPrinter.KEY_STRING_TOAST),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
Bitmap logo;
|
||||
List<PrintResult> listOfPrint;
|
||||
private BxlService mBxlService;
|
||||
|
||||
// bong Oct 28th, 2014 - adding code from fif
|
||||
public BixolonPrintManager(Context context, List<PrintResult> listOfPrint) {
|
||||
super(listOfPrint);
|
||||
// bong Oct 28th, 2014 adding code from fif
|
||||
this.context = context;
|
||||
this.listOfPrint = listOfPrint;
|
||||
|
||||
//olivia : utk dapat logo sesuai nama tenant
|
||||
String tenant = GlobalData.getSharedGlobalData().getTenant();
|
||||
int pos = tenant.indexOf("@");
|
||||
String tenantName = tenant.substring(pos+1, tenant.length());
|
||||
|
||||
LogoPrint logoPrint = LogoPrintDataAccess.getOne(context, tenantName);
|
||||
if (logoPrint != null) {
|
||||
this.logo = BitmapFactory.decodeByteArray(logoPrint.getImage_bitmap(), 0, logoPrint.getImage_bitmap().length);
|
||||
} else {
|
||||
BitmapDrawable drawable = null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
drawable = (BitmapDrawable) context.getResources().getDrawable(R.drawable.adins_logo, context.getTheme());
|
||||
} else {
|
||||
drawable = (BitmapDrawable) context.getResources().getDrawable(R.drawable.adins_logo);
|
||||
}
|
||||
this.logo = drawable.getBitmap();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean connect() throws Exception {
|
||||
if (!connected) {
|
||||
// bong Oct 28th, 2014 - adding code from fif
|
||||
mBxlService = new BxlService(BixolonPrintManager.this);
|
||||
if (mBxlService.Connect() == BxlService.BXL_SUCCESS) {
|
||||
connected = true;
|
||||
} else {
|
||||
connected = false;
|
||||
}
|
||||
}
|
||||
return connected;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean disconnect() throws Exception {
|
||||
if (connected && mBxlService != null) {
|
||||
mBxlService.Disconnect();
|
||||
mBxlService = null;
|
||||
connected = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private String getDataToPrint(List<PrintResult> listOfPrint) {
|
||||
int verticalPosition = 96; // 96, sebagai posisi awal
|
||||
char start = (char) 27;
|
||||
char end = (char) 3;
|
||||
|
||||
StringBuilder sbToPrint = new StringBuilder();
|
||||
for (PrintResult bean : listOfPrint) {
|
||||
|
||||
String type = bean.getPrint_type_id();
|
||||
String vPosition = "";
|
||||
|
||||
if ((verticalPosition + 33) < 100) {
|
||||
verticalPosition = verticalPosition + 33;
|
||||
vPosition = "00" + verticalPosition;
|
||||
} else if ((verticalPosition + 33) < 1000) {
|
||||
verticalPosition = verticalPosition + 33;
|
||||
vPosition = "0" + verticalPosition;
|
||||
} else {
|
||||
vPosition = "" + verticalPosition;
|
||||
verticalPosition = verticalPosition + 33;
|
||||
|
||||
}
|
||||
if (PRINT_NO_ANSWER.equals(type)) {
|
||||
String label = bean.getLabel();
|
||||
sbToPrint.append(start).append(
|
||||
"L" + vPosition + "000101111000");
|
||||
sbToPrint.append(start).append("D" + label);
|
||||
} else if (PRINT_LABEL_CENTER.equals(type)) {
|
||||
String label = bean.getLabel();
|
||||
// nilai sebenarnya 384, dikurangi aj bt jaga2 kalo slah perhtungan
|
||||
Vector vt = FontSato.wrap(374, label.trim());
|
||||
|
||||
for (int j = 0; j < vt.size(); j++) {
|
||||
SentencesSato setn = null;
|
||||
|
||||
try {
|
||||
setn = (SentencesSato) vt.elementAt(j);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
|
||||
// ------------- agar posisi bisa ditengah,
|
||||
if(setn == null)
|
||||
continue;
|
||||
|
||||
int iHposition = (384 - setn.getLenghtSentemce()) / 2;
|
||||
String sHposition = "0";
|
||||
|
||||
if (iHposition < 10) {
|
||||
sHposition = "000" + iHposition;
|
||||
} else if (iHposition < 100) {
|
||||
sHposition = "00" + iHposition;
|
||||
} else if (iHposition < 1000) {
|
||||
sHposition = "0" + iHposition;
|
||||
}
|
||||
// -------------
|
||||
|
||||
if (j == 0) {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ sHposition
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
|
||||
} else {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPrintPosition(verticalPosition)
|
||||
+ sHposition
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
|
||||
verticalPosition = verticalPosition + 33;
|
||||
}
|
||||
|
||||
}
|
||||
} else if (PRINT_ANSWER.equals(type)) {
|
||||
String label = bean.getLabel();
|
||||
String answer = bean.getValue();
|
||||
if (answer != null && !answer.equals("")) {
|
||||
if (label.equals("")
|
||||
|| label == null
|
||||
|| label.equals("null")) { // jika pertanyaan tidak ada labelnya maka posisi ditengahkan
|
||||
// nilai sebenarnya 384, dikurangi aj bt jaga2 kalo slah perhtungan
|
||||
Vector vt = FontSato.wrap(374, answer.trim());
|
||||
|
||||
for (int j = 0; j < vt.size(); j++) {
|
||||
|
||||
SentencesSato setn = null;
|
||||
|
||||
try {
|
||||
setn = (SentencesSato) vt.elementAt(j);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
|
||||
// ------------- agar posisi bisa ditengah,
|
||||
int iHposition = (384 - setn.getLenghtSentemce()) / 2;
|
||||
String sHposition = "0";
|
||||
|
||||
if (iHposition < 10) {
|
||||
sHposition = "000" + iHposition;
|
||||
} else if (iHposition < 100) {
|
||||
sHposition = "00" + iHposition;
|
||||
} else if (iHposition < 1000) {
|
||||
sHposition = "0" + iHposition;
|
||||
}
|
||||
// -------------
|
||||
|
||||
if (j == 0) {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ sHposition
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
} else {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPrintPosition(verticalPosition)
|
||||
+ sHposition
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
verticalPosition = verticalPosition + 33;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "000101111000");
|
||||
sbToPrint.append(start).append("D" + label);
|
||||
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "020001111000");
|
||||
sbToPrint.append(start).append("D:");
|
||||
|
||||
Vector vt = FontSato.wrap(166, answer.trim()); // panjang area yang akan diprint
|
||||
|
||||
for (int j = 0; j < vt.size(); j++) {
|
||||
|
||||
SentencesSato setn = null;
|
||||
|
||||
try {
|
||||
setn = (SentencesSato) vt.elementAt(j);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
if (j == 0) {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "0208"
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
} else {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPrintPosition(verticalPosition)
|
||||
+ "0208"
|
||||
+ "01111000");
|
||||
verticalPosition = verticalPosition + 33;
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
verticalPosition = verticalPosition - 33;
|
||||
}
|
||||
} else if (PRINT_USER.equals(type)) {
|
||||
String label = bean.getLabel();
|
||||
String answer = GlobalData.getSharedGlobalData().getUser().getLogin_id();
|
||||
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "000101111000");
|
||||
sbToPrint.append(start).append("D" + label);
|
||||
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "020001111000");
|
||||
sbToPrint.append(start).append("D:");
|
||||
|
||||
Vector vt = FontSato.wrap(166, answer.trim()); // panjang area yang akan diprint
|
||||
|
||||
for (int j = 0; j < vt.size(); j++) {
|
||||
|
||||
SentencesSato setn = null;
|
||||
|
||||
try {
|
||||
setn = (SentencesSato) vt.elementAt(j);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
if (j == 0) {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "0208"
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
} else {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPrintPosition(verticalPosition)
|
||||
+ "0208"
|
||||
+ "01111000");
|
||||
verticalPosition = verticalPosition + 33;
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
}
|
||||
|
||||
}
|
||||
} else if (PRINT_TIMESTAMP.equals(type)) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy hh:mm");
|
||||
Date date = new Date();
|
||||
String answer = df.format(date);
|
||||
String label = bean.getLabel();
|
||||
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "000101111000");
|
||||
sbToPrint.append(start).append("D" + label);
|
||||
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "020001111000");
|
||||
sbToPrint.append(start).append("D:");
|
||||
|
||||
Vector vt = FontSato.wrap(166, answer.trim()); // panjang area yang akan diprint
|
||||
|
||||
for (int j = 0; j < vt.size(); j++) {
|
||||
|
||||
SentencesSato setn = null;
|
||||
|
||||
try {
|
||||
setn = (SentencesSato) vt.elementAt(j);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
if (j == 0) {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPosition
|
||||
+ "0208"
|
||||
+ "01111000");
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
} else {
|
||||
sbToPrint.append(start).append("L"
|
||||
+ vPrintPosition(verticalPosition)
|
||||
+ "0208"
|
||||
+ "01111000");
|
||||
verticalPosition = verticalPosition + 33;
|
||||
sbToPrint.append(start).append("D"
|
||||
+ setn.getSentence().trim());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// ENDING LINE
|
||||
verticalPosition = verticalPosition + 33;
|
||||
sbToPrint.append(start).append(
|
||||
"L" + vPrintPosition(verticalPosition) + "000101222000");
|
||||
sbToPrint.append(start).append("D----------------");
|
||||
|
||||
sbToPrint.append(start).append("Q0001").append(start).append("Z");
|
||||
sbToPrint.append(end);
|
||||
|
||||
return sbToPrint.toString();
|
||||
}
|
||||
|
||||
public String vPrintPosition(int verticalPosition) {
|
||||
String vPosition = "";
|
||||
if ((verticalPosition + 33) < 100) {
|
||||
verticalPosition = verticalPosition + 33;
|
||||
vPosition = "00" + verticalPosition;
|
||||
} else if ((verticalPosition + 33) < 1000) {
|
||||
verticalPosition = verticalPosition + 33;
|
||||
vPosition = "0" + verticalPosition;
|
||||
} else {
|
||||
vPosition = "" + verticalPosition;
|
||||
}
|
||||
|
||||
return vPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean printSato() throws Exception {
|
||||
if (connected) {
|
||||
mBxlService.PrintTextSato(this.getDataToPrint(list));
|
||||
} else {
|
||||
throw new Exception("Device is not connected to the printer.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private String getDataToPrintZebra() {
|
||||
|
||||
for (PrintResult bean : listOfPrint) {
|
||||
|
||||
String type = bean.getPrint_type_id();
|
||||
if (PRINT_NO_ANSWER.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String label = bean.getLabel();
|
||||
sb.append(label);
|
||||
sb.append(blank);
|
||||
} else if (PRINT_LABEL_CENTER.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
//1 line = 48 char
|
||||
int spaceLength = (48 - labelLen) / 2;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(label);
|
||||
} else if (PRINT_USER.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
String value = GlobalData.getSharedGlobalData().getUser().getLogin_id();
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
} else if (PRINT_ANSWER.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
if (label == null || label.equals("")) {
|
||||
//question no label = center
|
||||
String value = bean.getValue();
|
||||
int valueLen = value.length();
|
||||
int spaceLength = (48 - valueLen) / 2;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(value);
|
||||
} else {
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
String value = bean.getValue();
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
}
|
||||
} else if (PRINT_TIMESTAMP.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy hh:mm");
|
||||
Date date = new Date();
|
||||
String value = df.format(date);
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
} else if (PRINT_LOGO.equals(type)) {
|
||||
mBxlService.PrintImageZebra(logo,
|
||||
BxlService.BXL_WIDTH_FULL, BxlService.BXL_ALIGNMENT_CENTER, 20);
|
||||
}
|
||||
// bong Oct 29th, 2014 - add printer_id
|
||||
else if (PRINT_PRINTER_ID.equals(type)) {
|
||||
BluetoothDevice bd = mBxlService.getmDevice();
|
||||
if (bean.getValue() == null || "".equals(bean.getValue()))
|
||||
bean.setValue(bd.getAddress());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
if (label == null || label.equals("")) {
|
||||
//question no label = center
|
||||
String value = bean.getValue();
|
||||
int valueLen = value.length();
|
||||
int spaceLength = (48 - valueLen) / 2;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(value);
|
||||
} else {
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
String value = bean.getValue();
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean printZebra() throws Exception {
|
||||
if (connected) {
|
||||
this.getDataToPrintZebra();
|
||||
} else {
|
||||
throw new Exception("Device is not connected to the printer.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean print() throws Exception {
|
||||
boolean isNeedFeedLine = true;
|
||||
if (connected) {
|
||||
for (PrintResult bean : list) {
|
||||
String type = bean.getPrint_type_id();
|
||||
if (PRINT_NO_ANSWER.equals(type)) {
|
||||
mBxlService.PrintText(bean.getLabel(),
|
||||
BxlService.BXL_ALIGNMENT_LEFT, BxlService.BXL_FT_DEFAULT,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
}
|
||||
|
||||
// bong Oct 28th, 2014 - adding code from fif
|
||||
else if (PRINT_LABEL_CENTER.equals(type)) {
|
||||
mBxlService.PrintText(bean.getLabel(),
|
||||
BxlService.BXL_ALIGNMENT_CENTER, BxlService.BXL_FT_DEFAULT,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
} else if (PRINT_LABEL_CENTER_BOLD.equals(type)) {
|
||||
mBxlService.PrintText(bean.getLabel(),
|
||||
BxlService.BXL_ALIGNMENT_CENTER, BxlService.BXL_FT_BOLD,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
} else if (PRINT_LOGO.equals(type)) {
|
||||
int SDK_INT = android.os.Build.VERSION.SDK_INT;
|
||||
if (SDK_INT < 14) {
|
||||
//di bawah ICS masuk sini
|
||||
mBxlService.PrintImage(logo,
|
||||
BxlService.BXL_WIDTH_FULL, BxlService.BXL_ALIGNMENT_CENTER, 20);
|
||||
} else {
|
||||
mBxlService.printBitmap(logo,
|
||||
BixolonPrinter.ALIGNMENT_CENTER, 384, 63, true);
|
||||
}
|
||||
} else if (PRINT_USER.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
String value = GlobalData.getSharedGlobalData().getUser().getLogin_id();
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
|
||||
mBxlService.PrintText(sb.toString(),
|
||||
BxlService.BXL_ALIGNMENT_LEFT, BxlService.BXL_FT_DEFAULT,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
} else if (PRINT_TIMESTAMP.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy hh:mm");
|
||||
Date date = new Date();
|
||||
String value = df.format(date);
|
||||
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
|
||||
mBxlService.PrintText(sb.toString(),
|
||||
BxlService.BXL_ALIGNMENT_LEFT, BxlService.BXL_FT_DEFAULT,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
} else if (PRINT_ANSWER.equals(type)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
String value = bean.getValue();
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
|
||||
mBxlService.PrintText(sb.toString(),
|
||||
BxlService.BXL_ALIGNMENT_LEFT, BxlService.BXL_FT_DEFAULT,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
}
|
||||
// bong Oct 29th, 2014 - add printer_id
|
||||
else if (PRINT_PRINTER_ID.equals(type)) {
|
||||
BluetoothDevice bd = mBxlService.getmDevice();
|
||||
if (bean.getValue() == null || "".equals(bean.getValue()))
|
||||
bean.setValue(bd.getAddress());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String label = bean.getLabel();
|
||||
int labelLen = label.length();
|
||||
sb.append(label);
|
||||
int spaceLength = separatorStart - labelLen;
|
||||
while (spaceLength > 0) {
|
||||
sb.append(blank);
|
||||
spaceLength--;
|
||||
}
|
||||
sb.append(valueSeparator);
|
||||
sb.append(blank);
|
||||
|
||||
String value = bean.getValue();
|
||||
value = (value == null) ? "" : value;
|
||||
sb.append(value);
|
||||
|
||||
mBxlService.PrintText(sb.toString(),
|
||||
BxlService.BXL_ALIGNMENT_LEFT, BxlService.BXL_FT_DEFAULT,
|
||||
BxlService.BXL_TS_0WIDTH | BxlService.BXL_TS_0HEIGHT);
|
||||
}
|
||||
if (isNeedFeedLine) {
|
||||
mBxlService.LineFeed(1);
|
||||
} else {
|
||||
isNeedFeedLine = true;
|
||||
}
|
||||
|
||||
}
|
||||
mBxlService.LineFeed(2);
|
||||
} else {
|
||||
throw new Exception("Device is not connected to the printer.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,184 @@
|
|||
package com.adins.mss.base.about.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.base.todolist.form.TaskList_Fragment;
|
||||
import com.adins.mss.base.util.Utility;
|
||||
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
|
||||
import com.github.jjobes.slidedatetimepicker.SlidingTabLayout;
|
||||
|
||||
//import static com.google.android.gms.internal.a.R;
|
||||
|
||||
/**
|
||||
* Created by gigin.ginanjar on 15/08/2016.
|
||||
*/
|
||||
public class AboutInfoTab extends Fragment {
|
||||
public static boolean isMenuClicked = false;
|
||||
private static Menu mainMenu;
|
||||
View view;
|
||||
private Context mContext;
|
||||
private ViewPager mViewPager;
|
||||
private ViewPagerAdapter mViewPagerAdapter;
|
||||
private SlidingTabLayout mSlidingTabLayout;
|
||||
private boolean isError = false;
|
||||
private String message;
|
||||
private Fragment activeFragment;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context activity) {
|
||||
super.onAttach(activity);
|
||||
|
||||
mContext = activity;
|
||||
try {
|
||||
isError = getArguments().getBoolean(TaskList_Fragment.BUND_KEY_ISERROR, false);
|
||||
message = getArguments().getString(TaskList_Fragment.BUND_KEY_MESSAGE, "");
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setRetainInstance(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
view = inflater.inflate(R.layout.about_info_tab, container, false);
|
||||
|
||||
//2017/09/07 | Nendi: add Title on toolbar
|
||||
getActivity().findViewById(com.adins.mss.base.R.id.search).setVisibility(View.GONE);
|
||||
getActivity().findViewById(R.id.spinner).setVisibility(View.GONE);
|
||||
getActivity().setTitle(getString(R.string.title_mn_about));
|
||||
|
||||
setupViews(view);
|
||||
initViewPager();
|
||||
initTabs();
|
||||
setHasOptionsMenu(true);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void initTabs() {
|
||||
// Set intial date on date tab
|
||||
updateAppTab();
|
||||
|
||||
// Set initial time on time tab
|
||||
updateDeviceTab();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
try {
|
||||
mainMenu.findItem(R.id.menuMore).setVisible(false);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
super.onDestroyView();
|
||||
Utility.freeMemory();
|
||||
}
|
||||
|
||||
private void updateAppTab() {
|
||||
mSlidingTabLayout.setTabText(1, getResources().getString(R.string.tabDevice));
|
||||
}
|
||||
|
||||
private void updateDeviceTab() {
|
||||
mSlidingTabLayout.setTabText(0, getResources().getString(R.string.tabApplication));
|
||||
}
|
||||
|
||||
private void initViewPager() {
|
||||
mViewPagerAdapter = new ViewPagerAdapter(getChildFragmentManager());
|
||||
mViewPager.setAdapter(mViewPagerAdapter);
|
||||
|
||||
// Setting this custom layout for each tab ensures that the tabs will
|
||||
// fill all available horizontal space.
|
||||
|
||||
mSlidingTabLayout.setCustomTabView(R.layout.custom_tab_tasklist, R.id.tabTextTaskList);
|
||||
mSlidingTabLayout.setSelectedIndicatorColors(ContextCompat.getColor(getActivity(), R.color.tv_white),
|
||||
ContextCompat.getColor(getActivity(), R.color.tv_white));
|
||||
mSlidingTabLayout.setDividerColors(ContextCompat.getColor(getActivity(), R.color.tv_white),
|
||||
ContextCompat.getColor(getActivity(), R.color.tv_white));
|
||||
mSlidingTabLayout.setViewPager(mViewPager);
|
||||
if (isError) {
|
||||
isError = false;
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(getActivity());
|
||||
|
||||
if (!dialogBuilder.isShowing()) {
|
||||
dialogBuilder.withTitle(getResources().getString(R.string.warning_capital)).
|
||||
withMessage(message).isCancelable(true).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setupViews(View v) {
|
||||
mViewPager = (ViewPager) v.findViewById(R.id.pager);
|
||||
mSlidingTabLayout = (SlidingTabLayout) v.findViewById(R.id.slidingTabLayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
// isMenuClicked = false;
|
||||
// getActivity().getActionBar().setTitle(getString(R.string.title_mn_about));
|
||||
Utility.freeMemory();
|
||||
// MainMenuActivity.setDrawerPosition(getString(R.string.title_mn_about));
|
||||
// if(view!=null) {
|
||||
// initViewPager();
|
||||
// initTabs();
|
||||
// }
|
||||
getActivity().findViewById(com.adins.mss.base.R.id.search).setVisibility(View.GONE);
|
||||
getActivity().findViewById(R.id.spinner).setVisibility(View.GONE);
|
||||
getActivity().setTitle(getString(R.string.title_mn_about));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
}
|
||||
|
||||
private class ViewPagerAdapter extends FragmentPagerAdapter {
|
||||
public ViewPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
Fragment fragment = null;
|
||||
switch (position) {
|
||||
case 0:
|
||||
fragment = new AboutActivity();
|
||||
break;
|
||||
case 1:
|
||||
fragment = new DeviceInfoFragment();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package com.adins.mss.base.dynamicform.form.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
|
||||
public class CheckRejectedOrderResponse extends MssResponseType {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.adins.mss.base.todolist.form;
|
||||
|
||||
import com.adins.mss.dao.TaskH;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by kusnendi.muhamad on 27/07/2017.
|
||||
*/
|
||||
|
||||
public interface TasklistListener {
|
||||
public void onRefreshBackgroundCancelled(boolean value);
|
||||
|
||||
public void onRefreshBackgroundComplete(List<TaskH> result);
|
||||
}
|
|
@ -0,0 +1,205 @@
|
|||
package com.adins.mss.coll.fragments;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.pdf.PdfRenderer;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.adins.mss.coll.R;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.github.chrisbanes.photoview.PhotoView;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PdfRendererFragment extends Fragment implements View.OnClickListener {
|
||||
|
||||
private ParcelFileDescriptor mFileDescriptor;
|
||||
private PdfRenderer mPdfRenderer;
|
||||
private LinearLayout pdfLayout;
|
||||
private int mPageIndex;
|
||||
private PdfRenderer.Page mCurrentPage;
|
||||
|
||||
private String urlFileName;
|
||||
private String documentNameTitle;
|
||||
|
||||
|
||||
private TextView documentName;
|
||||
private PhotoView mImageView;
|
||||
private Button mButtonPrevious;
|
||||
private Button mButtonNext;
|
||||
|
||||
int displayWidth = 0;
|
||||
int displayHeight = 0;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_pdf_renderer, container, false);
|
||||
|
||||
documentName = (TextView) view.findViewById(R.id.documentNameTitle);
|
||||
mImageView = (PhotoView) view.findViewById(R.id.pdfImage);
|
||||
mButtonNext = view.findViewById(R.id.next);
|
||||
mButtonPrevious = view.findViewById(R.id.previous);
|
||||
pdfLayout = view.findViewById(R.id.pdfLayout);
|
||||
mButtonNext.setOnClickListener(this);
|
||||
mButtonPrevious.setOnClickListener(this);
|
||||
mPageIndex = 0;
|
||||
|
||||
if(getArguments() != null){
|
||||
urlFileName = getArguments().getString("URL_FILE");
|
||||
documentNameTitle = getArguments().getString("documentName");
|
||||
documentName.setText(documentNameTitle);
|
||||
}
|
||||
|
||||
pdfLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
pdfLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
displayWidth = pdfLayout.getWidth();
|
||||
displayHeight = pdfLayout.getHeight();
|
||||
try {
|
||||
openRenderer(getActivity(), urlFileName);
|
||||
showPage(mPageIndex);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(getActivity(), getString(com.adins.mss.base.R.string.not_available), Toast.LENGTH_SHORT).show();
|
||||
getActivity().finish();
|
||||
} catch (Exception ex) {
|
||||
if (Global.IS_DEV) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
Toast.makeText(getActivity(), getString(com.adins.mss.base.R.string.not_available), Toast.LENGTH_SHORT).show();
|
||||
getActivity().finish();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// try {
|
||||
// openRenderer(getActivity(), urlFileName);
|
||||
// showPage(mPageIndex);
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// Toast.makeText(getActivity(), getString(com.adins.mss.base.R.string.not_available), Toast.LENGTH_SHORT).show();
|
||||
// getActivity().finish();
|
||||
// } catch (Exception ex) {
|
||||
// if (Global.IS_DEV) {
|
||||
// ex.printStackTrace();
|
||||
// }
|
||||
// Toast.makeText(getActivity(), getString(com.adins.mss.base.R.string.not_available), Toast.LENGTH_SHORT).show();
|
||||
// getActivity().finish();
|
||||
// }
|
||||
}
|
||||
|
||||
private void openRenderer(Context context, String urlFileName) throws IOException {
|
||||
|
||||
File file = new File(urlFileName);
|
||||
if (!file.exists()) {
|
||||
throw new IOException("File not found: " + urlFileName);
|
||||
}
|
||||
mFileDescriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
|
||||
if (mFileDescriptor != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
mPdfRenderer = new PdfRenderer(mFileDescriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void showPage(int index) {
|
||||
if (mPdfRenderer.getPageCount() <= index) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (null != mCurrentPage) {
|
||||
mCurrentPage.close();
|
||||
}
|
||||
|
||||
mCurrentPage = mPdfRenderer.openPage(index);
|
||||
|
||||
int pageWidth = mCurrentPage.getWidth();
|
||||
int pageHeight = mCurrentPage.getHeight();
|
||||
|
||||
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
|
||||
// int displayWidth = displayMetrics.widthPixels;
|
||||
// int displayHeight = displayMetrics.heightPixels;
|
||||
|
||||
// int displayWidth = pdfLayout.getWidth();
|
||||
// int displayHeight = pdfLayout.getHeight();
|
||||
|
||||
float scaleX = (float) displayWidth / pageWidth;
|
||||
float scaleY = (float) displayHeight / pageHeight;
|
||||
float scale = Math.min(scaleX, scaleY);
|
||||
|
||||
int newWidth = Math.round(pageWidth * scale);
|
||||
int newHeight = Math.round(pageHeight * scale);
|
||||
|
||||
Bitmap bitmap = Bitmap.createBitmap(newWidth, newHeight, Bitmap.Config.ARGB_8888);
|
||||
|
||||
Matrix matrix = new Matrix();
|
||||
matrix.setScale(scale, scale);
|
||||
|
||||
mCurrentPage.render(bitmap, null, matrix, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
|
||||
mImageView.setImageBitmap(bitmap);
|
||||
updateUi();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private void updateUi() {
|
||||
int index = mCurrentPage.getIndex();
|
||||
int pageCount = mPdfRenderer.getPageCount();
|
||||
if (pageCount == 1) {
|
||||
mButtonPrevious.setVisibility(View.GONE);
|
||||
mButtonNext.setVisibility(View.GONE);
|
||||
} else {
|
||||
mButtonPrevious.setEnabled(0 != index);
|
||||
mButtonNext.setEnabled(index + 1 < pageCount);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
int button = view.getId();
|
||||
if (button == R.id.previous) {
|
||||
showPage(mCurrentPage.getIndex() - 1);
|
||||
} else if (button == R.id.next) {
|
||||
showPage(mCurrentPage.getIndex() + 1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.adins.mss.odr.accounts.api;
|
||||
|
||||
import com.adins.mss.dao.Product;
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by olivia.dg on 12/19/2017.
|
||||
*/
|
||||
|
||||
public class LoadProductContactResponse extends MssResponseType {
|
||||
@SerializedName("listProduct")
|
||||
private List<Product> listProduct;
|
||||
|
||||
public List<Product> getListProduct() {
|
||||
return listProduct;
|
||||
}
|
||||
|
||||
public void setListProduct(List<Product> listProduct) {
|
||||
this.listProduct = listProduct;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/bgColor"
|
||||
android:orientation="vertical">
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@drawable/header"
|
||||
app:titleTextAppearance="?android:attr/textAppearanceSmall"
|
||||
android:titleTextColor="@color/fontColorWhite"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar"
|
||||
android:fitsSystemWindows="true"/>
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:contentPadding="7dp"
|
||||
app:cardElevation="5dp"
|
||||
android:layout_margin="3dp"
|
||||
app:cardBackgroundColor="@color/fontColorWhite">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/headerId"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="OpportunityID"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:drawableLeft="@drawable/ic_form_color"
|
||||
android:drawablePadding="5dp" />
|
||||
<TextView
|
||||
android:id="@+id/headerStatus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="Status"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:drawableLeft="@drawable/ic_info"
|
||||
android:drawablePadding="5dp" />
|
||||
<TextView
|
||||
android:id="@+id/headerProduct"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Product"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:drawableLeft="@drawable/ic_product"
|
||||
android:drawablePadding="5dp" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:contentPadding="7dp"
|
||||
app:cardElevation="5dp"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_marginRight="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
app:cardBackgroundColor="@color/fontColorWhite">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@string/txtTodo"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/gradient_end" />
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/listTodo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:contentPadding="7dp"
|
||||
app:cardElevation="5dp"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_marginRight="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
app:cardBackgroundColor="@color/fontColorWhite">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="@string/txtHistory"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/gradient_end" />
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/listHistory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue