import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.View;
import cz.cvut.fel.dce.qrscanner.integration.IntentIntegrator;
import cz.cvut.fel.dce.qrscanner.integration.IntentResult;
preview.putExtra("COMPONENT_ID", scanResult.getContents());
startActivity(preview);
}
- // else continue with any other code you need in the method
-
}
private void startScan() {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.initiateScan(IntentIntegrator.QR_CODE_TYPES);
}
+
+ /** Called when the user touches the button */
+ public void findComponent(View view) {
+ startScan();
+ }
}
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
- <TextView
- android:text="@string/hello_world"
+ <ImageView
android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
+ android:layout_height="wrap_content"
+ android:id="@+id/imageView"
+ android:src="@drawable/skoda_logo"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:onClick="findComponent"
+ android:layout_above="@+id/button"/>
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/butStartScanning"
+ android:id="@+id/button"
+ android:onClick="findComponent"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"/>
</RelativeLayout>
<string name="copy_text">copy text</string>
<string name="format_currently_not_supported">Format currently not supported</string>
<string name="toggle_reflow_mode">Toggle reflow mode</string>
+ <string name="mainScreenHeading">Skoda Auto manufacturing helper</string>
+ <string name="butStartScanning">Find component</string>
</resources>