Skip to content

Commit

Permalink
Main Activity Attendance
Browse files Browse the repository at this point in the history
#2
- to detect debug and release app to call Demo Activity in Maindrawer by
buildConfigField 'boolean', 'RELEASEMODE', 'true' in app/build.gradle
  • Loading branch information
eurosecom committed Sep 13, 2017
1 parent 2ce3ba8 commit c2512e7
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 12 deletions.
36 changes: 29 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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'

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down
18 changes: 15 additions & 3 deletions app/src/main/java/com/eusecom/attendance/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c2512e7

Please sign in to comment.