mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 08:38:03 -06:00
Update
This commit is contained in:
@@ -51,6 +51,7 @@ dependencies {
|
||||
androidTestImplementation(libs.ext.junit)
|
||||
androidTestImplementation(libs.espresso.core)
|
||||
|
||||
implementation("com.github.yuriy-budiyev:code-scanner:2.3.0")
|
||||
implementation("com.github.kenglxn.QRGen:android:3.0.1")
|
||||
// implementation("com.github.yuriy-budiyev:code-scanner:2.3.0")
|
||||
// implementation("com.github.kenglxn.QRGen:android:3.0.1")
|
||||
implementation("com.journeyapps:zxing-android-embedded:2.3.0")
|
||||
}
|
||||
@@ -7,14 +7,11 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.astatin3.scoutingapp2025.RequestTask;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTbaBinding;
|
||||
@@ -24,11 +21,9 @@ import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.function.Function;
|
||||
|
||||
import kotlin.io.LineReader;
|
||||
|
||||
public class TBAFragment extends Fragment {
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+16
-15
@@ -16,8 +16,14 @@ import com.budiyev.android.codescanner.CodeScanner;
|
||||
import com.budiyev.android.codescanner.CodeScannerView;
|
||||
import com.budiyev.android.codescanner.DecodeCallback;
|
||||
import com.budiyev.android.codescanner.ScanMode;
|
||||
import com.google.zxing.DecodeHintType;
|
||||
import com.google.zxing.EncodeHintType;
|
||||
import com.google.zxing.Result;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Map;
|
||||
|
||||
public class NotificationsFragment extends Fragment {
|
||||
private CodeScanner mCodeScanner;
|
||||
|
||||
@@ -38,21 +44,16 @@ public class NotificationsFragment extends Fragment {
|
||||
final Activity activity = getActivity();
|
||||
View root = inflater.inflate(R.layout.fragment_notifications, container, false);
|
||||
|
||||
CodeScannerView scannerView = root.findViewById(R.id.scanner_view);
|
||||
mCodeScanner = new CodeScanner(activity, scannerView);
|
||||
mCodeScanner.setScanMode(ScanMode.CONTINUOUS);
|
||||
mCodeScanner.setDecodeCallback(new DecodeCallback() {
|
||||
@Override
|
||||
public void onDecoded(@NonNull final Result result) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
alert("QR", result.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
mCodeScanner.startPreview();
|
||||
IntentIntegrator integrator = IntentIntegrator.forSupportFragment(FragmentQRScan.this);
|
||||
|
||||
integrator.setOrientationLocked(false);
|
||||
integrator.setPrompt("Scan QR code");
|
||||
integrator.setBeepEnabled(false);
|
||||
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE);
|
||||
|
||||
|
||||
integrator.initiateScan();
|
||||
|
||||
return root;
|
||||
}
|
||||
}
|
||||
@@ -20,18 +20,20 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.971"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/testImg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage"
|
||||
app:layout_constraintVertical_bias="0.838" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/qrSpeedSlider"
|
||||
android:layout_width="412dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSizeSlider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintHorizontal_bias="0.971"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/testImg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage"
|
||||
app:layout_constraintVertical_bias="0.93" />
|
||||
|
||||
<ImageView
|
||||
@@ -60,4 +62,32 @@
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSizeSlider"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexSlash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="202dp"
|
||||
android:layout_marginEnd="203dp"
|
||||
android:text="/"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexN"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qrIndexSlash"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexD"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintStart_toEndOf="@+id/qrIndexSlash"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user