Method touchDivider
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
@SuppressLint("ClickableViewAccessibility")
private View.OnTouchListener touchDivider(MaterialDivider resizeHandle) {
ImageView dividerImageUp = fragmentOverview.findViewById(R.id.dividerImageUp);
ImageView dividerImageDown = fragmentOverview.findViewById(R.id.dividerImageDown);
int colorDown = MaterialColors.getColor(resizeHandle, com.google.android.material.R.attr.colorPrimary);
Method onEntityLoaded
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
override fun onEntityLoaded(entity: Medicine, fragmentView: View): Boolean {
fragmentView.findViewById<TextInputEditText>(R.id.amountLeft)
.setText(MedicineHelper.formatAmount(entity.amount, ""))
fragmentView.findViewById<TextInputEditText>(R.id.amountLeft).addDoubleValidator()
Method onChildDrawOver
has 7 arguments (exceeds 4 allowed). Consider refactoring.
public void onChildDrawOver(@NonNull Canvas c, @NonNull RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder, float dX, float dY,
int actionState, boolean isCurrentlyActive) {
Similar blocks of code found in 3 locations. Consider refactoring.
} else if (dismissNotificationAction.equals("1")) {
builder.addAction(R.drawable.check2_circle, context.getString(R.string.taken), pendingTaken);
builder.addAction(R.drawable.x_circle, context.getString(R.string.skipped), pendingDismissed);
builder.setDeleteIntent(pendingSnooze);
} else {
app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 131..135 app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 123..127 Similar blocks of code found in 3 locations. Consider refactoring.
} else {
builder.addAction(R.drawable.x_circle, context.getString(R.string.skipped), pendingDismissed);
builder.addAction(R.drawable.hourglass_split, context.getString(R.string.snooze), pendingSnooze);
builder.setDeleteIntent(pendingTaken);
}
app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 127..131 app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 123..127 Similar blocks of code found in 3 locations. Consider refactoring.
if (dismissNotificationAction.equals("0")) {
builder.addAction(R.drawable.check2_circle, context.getString(R.string.taken), pendingTaken);
builder.addAction(R.drawable.hourglass_split, context.getString(R.string.snooze), pendingSnooze);
builder.setDeleteIntent(pendingDismissed);
} else if (dismissNotificationAction.equals("1")) {
app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 131..135 app/src/main/java/com/futsch1/medtimer/reminders/Notifications.java on lines 127..131 Similar blocks of code found in 2 locations. Consider refactoring.
fragmentView.findViewById<TextInputEditText>(R.id.reminderThreshold)
.setText(MedicineHelper.formatAmount(entity.outOfStockReminderThreshold, ""))
app/src/main/java/com/futsch1/medtimer/medicine/MedicineStockFragment.kt on lines 53..54 Similar blocks of code found in 2 locations. Consider refactoring.
fragmentView.findViewById<TextInputEditText>(R.id.amountLeft)
.setText(MedicineHelper.formatAmount(entity.amount, ""))
app/src/main/java/com/futsch1/medtimer/medicine/MedicineStockFragment.kt on lines 59..60 Method clearCanvas
has 5 arguments (exceeds 4 allowed). Consider refactoring.
private void clearCanvas(Canvas c, float left, float top, float right, float bottom) {
Similar blocks of code found in 2 locations. Consider refactoring.
entity.unit =
fragmentView.findViewById<TextInputEditText>(R.id.stockUnit).text.toString()
app/src/main/java/com/futsch1/medtimer/medicine/dialogs/NewReminderDialog.kt on lines 149..150