
I did the same as some previous code which copied code from the zxing library and put it in the com.google.zxing namespace (but left the license in tact - is this okay for Apache 2.0 stuff?). The reason was that they encourage copying the relevant two files into your project and modifying as neccesary. In this case, it wasn't about modifying for functionalities sake, but rather for android support libraries sake. The upstream version doesn't support android.support.v4.app.Fragments, only android.app.Fragments. Hooking up the intent integrator from zxing almost removes the need for the refactoring which made FDroid.java responsible for handling "new repo" intents. However, there is still the one case of the user not using the QR code, but rather a web browser to connect to a swap. That is, they will click a link on the other phones web browser, which directs them to initiate the swap. Thus, we still need FDroid.java to be able to distinguish between a "swap" new repo request, and a regular "add repo" new repo request. In the process, I also commented out the "It's not working" button.
50 lines
2.1 KiB
XML
50 lines
2.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:orientation="vertical"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
xmlns:tools="http://schemas.android.com/tools">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:id="@+id/textView"
|
|
android:layout_gravity="center_horizontal"
|
|
android:layout_alignParentTop="true"
|
|
android:layout_alignParentLeft="true"
|
|
android:layout_alignParentStart="true"
|
|
android:text="One person needs to scan the code, or type the URL of the other swapper into a browser."
|
|
style="@style/SwapTheme.Wizard.MainText"/>
|
|
<ImageView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:id="@+id/wifi_qr_code"
|
|
tools:src="@drawable/swap_qr_example"
|
|
android:layout_below="@+id/textView"
|
|
android:layout_above="@+id/device_ip_address"/>
|
|
|
|
<!--
|
|
<Button style="@style/SwapTheme.Wizard.OptionButton"
|
|
android:id="@+id/btn_not_working"
|
|
android:text="@string/swap_wifi_qr_not_working"
|
|
android:layout_alignParentBottom="true" />
|
|
-->
|
|
|
|
<Button style="@style/SwapTheme.Wizard.OptionButton"
|
|
android:text="@string/open_qr_code_scanner"
|
|
android:layout_gravity="center"
|
|
android:layout_alignParentBottom="true"
|
|
android:id="@+id/btn_qr_scanner"/>
|
|
<!-- android:layout_above="@id/btn_not_working" -->
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:id="@+id/device_ip_address"
|
|
tools:text="192.168.1.1:8888"
|
|
android:layout_above="@+id/btn_qr_scanner"
|
|
android:layout_centerHorizontal="true"
|
|
style="@style/SwapTheme.Wizard.LocalIpAddress"/>
|
|
|
|
</RelativeLayout> |