diff --git a/app/build.gradle b/app/build.gradle index 4f17ac0..7cc8911 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.neenbedankt.android-apt' android { compileSdkVersion 23 - buildToolsVersion "23.0.3" + buildToolsVersion "25.0.2" dataBinding.enabled = true compileOptions { @@ -31,16 +31,20 @@ android { versionName "2.0" //try Selectively compiling com.google.android.gms:play-services APIs, do not need multi dex //https://developers.google.com/android/guides/setup - multiDexEnabled false + multiDexEnabled true //instrumentation test - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'com.eusecom.attendance.MockTestRunner' testInstrumentationRunnerArgument "size", "small" + buildConfigField 'boolean', 'RELEASEMODE', 'true' + } buildTypes { debug { resValue "string", "google_maps_api_key", "AIzaSyB8fogk4Bnb4Gt5Yslv3rKRFHjNfLewldk" + buildConfigField 'boolean', 'RELEASEMODE', 'false' } release { minifyEnabled false @@ -51,7 +55,7 @@ android { } dependencies { - //compile 'com.android.support:multidex:' + compile 'com.android.support:multidex:1.0.1' compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.0' @@ -106,12 +110,17 @@ dependencies { compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' compile 'com.jakewharton:butterknife:7.0.1' - //dagger2 - apt 'com.google.dagger:dagger-compiler:2.2' - compile 'com.google.dagger:dagger:2.2' + //dagger2 v.2.7 + apt 'com.google.dagger:dagger-compiler:2.11' + compile 'com.google.dagger:dagger:2.11' provided 'javax.annotation:jsr250-api:1.0' provided 'org.glassfish:javax.annotation:10.0-b28' + // Realm + compile 'io.realm:realm-android:0.82.1' + + //estimote + compile 'com.estimote:sdk:1.0.13' //testing testCompile 'junit:junit:4.12' @@ -139,6 +148,9 @@ dependencies { exclude group: 'io.reactivex' } + //estimote + testCompile 'com.estimote:sdk:1.0.13' + // Unit testing dependencies androidTestCompile 'junit:junit:4.12' //because of conflict app and tandroidtest version annotations @@ -150,6 +162,16 @@ dependencies { androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' // Optional -- UI testing with Espresso androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' + //espresso recyclerview click on item + androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2') { + exclude module: 'support-annotations' + exclude group: 'com.android.support', module: 'appcompat' + exclude group: 'com.android.support', module: 'support-v4' + exclude module: 'recyclerview-v7' + } + //androidTestCompile 'org.mockito:mockito-core:1.10.19' + androidTestCompile 'org.mockito:mockito-android:2.8.47' + androidTestApt 'com.google.dagger:dagger-compiler:2.11' debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' diff --git a/app/src/main/java/com/eusecom/attendance/MainActivity.java b/app/src/main/java/com/eusecom/attendance/MainActivity.java index 550c2ad..d436119 100644 --- a/app/src/main/java/com/eusecom/attendance/MainActivity.java +++ b/app/src/main/java/com/eusecom/attendance/MainActivity.java @@ -132,15 +132,27 @@ protected void onCreate(Bundle savedInstanceState) { mText3 = (TextView) findViewById(R.id.text3); - navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items); - String TITLES[] = {navMenuTitles[0], navMenuTitles[1], navMenuTitles[2], navMenuTitles[3], navMenuTitles[4], navMenuTitles[5]}; + + + mRecyclerView = (RecyclerView) findViewById(R.id.RecyclerView); // Assigning the RecyclerView Object to the xml View mRecyclerView.setHasFixedSize(true); // Letting the system know that the list objects are of fixed size mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); - mAdapter = new MainDrawerAdapter(this, TITLES, ICONS, NAME, EMAIL, PROFILE); // Creating the Adapter of MyAdapter class(which we are going to see in a bit) + navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items); + + + if (!BuildConfig.RELEASEMODE) { + String TITLES[] = {navMenuTitles[0], navMenuTitles[1]}; + mAdapter = new MainDrawerAdapter(this, TITLES, ICONS, NAME, EMAIL, PROFILE); + }else{ + String TITLES2[] = {navMenuTitles[0], navMenuTitles[1], navMenuTitles[2], navMenuTitles[3], navMenuTitles[4], navMenuTitles[5]}; + mAdapter = new MainDrawerAdapter(this, TITLES2, ICONS, NAME, EMAIL, PROFILE); + } + + // Creating the Adapter of MyAdapter class(which we are going to see in a bit) // And passing the titles,icons,header view name, header view email, // and header view profile picture mRecyclerView.setAdapter(mAdapter); // Setting the adapter to RecyclerView diff --git a/app/src/main/java/com/eusecom/attendance/MainDrawerAdapter.java b/app/src/main/java/com/eusecom/attendance/MainDrawerAdapter.java index 7dadf3f..5eaefd2 100644 --- a/app/src/main/java/com/eusecom/attendance/MainDrawerAdapter.java +++ b/app/src/main/java/com/eusecom/attendance/MainDrawerAdapter.java @@ -191,9 +191,12 @@ public void onClick(View v, int pos, boolean isLongClick) { case 3: + if (!BuildConfig.RELEASEMODE) { + Intent i3 = new Intent(mContext, BeaconActivity.class); + v.getContext().startActivity(i3); + }else{ - Intent i3 = new Intent(mContext, BeaconActivity.class); - v.getContext().startActivity(i3); + } break;