remove unused files

This commit is contained in:
jacques 2020-05-24 21:21:06 +02:00
parent 50d8140d39
commit 3444c0b3a2
2 changed files with 0 additions and 219 deletions

View file

@ -1,159 +0,0 @@
package net.foucry.pilldroid;
import android.annotation.SuppressLint;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Handler;
import android.view.MotionEvent;
import android.view.View;
import net.foucry.pilldroid.R;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import androidx.annotation.NonNull;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.ViewfinderView;
import java.util.Random;
/**
* Custom Scannner Activity extending from Activity to display a custom layout form scanner view.
*/
/*public class scanActiovity extends Activity implements
DecoratedBarcodeView.TorchListener {*/
public class scanActivity extends Activity {
private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView;
private ImageButton keyboardButton;
private ImageButton cancelButton;
//private Button switchFlashlightButton;
private ViewfinderView viewfinderView;
@SuppressLint("WrongViewCast")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scan);
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
//barcodeScannerView = findViewById(R.id.custom_barcode_scanner);
//barcodeScannerView.setTorchListener((DecoratedBarcodeView.TorchListener) this);
//switchFlashlightButton = findViewById(R.id.switch_flashlight);
keyboardButton = findViewById(R.id.keyboard);
cancelButton = findViewById(R.id.cancel);
viewfinderView = findViewById(R.id.zxing_viewfinder_view);
// if the device does not have flashlight in its camera,
// then remove the switch flashlight button...
/* if (!hasFlash()) {
switchFlashlightButton.setVisibility(View.GONE);
}*/
capture = new CaptureManager(this, barcodeScannerView);
capture.initializeFromIntent(getIntent(), savedInstanceState);
capture.setShowMissingCameraPermissionDialog(false);
capture.decode();
changeMaskColor(null);
changeLaserVisibility(true);
}
@Override
protected void onResume() {
super.onResume();
capture.onResume();
}
@Override
protected void onPause() {
super.onPause();
capture.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
capture.onDestroy();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
capture.onSaveInstanceState(outState);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return barcodeScannerView.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
}
public void onCancel()
{
setResult(2);
finish();
}
public void onKeyboard()
{
setResult(3);
finish();
}
/**
* Check if the device's camera has a Flashlight.
* @return true if there is Flashlight, otherwise false.
*/
private boolean hasFlash() {
return getApplicationContext().getPackageManager()
.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);
}
/* public void switchFlashlight(View view) {
if (getString(R.string.turn_on_flashlight).equals(switchFlashlightButton.getText())) {
barcodeScannerView.setTorchOn();
} else {
barcodeScannerView.setTorchOff();
}
}*/
public void changeMaskColor(View view) {
Random rnd = new Random();
int color = Color.argb(100, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
viewfinderView.setMaskColor(color);
}
public void changeLaserVisibility(boolean visible) {
viewfinderView.setLaserVisibility(visible);
}
/* @Override
public void onTorchOn() {
switchFlashlightButton.setText(R.string.turn_off_flashlight);
}
@Override
public void onTorchOff() {
switchFlashlightButton.setText(R.string.turn_on_flashlight);
}*/
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
capture.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}

View file

@ -1,60 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:id="@+id/scanActivity"
tools:context="net.foucry.pilldroid.scanActivity">
<!-- The primary full-screen view. This can be replaced with whatever view
is needed to present your content, e.g. VideoView, SurfaceView,
TextureView, etc. -->
<!-- This FrameLayout insets its children based on system windows using
android:fitsSystemWindows. -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<ImageView
android:id="@+id/reticule"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/ic_reticule_rouge"
/>
<ImageButton
android:id="@+id/keyboard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginEnd="5dp"
android:adjustViewBounds="true"
android:background="@android:color/transparent"
android:baselineAlignBottom="true"
android:contentDescription="Saisie du CIP 13 au clavier"
app:srcCompat="@drawable/ic_keyboard_black_24dp" />
<ImageButton
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:paddingBottom="10dp"
android:layout_marginEnd="5dp"
android:adjustViewBounds="true"
android:background="@android:color/transparent"
android:baselineAlignBottom="true"
android:contentDescription="Bouton d'annulation du scan"
app:srcCompat="@drawable/ic_cancel_black_75dp" />
</FrameLayout>
</FrameLayout>