Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/test/java/eu/jnksoftware/discountfinderandroid/ui/customer/ViewStoreTest.java
  • Loading branch information
MakisKovanidis committed Jan 8, 2018
2 parents 7943c1d + 4389591 commit 945543f
Show file tree
Hide file tree
Showing 100 changed files with 3,133 additions and 1,372 deletions.
13 changes: 10 additions & 3 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 52 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
apply plugin: 'com.android.application'
apply plugin: 'jacoco-android'

task jacocoCustomTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
println ":${project.name}:Generating Jacoco reports"
group = "Reporting"
description = "Generate Jacoco coverage reports"

reports {
xml.enabled = true
csv.enabled = true
html.enabled = true
}

def fileFilter = ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'android/**/*.*',
'**/Lambda$*.class', //Retrolambda
'**/Lambda.class',
'**/*Lambda.class',
'**/*Lambda*.class',
'**/*Lambda*.*',
'**/*Builder.*',
'**/*_MembersInjector.class', //Dagger2 generated code
'**/*_MembersInjector*.*', //Dagger2 generated code
'**/*_*Factory*.*', //Dagger2 generated code
'**/*Component*.*', //Dagger2 generated code
'**/*Module*.*' //Dagger2 generated code
]
def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"

sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.projectDir, includes:
['**/*.exec' , '**/*.ec'])
}

android {
compileSdkVersion 26
Expand Down Expand Up @@ -40,6 +78,7 @@ android {
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled true
}
}
}
Expand All @@ -55,11 +94,18 @@ dependencies {
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.medyo:android-about-page:1.1.1'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'

compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:converter-scalars:2.3.0'

compile 'com.squareup.okhttp3:logging-interceptor:3.5.0'
compile 'com.squareup.retrofit2:converter-jackson:2.3.0'

testCompile 'junit:junit:4.12'
testCompile 'org.json:json:20160810'
compile 'com.google.code.gson:gson:2.8.2'
Expand All @@ -68,6 +114,7 @@ dependencies {
//Mockito (testing)
testCompile 'org.mockito:mockito-core:2.7.22'
androidTestCompile 'org.mockito:mockito-android:2.7.22'
compile 'com.squareup.retrofit2:retrofit-mock:2.3.0'

// Espresso support
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
Expand All @@ -84,6 +131,10 @@ dependencies {
compile 'com.google.firebase:firebase-ads:11.6.0'
compile 'com.google.android.gms:play-services:11.6.0'

//mock server
androidTestCompile 'com.squareup.retrofit2:retrofit-mock:2.3.0'
androidTestCompile ('com.squareup.okhttp:mockwebserver:2.7.0')

}

static def getDate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class MenuCustomerTest {

@Rule
/*@Rule
public ActivityTestRule<MenuCustomer> menuCustomerActivityTestRule = new ActivityTestRule<>(MenuCustomer.class);
@Before
Expand Down Expand Up @@ -51,5 +51,5 @@ public void testAboutButtonClick(){
@After
public void tearDown() throws Exception {
}

*/
}
24 changes: 24 additions & 0 deletions app/src/debug/res/values/google_maps_api.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=5B:D5:F9:3B:6F:DF:0C:84:E5:12:D4:C4:87:6C:A2:62:E9:DA:94:79%3Beu.jnksoftware.discountfinderandroid
You can also add your credentials to an existing key, using these values:
Package name:
5B:D5:F9:3B:6F:DF:0C:84:E5:12:D4:C4:87:6C:A2:62:E9:DA:94:79
SHA-1 certificate fingerprint:
5B:D5:F9:3B:6F:DF:0C:84:E5:12:D4:C4:87:6C:A2:62:E9:DA:94:79
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCnjNNPviOid3FOGAlKCZcjzD8IGrNX_B0</string>
</resources>
32 changes: 18 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@drawable/startscreenlogo"
android:label="@string/app_name"
android:roundIcon="@drawable/startscreenlogo"
android:theme="@style/AppTheme"
android:supportsRtl="true"
android:theme="@style/AppTheme">
>
<activity
android:name=".ui.general.Main"
android:theme="@style/SplashTheme">
Expand All @@ -25,16 +27,12 @@
</activity>
<activity android:name=".ui.general.Login" />
<activity android:name=".ui.general.Register" />
<activity android:name=".ui.customer.MenuCustomer" />
<activity android:name=".ui.customer.userPreferences.UserPreferences" />
<activity android:name=".ui.general.AboutUs" />
<activity android:name=".ui.general.Settings" />
<activity android:name=".ui.customer.shops.SellerShops" />
<activity android:name=".ui.customer.recyclers.DiscountCustomerRecyclerList" />
<activity android:name=".ui.customer.userPreferences.UserPreferenceList" />
<activity android:name=".ui.customer.userPreferences.UserUpdatePreferences"/>
<activity android:name=".ui.customer.shops.UpdateShop"></activity>
<activity android:name=".ui.customer.shops.ViewStore"></activity>
<activity android:name=".ui.general.Settings"/>
<activity android:name=".ui.customer.userPreferences.UserUpdatePreferences" />
<activity android:name=".ui.customer.shops.UpdateShop" />
<activity android:name=".ui.customer.shops.ViewStore" />
<activity android:name=".ui.customer.discount.FullDiscount">
<intent-filter>
<action android:name="FULLDISCOUNT" />
Expand All @@ -43,7 +41,7 @@
</intent-filter>
</activity>
<activity android:name=".ui.customer.shops.SellerAddShop" />
<activity android:name=".ui.customer.shops.SellerAddDiscount"/>
<activity android:name=".ui.customer.shops.SellerAddDiscount" />

<service android:name=".services.MyFirebaseInstanceIDService">
<intent-filter>
Expand All @@ -56,15 +54,21 @@
</intent-filter>
</service>
<service android:name=".services.GeoLocation" />
<activity android:name=".ui.customer.userPreferences.DeletePreference"></activity>
<activity android:name=".ui.customer.discount.FullContentDiscount"></activity>

<activity android:name=".ui.customer.userPreferences.DeletePreference" />
<activity android:name=".ui.customer.discount.FullContentDiscount" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/GOOGLE_MAPS_API_KEY" />

<activity
android:name=".services.ChooseStoreLocationActivity"
android:label="@string/title_activity_choose_store_location"></activity>
android:name=".services.ChooseStoreLocation"
android:label="@string/title_activity_choose_store_location" />
<activity
android:name=".CustomerMenu"
android:label="@string/title_activity_customer_menu"
></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ public static IuserService getMockUserService(){
return RetrofitClient.getClient(mockBaseUrl).create(IuserService.class);
}

public static ShopsApiInterface getMockUserServiceShopsApi(){
return RetrofitClient.getClient(mockBaseUrl).create(ShopsApiInterface.class);
public static String getBaseUrl() {
return baseUrl;
}

public static String getMockBaseUrl() {
return mockBaseUrl;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package eu.jnksoftware.discountfinderandroid.Apis;

import android.widget.Toast;

import com.google.gson.Gson;

import eu.jnksoftware.discountfinderandroid.Utilities.ManageSharePrefs;
import eu.jnksoftware.discountfinderandroid.models.Location;
import eu.jnksoftware.discountfinderandroid.models.token.FcmToken;
import eu.jnksoftware.discountfinderandroid.models.token.User;
import eu.jnksoftware.discountfinderandroid.services.IuserService;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
* Created by makis on 21/12/2017.
*/

public class HttpCall {
private IuserService iuserService;

public HttpCall() {
iuserService = ApiUtils.getUserService();
}

public int setFcmToken(FcmToken token, String auth){
final int[] statusCode = new int[1];
Call<Void> call =iuserService.registerFcmToken(token, auth);
call.enqueue(new Callback<Void>() {

@Override
public void onResponse(retrofit2.Call<Void> call, Response<Void> response) {
statusCode[0] =response.code();
}

@Override
public void onFailure(retrofit2.Call<Void> call, Throwable t) {
}

});
return statusCode[0];
}

public int setUserLocation(Location location, String auth){
final int[] statuscode = new int[1];
;
Call<Void> call =iuserService.setUserLocation(location, auth);
call.enqueue(new Callback<Void>() {

@Override
public void onResponse(retrofit2.Call<Void> call, Response<Void> response) {


do {
statuscode[0] = response.code();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}while (statuscode[0] ==0);
}


@Override
public void onFailure(retrofit2.Call<Void> call, Throwable t) {
}

});
return statuscode[0];
}

public void refreshToken(){
String refresh_token=" ";
User tempUser= ManageSharePrefs.readUser("");
if (tempUser!=null){
refresh_token=tempUser.getRefreshToken();
}
Call<User> call =iuserService.refreshAccessToken(refresh_token);
call.enqueue(new Callback<User>() {

@Override
public void onResponse(retrofit2.Call<User> call, Response<User> response) {
int statusCode =response.code();
if (response.isSuccessful()){
User user=response.body();
ManageSharePrefs.writeUser(user);
}
}

@Override
public void onFailure(retrofit2.Call<User> call, Throwable t) {
}

});

}

}

This file was deleted.

Loading

0 comments on commit 945543f

Please sign in to comment.