basic qr scan, get returned qr code

This commit is contained in:
B. Petersen
2020-02-01 12:31:43 +01:00
parent db8dca7310
commit 7222396da9
4 changed files with 58 additions and 12 deletions
+48 -7
View File
@@ -1,13 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:gravity="center_horizontal"
tools:context=".WelcomeActivity">
<com.journeyapps.barcodescanner.CompoundBarcodeView
android:id="@+id/zxing_barcode_scanner"
<androidx.legacy.widget.Space
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true" />
android:layout_height="0dp"/>
</RelativeLayout>
<ImageView
android:id="@+id/welcome_icon"
android:layout_width="128dp"
android:layout_height="128dp"
android:src="@drawable/intro1"
android:padding="8dp"
tools:ignore="contentDescription"/>
<TextView
android:id="@+id/welcome_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp"
android:text="@string/qrscan_title"
android:textSize="22sp"
android:textStyle="bold"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:orientation="vertical">
<com.journeyapps.barcodescanner.CompoundBarcodeView
android:id="@+id/zxing_barcode_scanner"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true" />
</RelativeLayout>
<androidx.legacy.widget.Space
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp"/>
</LinearLayout>
+1 -1
View File
@@ -26,7 +26,7 @@
android:layout_height="wrap_content"
android:gravity="center"
android:padding="16dp"
android:text="@string/app_name"
android:text="@string/welcome_desktop"
android:textSize="22sp"
android:textStyle="bold"/>
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.b44t.messenger.DcContext;
import com.b44t.messenger.DcEventCenter;
@@ -152,4 +153,12 @@ public class WelcomeActivity extends BaseActionBarActivity implements DcEventCen
}
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode==IntentIntegrator.REQUEST_CODE) {
Toast.makeText(this, "The scanned QR code cannot be used to set up a new account.", Toast.LENGTH_LONG).show();
}
}
}
@@ -36,10 +36,6 @@ public class RegistrationQrActivity extends BaseActionBarActivity {
setContentView(R.layout.activity_registration_qr);
/*assert getSupportActionBar() != null;
getSupportActionBar().setTitle(R.string.qrscan_title);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);*/
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
barcodeScannerView.setStatusText(getString(R.string.qrscan_hint) + "\n ");