mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-21 20:19:23 +01:00
Improve code of app (#28)
This commit is contained in:
parent
478b4751fd
commit
2d642d7627
8 changed files with 11 additions and 15 deletions
|
@ -12,9 +12,10 @@
|
||||||
p.red {
|
p.red {
|
||||||
color: #ff2600;
|
color: #ff2600;
|
||||||
}</style>
|
}</style>
|
||||||
|
<title>About</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<center><img src="file:///android_asset/icon_pilldroid.png" width="64"/></center>
|
<div style="text-align: center;"><img src="file:///android_asset/icon_pilldroid.png" width="64"/></div>
|
||||||
<!--<div class="build">[[[about_string]]]</div>-->
|
<!--<div class="build">[[[about_string]]]</div>-->
|
||||||
<h5>Pilldroid © 2022 Jacques Foucry </h5>
|
<h5>Pilldroid © 2022 Jacques Foucry </h5>
|
||||||
<p>Pilldroid est une gestion théorique de votre stock de médicaments.</p>
|
<p>Pilldroid est une gestion théorique de votre stock de médicaments.</p>
|
||||||
|
|
|
@ -11,8 +11,6 @@ import android.widget.ImageButton;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.journeyapps.barcodescanner.BarcodeCallback;
|
|
||||||
import com.journeyapps.barcodescanner.BarcodeResult;
|
|
||||||
import com.journeyapps.barcodescanner.CaptureManager;
|
import com.journeyapps.barcodescanner.CaptureManager;
|
||||||
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||||
import com.journeyapps.barcodescanner.ViewfinderView;
|
import com.journeyapps.barcodescanner.ViewfinderView;
|
||||||
|
|
|
@ -10,7 +10,6 @@ import android.text.format.DateUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -333,7 +333,6 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
|
|
||||||
Log.d(TAG, "scanOptions == " + options);
|
Log.d(TAG, "scanOptions == " + options);
|
||||||
mBarcodeScannerLauncher.launch(options);
|
mBarcodeScannerLauncher.launch(options);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -348,11 +347,11 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
dialog.setCanceledOnTouchOutside(true);
|
dialog.setCanceledOnTouchOutside(true);
|
||||||
dialog.setContentView(R.layout.input_dialog);
|
dialog.setContentView(R.layout.input_dialog);
|
||||||
|
|
||||||
Button ok = (Button) dialog.findViewById(R.id.agreed);
|
Button ok = dialog.findViewById(R.id.agreed);
|
||||||
Button cancel = (Button) dialog.findViewById(R.id.notagreed);
|
Button cancel = dialog.findViewById(R.id.notagreed);
|
||||||
ok.setEnabled(false);
|
ok.setEnabled(false);
|
||||||
ok.setBackground(getDrawable(R.drawable.rounded_btn_disabled));
|
ok.setBackground(ContextCompat.getDrawable(this, R.drawable.rounded_btn_disabled));
|
||||||
//TextView title = (TextView ) dialog.findViewById(R.id.title);
|
//TextView title = dialog.findViewById(R.id.title);
|
||||||
final EditText editText= dialog.findViewById(R.id.editcip13);
|
final EditText editText= dialog.findViewById(R.id.editcip13);
|
||||||
String cip13 = String.valueOf(editText.getText());
|
String cip13 = String.valueOf(editText.getText());
|
||||||
|
|
||||||
|
@ -375,7 +374,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
//alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8);
|
//alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8);
|
||||||
if (s.length() == 8) {
|
if (s.length() == 8) {
|
||||||
ok.setEnabled(true);
|
ok.setEnabled(true);
|
||||||
ok.setBackground(getDrawable(R.drawable.rounded_btn));
|
ok.setBackground(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -418,7 +417,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
msgString = aMedicine.getName() + " " + getString(R.string.msgFound);
|
msgString = aMedicine.getName() + " " + getString(R.string.msgFound);
|
||||||
msg.setText(msgString);
|
msg.setText(msgString);
|
||||||
cplString = getString(R.string.addInList);
|
cplString = getString(R.string.addInList);
|
||||||
if (cplString.equals("")) {
|
if (cplString.isEmpty()) {
|
||||||
cpl.setEnabled(false);
|
cpl.setEnabled(false);
|
||||||
}
|
}
|
||||||
icon.setImageResource(R.drawable.tickmark);
|
icon.setImageResource(R.drawable.tickmark);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package net.foucry.pilldroid;
|
||||||
import net.foucry.pilldroid.models.Medicine;
|
import net.foucry.pilldroid.models.Medicine;
|
||||||
import net.foucry.pilldroid.models.Prescription;
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
|
|
||||||
msgString = getString(R.string.understood);
|
msgString = getString(R.string.understood);
|
||||||
msg.setText(msgString);
|
msg.setText(msgString);
|
||||||
if (cplString.equals("")) {
|
if (cplString.isEmpty()) {
|
||||||
cpl.setEnabled(false);
|
cpl.setEnabled(false);
|
||||||
}
|
}
|
||||||
//icon.setImageResource(R.drawable.pilldroid_icon);
|
//icon.setImageResource(R.drawable.pilldroid_icon);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:zxing_framing_rect_height="150dp"
|
app:zxing_framing_rect_height="150dp"
|
||||||
app:zxing_framing_rect_width="300dp"></com.journeyapps.barcodescanner.BarcodeView>
|
app:zxing_framing_rect_width="300dp"/>
|
||||||
|
|
||||||
<com.journeyapps.barcodescanner.ViewfinderView
|
<com.journeyapps.barcodescanner.ViewfinderView
|
||||||
android:id="@+id/zxing_viewfinder_view"
|
android:id="@+id/zxing_viewfinder_view"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"></LinearLayout>
|
android:orientation="horizontal"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_next"
|
android:id="@+id/btn_next"
|
||||||
|
|
Loading…
Reference in a new issue