Migrate to AppCompatActivity (#53)

This commit is contained in:
Jean-Baptiste 2024-04-21 12:25:06 +02:00 committed by GitHub
parent fab05c77cf
commit d7c5101820
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View file

@ -1,6 +1,5 @@
package net.foucry.pilldroid; package net.foucry.pilldroid;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Bundle; import android.os.Bundle;
@ -11,6 +10,7 @@ import android.widget.ImageButton;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
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;
@ -18,7 +18,7 @@ import com.journeyapps.barcodescanner.ViewfinderView;
/** /**
* Custom Scanner Activity extending from Activity to display a custom layout form scanner view. * Custom Scanner Activity extending from Activity to display a custom layout form scanner view.
*/ */
public class CustomScannerActivity extends Activity implements DecoratedBarcodeView.TorchListener { public class CustomScannerActivity extends AppCompatActivity implements DecoratedBarcodeView.TorchListener {
private static final String TAG = CustomScannerActivity.class.getName(); private static final String TAG = CustomScannerActivity.class.getName();
final Bundle captureIntentBundle = new Bundle(); final Bundle captureIntentBundle = new Bundle();

View file

@ -42,11 +42,11 @@
android:layout_gravity="bottom|start" android:layout_gravity="bottom|start"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:accessibilityHeading="true" android:accessibilityHeading="true"
android:backgroundTint="@android:color/transparent" app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/button_cancel" android:contentDescription="@string/button_cancel"
android:cropToPadding="false" android:cropToPadding="false"
app:background="@android:color/darker_gray" app:background="@android:color/darker_gray"
android:src="@drawable/ic_cancel_black_24dp" /> app:srcCompat="@drawable/ic_cancel_black_24dp" />
<ImageButton <ImageButton
android:id="@+id/keyboard_button" android:id="@+id/keyboard_button"
@ -54,9 +54,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@android:color/transparent" app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/button_keyboard" android:contentDescription="@string/button_keyboard"
android:src="@drawable/ic_keyboard_black_24dp" app:srcCompat="@drawable/ic_keyboard_black_24dp"
tools:ignore="PrivateResource" /> tools:ignore="PrivateResource" />
</merge> </merge>

View file

@ -21,9 +21,9 @@
android:layout_marginTop="@dimen/fab_margin" android:layout_marginTop="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin" android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin" android:layout_marginBottom="@dimen/fab_margin"
android:backgroundTint="@android:color/transparent" app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/flashlightButton" android:contentDescription="@string/flashlightButton"
android:src="@drawable/ic_baseline_highlight_24" /> app:srcCompat="@drawable/ic_baseline_highlight_24" />
</com.journeyapps.barcodescanner.DecoratedBarcodeView> </com.journeyapps.barcodescanner.DecoratedBarcodeView>
</RelativeLayout> </RelativeLayout>