mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
optimize import
This commit is contained in:
parent
d8d4f4efff
commit
62440f2439
1 changed files with 0 additions and 29 deletions
|
@ -34,7 +34,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import androidx.room.Room;
|
||||
|
||||
import com.google.zxing.client.android.Intents;
|
||||
import com.journeyapps.barcodescanner.ScanContract;
|
||||
import com.journeyapps.barcodescanner.ScanOptions;
|
||||
|
||||
import net.foucry.pilldroid.dao.MedicDAO;
|
||||
|
@ -235,7 +234,6 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
constructDrugsList();
|
||||
}
|
||||
|
||||
|
@ -286,33 +284,6 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
super.onResume();
|
||||
}
|
||||
|
||||
/** Register the launcher and result handler
|
||||
* ActivityResultLauncher
|
||||
*/
|
||||
private final ActivityResultLauncher<ScanOptions> barcodeLauncher = registerForActivityResult(new ScanContract(),
|
||||
result -> {
|
||||
if(result.getContents() == null) {
|
||||
Intent originalIntent = result.getOriginalIntent();
|
||||
if (originalIntent == null) {
|
||||
Log.d(TAG, "Cancelled Scan");
|
||||
Toast.makeText(DrugListActivity.this, "Cancelled",
|
||||
Toast.LENGTH_LONG).show();
|
||||
} else if (originalIntent.hasExtra(Intents.Scan.MISSING_CAMERA_PERMISSION)) {
|
||||
Log.d(TAG, "Cancelled scan due missing camera permission");
|
||||
Toast.makeText(DrugListActivity.this, "Cancelled due missing camera persmission",
|
||||
Toast.LENGTH_LONG).show();
|
||||
} else if (originalIntent.hasExtra(Intents.Scan.TIMEOUT)) {
|
||||
Log.d(TAG, "Cancelled due timeout");
|
||||
Toast.makeText(DrugListActivity.this, "Cancelled due timeout",
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "Scanned");
|
||||
Toast.makeText(DrugListActivity.this, "Scanned: " + result.getContents(),
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
||||
// Launch scan
|
||||
public void onButtonClick(View v) {
|
||||
Log.d(TAG, "add medication");
|
||||
|
|
Loading…
Reference in a new issue