-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d72e66
commit 13766f2
Showing
19 changed files
with
470 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
.idea | ||
.DS_Store | ||
/build | ||
/app/build | ||
/app/libs | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
app/src/main/java/com/example/admin/lifeapp/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package com.example.admin.lifeapp | ||
|
||
import android.support.v7.app.AppCompatActivity | ||
import android.os.Bundle | ||
import org.androidannotations.annotations.Click | ||
import org.androidannotations.annotations.EActivity | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
@EActivity(R.layout.activity_main) | ||
open class MainActivity : AppCompatActivity() { | ||
|
||
@Click(R.id.clickMe) | ||
open fun clickMe() { | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
app/src/main/java/com/example/admin/lifeapp/presentation/activity/DlazaroDecoderActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.example.admin.lifeapp.presentation.activity | ||
|
||
import android.app.Activity | ||
import android.graphics.PointF | ||
import android.widget.Toast | ||
import com.dlazaro66.qrcodereaderview.QRCodeReaderView | ||
import com.example.admin.lifeapp.R | ||
import org.androidannotations.annotations.AfterViews | ||
import org.androidannotations.annotations.EActivity | ||
import org.androidannotations.annotations.ViewById | ||
|
||
/** | ||
* Created by admin on 23/10/2017. | ||
*/ | ||
|
||
@EActivity(R.layout.activity_decoder) | ||
open class DlazaroDecoderActivity : Activity(), QRCodeReaderView.OnQRCodeReadListener { | ||
|
||
@ViewById(R.id.reader) | ||
lateinit var reader: QRCodeReaderView | ||
|
||
@AfterViews | ||
fun afterViews() { | ||
reader.setOnQRCodeReadListener(this); | ||
|
||
// Use this function to enable/disable decoding | ||
reader.setQRDecodingEnabled(true); | ||
|
||
// Use this function to change the autofocus interval (default is 5 secs) | ||
reader.setAutofocusInterval(2000L); | ||
|
||
// Use this function to enable/disable Torch | ||
reader.setTorchEnabled(true); | ||
|
||
// Use this function to set front camera preview | ||
reader.setFrontCamera(); | ||
|
||
// Use this function to set back camera preview | ||
reader.setBackCamera(); | ||
} | ||
|
||
override fun onQRCodeRead(text: String?, points: Array<out PointF>?) { | ||
Toast.makeText(this, text, Toast.LENGTH_SHORT).show() | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
reader.startCamera() | ||
} | ||
|
||
override fun onPause() { | ||
super.onPause() | ||
reader.stopCamera() | ||
} | ||
|
||
|
||
} |
47 changes: 47 additions & 0 deletions
47
app/src/main/java/com/example/admin/lifeapp/presentation/activity/ZXingDecoderActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.example.admin.lifeapp.presentation.activity | ||
|
||
import android.os.Bundle | ||
import android.app.Activity | ||
import android.widget.Toast | ||
import com.google.zxing.Result | ||
import me.dm7.barcodescanner.zxing.ZXingScannerView | ||
import org.androidannotations.annotations.EActivity | ||
|
||
|
||
/** | ||
* Created by admin on 23/10/2017. | ||
*/ | ||
@EActivity | ||
open class ZXingDecoderActivity : Activity(), ZXingScannerView.ResultHandler { | ||
|
||
private var mScannerView: ZXingScannerView? = null | ||
|
||
public override fun onCreate(state: Bundle?) { | ||
super.onCreate(state) | ||
|
||
// Programmatically initialize the scanner view | ||
mScannerView = ZXingScannerView(this) | ||
|
||
// Set the scanner view as the content view | ||
setContentView(mScannerView) | ||
} | ||
|
||
public override fun onResume() { | ||
super.onResume() | ||
// Register ourselves as a handler for scan results. | ||
mScannerView?.setResultHandler(this) | ||
mScannerView?.startCamera() // Start camera on resume | ||
} | ||
|
||
public override fun onPause() { | ||
super.onPause() | ||
mScannerView?.stopCamera() // Stop camera on pause | ||
} | ||
|
||
override fun handleResult(result: Result?) { | ||
|
||
Toast.makeText(this, result?.text, Toast.LENGTH_SHORT).show() | ||
mScannerView?.resumeCameraPreview(this) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
|
||
<com.dlazaro66.qrcodereaderview.QRCodeReaderView | ||
android:id="@+id/reader" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<RelativeLayout 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" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="com.example.admin.lifeapp.MainActivity"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
android:id="@+id/clickMe" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="@string/click_me" | ||
android:gravity="center" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</android.support.constraint.ConstraintLayout> | ||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<resources> | ||
<string name="app_name">LifeApp</string> | ||
<string name="click_me">Click me</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.1.4-3' | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.3.3' | ||
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
maven { url 'https://maven.google.com' } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
org.gradle.jvmargs=-Xmx1536m | ||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Thu Oct 19 16:44:32 EAT 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip |
Oops, something went wrong.