</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
- <output url="file://$MODULE_DIR$/build/classes/main" />
- <output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
android {
compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
- buildToolsVersion "21.1.2"
+ buildToolsVersion '21.1.2'
defaultConfig {
applicationId "cz.cvut.fel.dce.qrscanner"
}
}
+task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native libs') {
+ destinationDir file("$buildDir/native-libs")
+ baseName 'native-libs'
+ extension 'jar'
+ from fileTree(dir: 'libs', include: '**/*.so')
+ into 'lib/'
+}
+
+tasks.withType(JavaCompile) {
+ compileTask -> compileTask.dependsOn(nativeLibsToJar)
+}
+
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
+ compile files('build/native-libs/native-libs.jar')
}
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
+ <excludeFolder url="file://$MODULE_DIR$/build/native-libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android 4.4.2 Glass Development Kit Preview" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" exported="" name="native-libs" level="project" />
</component>
</module>
<application
android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
+ android:icon="@drawable/ic_glass_logo"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
- android:icon="@drawable/ic_glass_logo"
android:label="@string/title_activity_main" >
<intent-filter>
+ <action android:name="android.intent.action.MAIN" />
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
+ <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
- android:resource="@xml/voice_trigger" />
+ android:resource="@xml/voice_trigger_start" />
</activity>
<activity
android:name=".PreviewActivity"
import android.media.AudioManager;
import android.os.Bundle;
import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
Log.i(TAG, scanResult.toString());
+ Intent preview = new Intent(this, PreviewActivity.class);
+ preview.putExtra("COMPONENT_ID", scanResult.getContents());
+ startActivity(preview);
+
}
// else continue with any other code you need in the method
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
+import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import java.io.File;
-import cz.cvut.fel.dce.qrscanner.mupdf.MuPDFActivity;
import cz.cvut.fel.dce.qrscanner.mupdf.MuPDFCore;
}
/** Called when the user touches the button */
- public void showContacts(View view) {
+ public void showContacts() {
showPDF(mComponentRootPath + SKODA_COMP_CONTACTS);
}
/** Called when the user touches the button */
- public void showManufacturing(View view) {
+ public void showManufacturing() {
showPDF(mComponentRootPath + SKODA_COMP_MANUFACTURING);
}
/** Called when the user touches the button */
- public void showManufactImages(View view) {
+ public void showManufactImages() {
showPDF(mComponentRootPath + SKODA_COMP_MANUFACT_IMAGES);
}
/** Called when the user touches the button */
- public void showManufactGuide(View view) {
+ public void showManufactGuide() {
showPDF(mComponentRootPath + SKODA_COMP_MANUFACT_GUIDE);
}
private void showPDF(String filePath) {
Uri uri = Uri.parse(filePath);
- Intent pdfIntent = new Intent(this,MuPDFActivity.class);
- pdfIntent.setAction(Intent.ACTION_VIEW);
+ Intent pdfIntent = new Intent("com.artifex.mupdfdemo.VIEW");
+ //pdfIntent.setAction(Intent.ACTION_VIEW);
pdfIntent.setData(uri);
startActivity(pdfIntent);
}
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
+ openOptionsMenu();
+ return true;
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
- //noinspection SimplifiableIfStatement
- if (id == R.id.action_settings) {
+ if (id == R.id.show_contacts) {
+ showContacts();
return true;
}
-
- return super.onOptionsItemSelected(item);
+ else if (id == R.id.show_manufacturing) {
+ showManufacturing();
+ return true;
+ }
+ else if (id == R.id.show_pictured_manufacturing) {
+ showManufactImages();
+ return true;
+ }
+ else if (id == R.id.show_workshop) {
+ showManufactGuide();
+ return true;
+ }
+ else if (id == R.id.stop) {
+ finish();
+ return true;
+ }
+ else {
+ return super.onOptionsItemSelected(item);
+ }
}
}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+import android.graphics.RectF;
+
+public class Annotation extends RectF {
+ enum Type {
+ TEXT, LINK, FREETEXT, LINE, SQUARE, CIRCLE, POLYGON, POLYLINE, HIGHLIGHT,
+ UNDERLINE, SQUIGGLY, STRIKEOUT, STAMP, CARET, INK, POPUP, FILEATTACHMENT,
+ SOUND, MOVIE, WIDGET, SCREEN, PRINTERMARK, TRAPNET, WATERMARK, A3D, UNKNOWN
+ }
+
+ public final Type type;
+
+ public Annotation(float x0, float y0, float x1, float y1, int _type) {
+ super(x0, y0, x1, y1);
+ type = _type == -1 ? Type.UNKNOWN : Type.values()[_type];
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+import android.graphics.RectF;
+
+public class LinkInfo {
+ final public RectF rect;
+
+ public LinkInfo(float l, float t, float r, float b) {
+ rect = new RectF(l, t, r, b);
+ }
+
+ public void acceptVisitor(LinkInfoVisitor visitor) {
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+public class LinkInfoExternal extends LinkInfo {
+ final public String url;
+
+ public LinkInfoExternal(float l, float t, float r, float b, String u) {
+ super(l, t, r, b);
+ url = u;
+ }
+
+ public void acceptVisitor(LinkInfoVisitor visitor) {
+ visitor.visitExternal(this);
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+public class LinkInfoInternal extends LinkInfo {
+ final public int pageNumber;
+
+ public LinkInfoInternal(float l, float t, float r, float b, int p) {
+ super(l, t, r, b);
+ pageNumber = p;
+ }
+
+ public void acceptVisitor(LinkInfoVisitor visitor) {
+ visitor.visitInternal(this);
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+public class LinkInfoRemote extends LinkInfo {
+ final public String fileSpec;
+ final public int pageNumber;
+ final public boolean newWindow;
+
+ public LinkInfoRemote(float l, float t, float r, float b, String f, int p, boolean n) {
+ super(l, t, r, b);
+ fileSpec = f;
+ pageNumber = p;
+ newWindow = n;
+ }
+
+ public void acceptVisitor(LinkInfoVisitor visitor) {
+ visitor.visitRemote(this);
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+abstract public class LinkInfoVisitor {
+ public abstract void visitInternal(LinkInfoInternal li);
+ public abstract void visitExternal(LinkInfoExternal li);
+ public abstract void visitRemote(LinkInfoRemote li);
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+public class MuPDFAlert {
+ public enum IconType {Error,Warning,Question,Status};
+ public enum ButtonPressed {None,Ok,Cancel,No,Yes};
+ public enum ButtonGroupType {Ok,OkCancel,YesNo,YesNoCancel};
+
+ public final String message;
+ public final IconType iconType;
+ public final ButtonGroupType buttonGroupType;
+ public final String title;
+ public ButtonPressed buttonPressed;
+
+ MuPDFAlert(String aMessage, IconType aIconType, ButtonGroupType aButtonGroupType, String aTitle, ButtonPressed aButtonPressed) {
+ message = aMessage;
+ iconType = aIconType;
+ buttonGroupType = aButtonGroupType;
+ title = aTitle;
+ buttonPressed = aButtonPressed;
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+// Version of MuPDFAlert without enums to simplify JNI
+public class MuPDFAlertInternal {
+ public final String message;
+ public final int iconType;
+ public final int buttonGroupType;
+ public final String title;
+ public int buttonPressed;
+
+ MuPDFAlertInternal(String aMessage, int aIconType, int aButtonGroupType, String aTitle, int aButtonPressed) {
+ message = aMessage;
+ iconType = aIconType;
+ buttonGroupType = aButtonGroupType;
+ title = aTitle;
+ buttonPressed = aButtonPressed;
+ }
+
+ MuPDFAlertInternal(MuPDFAlert alert) {
+ message = alert.message;
+ iconType = alert.iconType.ordinal();
+ buttonGroupType = alert.buttonGroupType.ordinal();
+ title = alert.message;
+ buttonPressed = alert.buttonPressed.ordinal();
+ }
+
+ MuPDFAlert toAlert() {
+ return new MuPDFAlert(message, MuPDFAlert.IconType.values()[iconType], MuPDFAlert.ButtonGroupType.values()[buttonGroupType], title, MuPDFAlert.ButtonPressed.values()[buttonPressed]);
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.PointF;
+import android.graphics.RectF;
+
+import java.util.ArrayList;
+
+import cz.cvut.fel.dce.qrscanner.R;
+
+public class MuPDFCore
+{
+ /* load our native library */
+ static {
+ System.loadLibrary("mupdf");
+ }
+
+ /* Readable members */
+ private int numPages = -1;
+ private float pageWidth;
+ private float pageHeight;
+ private long globals;
+ private byte fileBuffer[];
+ private String file_format;
+ private boolean isUnencryptedPDF;
+ private final boolean wasOpenedFromBuffer;
+
+ /* The native functions */
+ private native long openFile(String filename);
+ private native long openBuffer(String magic);
+ private native String fileFormatInternal();
+ private native boolean isUnencryptedPDFInternal();
+ private native int countPagesInternal();
+ private native void gotoPageInternal(int localActionPageNum);
+ private native float getPageWidth();
+ private native float getPageHeight();
+ private native void drawPage(Bitmap bitmap,
+ int pageW, int pageH,
+ int patchX, int patchY,
+ int patchW, int patchH,
+ long cookiePtr);
+ private native void updatePageInternal(Bitmap bitmap,
+ int page,
+ int pageW, int pageH,
+ int patchX, int patchY,
+ int patchW, int patchH,
+ long cookiePtr);
+ private native RectF[] searchPage(String text);
+ private native TextChar[][][][] text();
+ private native byte[] textAsHtml();
+ private native void addMarkupAnnotationInternal(PointF[] quadPoints, int type);
+ private native void addInkAnnotationInternal(PointF[][] arcs);
+ private native void deleteAnnotationInternal(int annot_index);
+ private native int passClickEventInternal(int page, float x, float y);
+ private native void setFocusedWidgetChoiceSelectedInternal(String [] selected);
+ private native String [] getFocusedWidgetChoiceSelected();
+ private native String [] getFocusedWidgetChoiceOptions();
+ private native int getFocusedWidgetSignatureState();
+ private native String checkFocusedSignatureInternal();
+ private native boolean signFocusedSignatureInternal(String keyFile, String password);
+ private native int setFocusedWidgetTextInternal(String text);
+ private native String getFocusedWidgetTextInternal();
+ private native int getFocusedWidgetTypeInternal();
+ private native LinkInfo [] getPageLinksInternal(int page);
+ private native RectF[] getWidgetAreasInternal(int page);
+ private native Annotation[] getAnnotationsInternal(int page);
+ private native OutlineItem [] getOutlineInternal();
+ private native boolean hasOutlineInternal();
+ private native boolean needsPasswordInternal();
+ private native boolean authenticatePasswordInternal(String password);
+ private native MuPDFAlertInternal waitForAlertInternal();
+ private native void replyToAlertInternal(MuPDFAlertInternal alert);
+ private native void startAlertsInternal();
+ private native void stopAlertsInternal();
+ private native void destroying();
+ private native boolean hasChangesInternal();
+ private native void saveInternal();
+ private native long createCookie();
+ private native void destroyCookie(long cookie);
+ private native void abortCookie(long cookie);
+
+ public native boolean javascriptSupported();
+
+ enum SignatureState {
+ NoSupport,
+ Unsigned,
+ Signed
+ }
+
+ abstract class PassClickResultVisitor {
+ public abstract void visitText(PassClickResultText result);
+ public abstract void visitChoice(PassClickResultChoice result);
+ public abstract void visitSignature(PassClickResultSignature result);
+ }
+
+ class PassClickResult {
+ public final boolean changed;
+
+ public PassClickResult(boolean _changed) {
+ changed = _changed;
+ }
+
+ public void acceptVisitor(PassClickResultVisitor visitor) {
+ }
+ }
+
+ class PassClickResultText extends PassClickResult {
+ public final String text;
+
+ public PassClickResultText(boolean _changed, String _text) {
+ super(_changed);
+ text = _text;
+ }
+
+ public void acceptVisitor(PassClickResultVisitor visitor) {
+ visitor.visitText(this);
+ }
+ }
+
+ class PassClickResultChoice extends PassClickResult {
+ public final String [] options;
+ public final String [] selected;
+
+ public PassClickResultChoice(boolean _changed, String [] _options, String [] _selected) {
+ super(_changed);
+ options = _options;
+ selected = _selected;
+ }
+
+ public void acceptVisitor(PassClickResultVisitor visitor) {
+ visitor.visitChoice(this);
+ }
+ }
+
+ class PassClickResultSignature extends PassClickResult {
+ public final SignatureState state;
+
+ public PassClickResultSignature(boolean _changed, int _state) {
+ super(_changed);
+ state = SignatureState.values()[_state];
+ }
+
+ public void acceptVisitor(PassClickResultVisitor visitor) {
+ visitor.visitSignature(this);
+ }
+ }
+
+ public class Cookie
+ {
+ private final long cookiePtr;
+
+ public Cookie()
+ {
+ cookiePtr = createCookie();
+ if (cookiePtr == 0)
+ throw new OutOfMemoryError();
+ }
+
+ public void abort()
+ {
+ abortCookie(cookiePtr);
+ }
+
+ public void destroy()
+ {
+ // We could do this in finalize, but there's no guarantee that
+ // a finalize will occur before the muPDF context occurs.
+ destroyCookie(cookiePtr);
+ }
+ }
+
+ public MuPDFCore(Context context, String filename) throws Exception
+ {
+ globals = openFile(filename);
+ if (globals == 0)
+ {
+ throw new Exception(String.format(context.getString(R.string.cannot_open_file_Path), filename));
+ }
+ file_format = fileFormatInternal();
+ isUnencryptedPDF = isUnencryptedPDFInternal();
+ wasOpenedFromBuffer = false;
+ }
+
+ public MuPDFCore(Context context, byte buffer[], String magic) throws Exception {
+ fileBuffer = buffer;
+ globals = openBuffer(magic != null ? magic : "");
+ if (globals == 0)
+ {
+ throw new Exception(context.getString(R.string.cannot_open_buffer));
+ }
+ file_format = fileFormatInternal();
+ isUnencryptedPDF = isUnencryptedPDFInternal();
+ wasOpenedFromBuffer = true;
+ }
+
+ public int countPages()
+ {
+ if (numPages < 0)
+ numPages = countPagesSynchronized();
+
+ return numPages;
+ }
+
+ public String fileFormat()
+ {
+ return file_format;
+ }
+
+ public boolean isUnencryptedPDF()
+ {
+ return isUnencryptedPDF;
+ }
+
+ public boolean wasOpenedFromBuffer()
+ {
+ return wasOpenedFromBuffer;
+ }
+
+ private synchronized int countPagesSynchronized() {
+ return countPagesInternal();
+ }
+
+ /* Shim function */
+ private void gotoPage(int page)
+ {
+ if (page > numPages-1)
+ page = numPages-1;
+ else if (page < 0)
+ page = 0;
+ gotoPageInternal(page);
+ this.pageWidth = getPageWidth();
+ this.pageHeight = getPageHeight();
+ }
+
+ public synchronized PointF getPageSize(int page) {
+ gotoPage(page);
+ return new PointF(pageWidth, pageHeight);
+ }
+
+ public MuPDFAlert waitForAlert() {
+ MuPDFAlertInternal alert = waitForAlertInternal();
+ return alert != null ? alert.toAlert() : null;
+ }
+
+ public void replyToAlert(MuPDFAlert alert) {
+ replyToAlertInternal(new MuPDFAlertInternal(alert));
+ }
+
+ public void stopAlerts() {
+ stopAlertsInternal();
+ }
+
+ public void startAlerts() {
+ startAlertsInternal();
+ }
+
+ public synchronized void onDestroy() {
+ destroying();
+ globals = 0;
+ }
+
+ public synchronized void drawPage(Bitmap bm, int page,
+ int pageW, int pageH,
+ int patchX, int patchY,
+ int patchW, int patchH,
+ Cookie cookie) {
+ gotoPage(page);
+ drawPage(bm, pageW, pageH, patchX, patchY, patchW, patchH, cookie.cookiePtr);
+ }
+
+ public synchronized void updatePage(Bitmap bm, int page,
+ int pageW, int pageH,
+ int patchX, int patchY,
+ int patchW, int patchH,
+ Cookie cookie) {
+ updatePageInternal(bm, page, pageW, pageH, patchX, patchY, patchW, patchH, cookie.cookiePtr);
+ }
+
+ public synchronized PassClickResult passClickEvent(int page, float x, float y) {
+ boolean changed = passClickEventInternal(page, x, y) != 0;
+
+ switch (WidgetType.values()[getFocusedWidgetTypeInternal()])
+ {
+ case TEXT:
+ return new PassClickResultText(changed, getFocusedWidgetTextInternal());
+ case LISTBOX:
+ case COMBOBOX:
+ return new PassClickResultChoice(changed, getFocusedWidgetChoiceOptions(), getFocusedWidgetChoiceSelected());
+ case SIGNATURE:
+ return new PassClickResultSignature(changed, getFocusedWidgetSignatureState());
+ default:
+ return new PassClickResult(changed);
+ }
+
+ }
+
+ public synchronized boolean setFocusedWidgetText(int page, String text) {
+ boolean success;
+ gotoPage(page);
+ success = setFocusedWidgetTextInternal(text) != 0 ? true : false;
+
+ return success;
+ }
+
+ public synchronized void setFocusedWidgetChoiceSelected(String [] selected) {
+ setFocusedWidgetChoiceSelectedInternal(selected);
+ }
+
+ public synchronized String checkFocusedSignature() {
+ return checkFocusedSignatureInternal();
+ }
+
+ public synchronized boolean signFocusedSignature(String keyFile, String password) {
+ return signFocusedSignatureInternal(keyFile, password);
+ }
+
+ public synchronized LinkInfo [] getPageLinks(int page) {
+ return getPageLinksInternal(page);
+ }
+
+ public synchronized RectF [] getWidgetAreas(int page) {
+ return getWidgetAreasInternal(page);
+ }
+
+ public synchronized Annotation [] getAnnoations(int page) {
+ return getAnnotationsInternal(page);
+ }
+
+ public synchronized RectF [] searchPage(int page, String text) {
+ gotoPage(page);
+ return searchPage(text);
+ }
+
+ public synchronized byte[] html(int page) {
+ gotoPage(page);
+ return textAsHtml();
+ }
+
+ public synchronized TextWord [][] textLines(int page) {
+ gotoPage(page);
+ TextChar[][][][] chars = text();
+
+ // The text of the page held in a hierarchy (blocks, lines, spans).
+ // Currently we don't need to distinguish the blocks level or
+ // the spans, and we need to collect the text into words.
+ ArrayList<TextWord[]> lns = new ArrayList<TextWord[]>();
+
+ for (TextChar[][][] bl: chars) {
+ if (bl == null)
+ continue;
+ for (TextChar[][] ln: bl) {
+ ArrayList<TextWord> wds = new ArrayList<TextWord>();
+ TextWord wd = new TextWord();
+
+ for (TextChar[] sp: ln) {
+ for (TextChar tc: sp) {
+ if (tc.c != ' ') {
+ wd.Add(tc);
+ } else if (wd.w.length() > 0) {
+ wds.add(wd);
+ wd = new TextWord();
+ }
+ }
+ }
+
+ if (wd.w.length() > 0)
+ wds.add(wd);
+
+ if (wds.size() > 0)
+ lns.add(wds.toArray(new TextWord[wds.size()]));
+ }
+ }
+
+ return lns.toArray(new TextWord[lns.size()][]);
+ }
+
+ public synchronized void addMarkupAnnotation(int page, PointF[] quadPoints, Annotation.Type type) {
+ gotoPage(page);
+ addMarkupAnnotationInternal(quadPoints, type.ordinal());
+ }
+
+ public synchronized void addInkAnnotation(int page, PointF[][] arcs) {
+ gotoPage(page);
+ addInkAnnotationInternal(arcs);
+ }
+
+ public synchronized void deleteAnnotation(int page, int annot_index) {
+ gotoPage(page);
+ deleteAnnotationInternal(annot_index);
+ }
+
+ public synchronized boolean hasOutline() {
+ return hasOutlineInternal();
+ }
+
+ public synchronized OutlineItem [] getOutline() {
+ return getOutlineInternal();
+ }
+
+ public synchronized boolean needsPassword() {
+ return needsPasswordInternal();
+ }
+
+ public synchronized boolean authenticatePassword(String password) {
+ return authenticatePasswordInternal(password);
+ }
+
+ public synchronized boolean hasChanges() {
+ return hasChangesInternal();
+ }
+
+ public synchronized void save() {
+ saveInternal();
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+public class OutlineItem {
+ public final int level;
+ public final String title;
+ public final int page;
+
+ OutlineItem(int _level, String _title, int _page) {
+ level = _level;
+ title = _title;
+ page = _page;
+ }
+
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+import android.graphics.RectF;
+
+public class TextChar extends RectF {
+ public char c;
+
+ public TextChar(float x0, float y0, float x1, float y1, char _c) {
+ super(x0, y0, x1, y1);
+ c = _c;
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+import android.graphics.RectF;
+
+public class TextWord extends RectF {
+ public String w;
+
+ public TextWord() {
+ super();
+ w = new String();
+ }
+
+ public void Add(TextChar tc) {
+ super.union(tc);
+ w = w.concat(new String(new char[]{tc.c}));
+ }
+}
--- /dev/null
+package cz.cvut.fel.dce.qrscanner.mupdf;
+
+public enum WidgetType {
+ NONE,
+ TEXT,
+ LISTBOX,
+ COMBOBOX,
+ SIGNATURE
+}
--- /dev/null
+<RelativeLayout 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"
+ tools:context=".MainActivity">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/imageView"
+ android:src="@drawable/skoda_logo"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentBottom="true"
+ android:layout_toLeftOf="@+id/button"
+ android:onClick="findComponent"
+ android:layout_toStartOf="@+id/button"/>
+
+</RelativeLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/imgComponent"
+ android:layout_weight="0.95"
+ android:layout_gravity="center_horizontal"
+ android:scaleType="center"/>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:context="cz.cvut.fel.dce.qrscanner.PreviewActivity">
+ <item android:id="@+id/show_contacts"
+ android:title="@string/show_contacts"
+ android:orderInCategory="100"/>
+ <item android:id="@+id/show_manufacturing"
+ android:title="@string/show_manufacturing"
+ android:orderInCategory="100"/>
+ <item android:id="@+id/show_pictured_manufacturing"
+ android:title="@string/show_pictured_manufacturing"
+ android:orderInCategory="100"/>
+ <item android:id="@+id/show_workshop"
+ android:title="@string/show_workshop"
+ android:orderInCategory="100"/>
+ <item android:id="@+id/stop"
+ android:title="@string/action_stop"
+ android:orderInCategory="100"/>
+</menu>
<string name="hello_world">Skoda Demo</string>
<string name="action_stop">Stop</string>
<string name="action_scan">Scan code</string>
-
+ <string name="cannot_open_file_Path">Cannot open file: %1$s</string>
+ <string name="cannot_open_buffer">Cannot open buffer</string>
+ <string name="show_contacts">Contacts</string>
+ <string name="show_manufacturing">Manufacturing</string>
+ <string name="show_pictured_manufacturing">Pictured manuf</string>
+ <string name="show_workshop">Workshow guide</string>
+ <string name="glass_voice_trigger">Skoda Manufacturer Helper</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <style name="AppTheme" parent="android:Theme.Holo.Light">
- </style>
</resources>
+++ /dev/null
-<!-- For more information about voice trigger, check out: https://developers.google.com/glass/develop/gdk/starting-glassware -->
-<trigger command="SHOW_ME_A_DEMO"/>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+
+<trigger keyword="@string/glass_voice_trigger">
+
+ <constraints network="false" /> // asi neni nutne, a asi tam nemusi byt android: prefix
+
+</trigger>
\ No newline at end of file
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="native-libs" level="project" />
- <orderEntry type="library" exported="" name="iocommons" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
- <orderEntry type="library" exported="" name="PdfViewer" level="project" />
</component>
</module>
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.menu_preview, menu);
return true;
}
+++ /dev/null
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- tools:context="cz.cvut.fel.dce.qrscanner.PreviewActivity">
-</menu>
<string name="butManufacturingGuide">Workshop manual</string>
<string name="previewHeading">Select document to view</string>
+
</resources>