-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit a946435
Showing
91 changed files
with
6,341 additions
and
0 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,13 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,45 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'androidx.navigation.safeargs' | ||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "si.root.n26scanner" | ||
minSdkVersion 23 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = '1.8' | ||
targetCompatibility = '1.8' | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' | ||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha02' | ||
implementation 'com.google.android.material:material:1.1.0-alpha03' | ||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | ||
implementation 'androidx.legacy:legacy-support-v4:1.0.0' | ||
implementation 'com.google.android.gms:play-services-vision:17.0.2' | ||
implementation 'com.google.android.gms:play-services-plus:16.0.0' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test:runner:1.1.2-alpha1' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01' | ||
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha11' | ||
implementation project(path: ':barcode-reader') | ||
implementation 'com.squareup.okhttp:okhttp:2.7.5' | ||
implementation 'com.squareup.okhttp:logging-interceptor:2.7.5' | ||
implementation 'org.glassfish:javax.annotation:10.0-b28' | ||
implementation 'com.google.code.gson:gson:2.8.5' | ||
implementation 'org.threeten:threetenbp:1.3.8' | ||
implementation 'io.gsonfire:gson-fire:1.8.3' | ||
} |
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
27 changes: 27 additions & 0 deletions
27
app/src/androidTest/java/si/root/n26scanner/ExampleInstrumentedTest.java
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,27 @@ | ||
package si.root.n26scanner; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.test.InstrumentationRegistry; | ||
import androidx.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("si.root.n26scanner", appContext.getPackageName()); | ||
} | ||
} |
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,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="si.root.n26scanner"> | ||
|
||
<!-- To access Google+ APIs: --> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:screenOrientation="portrait" | ||
android:theme="@style/AppTheme"> | ||
<meta-data | ||
android:name="com.google.android.gms.vision.DEPENDENCIES" | ||
android:value="barcode" /> | ||
|
||
<activity | ||
android:name=".Activities.MainActivity" | ||
android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
93 changes: 93 additions & 0 deletions
93
app/src/main/java/si/root/n26scanner/Activities/MainActivity.java
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,93 @@ | ||
package si.root.n26scanner.Activities; | ||
|
||
import android.os.Bundle; | ||
import android.util.SparseArray; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.ImageButton; | ||
import android.widget.Toast; | ||
|
||
import com.google.android.gms.vision.barcode.Barcode; | ||
import com.google.android.material.bottomnavigation.BottomNavigationView; | ||
import com.notbytes.barcode_reader.BarcodeReaderFragment; | ||
|
||
import java.util.List; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.navigation.NavController; | ||
import androidx.navigation.Navigation; | ||
import si.root.n26scanner.Fragments.HomeFragmentDirections; | ||
import si.root.n26scanner.R; | ||
|
||
public class MainActivity extends AppCompatActivity implements BarcodeReaderFragment.BarcodeReaderListener { | ||
|
||
public NavController navController; | ||
|
||
|
||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener | ||
= new BottomNavigationView.OnNavigationItemSelectedListener() { | ||
|
||
@Override | ||
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | ||
switch (item.getItemId()) { | ||
case R.id.navigation_home: | ||
navController.navigate(R.id.home2); | ||
return true; | ||
case R.id.scan: | ||
navController.navigate(R.id.qrCodeReader); | ||
return true; | ||
case R.id.settings: | ||
navController.navigate(R.id.settings); | ||
return true; | ||
case R.id.bankInfo: | ||
navController.navigate(R.id.bankInfo); | ||
return true; | ||
} | ||
return false; | ||
} | ||
}; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation); | ||
navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); | ||
navController = Navigation.findNavController(this, R.id.nav_host_fragment); | ||
|
||
} | ||
|
||
@Override | ||
public boolean onSupportNavigateUp() { | ||
return Navigation.findNavController(this, R.id.nav_host_fragment).navigateUp(); | ||
} | ||
|
||
@Override | ||
public void onScanned(Barcode barcode) { | ||
Toast.makeText(this, "MAINACTIVITI"+barcode.rawValue, Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override | ||
public void onScannedMultiple(List<Barcode> barcodes) { | ||
|
||
} | ||
|
||
@Override | ||
public void onBitmapScanned(SparseArray<Barcode> sparseArray) { | ||
|
||
} | ||
|
||
@Override | ||
public void onScanError(String errorMessage) { | ||
|
||
} | ||
|
||
@Override | ||
public void onCameraPermissionDenied() { | ||
Toast.makeText(this, "Camera permission denied!", Toast.LENGTH_LONG).show(); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.