Create a custom scanbarcode contract form xxing scanContract. Unsuccesfful.

This commit is contained in:
jacques 2022-02-08 07:51:20 +01:00
parent 4d365c5092
commit 94e625db26

View file

@ -7,15 +7,20 @@ import androidx.activity.result.contract.ActivityResultContract;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
public class CustomScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult> { import com.journeyapps.barcodescanner.ScanIntentResult;
import com.journeyapps.barcodescanner.ScanOptions;
public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult>{
private static final String TAG = PilldroidScanContract.class.getName();
@NonNull @NonNull
@Override @Override
public Intent createIntent(@NonNull Context context, ScanOptions input { public Intent createIntent(@NonNull Context context, ScanOptions input) {
return input createScanIntent(context); return input.createScanIntent(context);
} }
@Override @Override
public ScanIntentResult parseResult(int resultCode, @Nullable Intent intent) { public ScanIntentResult parseResult(int resultCode, @Nullable Intent intent) {
return ScanIntentResult.parseActivityResult(resultCode, intent) return ScanIntentResult.parseActivityResult(resultCode, intent);
} }
} }