Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
# Conflicts:
#	bitrise.yml
#	dependencies.gradle
  • Loading branch information
FrPellissier committed Sep 16, 2020
2 parents c502720 + 7bbcb0e commit e62605f
Show file tree
Hide file tree
Showing 407 changed files with 4,818 additions and 10,754 deletions.
31 changes: 0 additions & 31 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ android {

def TEST_ACCOUNT_LOGIN = System.env.TEST_ACCOUNT_LOGIN ? '"' + System.env.TEST_ACCOUNT_LOGIN + '"' : entourageTestLogin
def TEST_ACCOUNT_PWD = System.env.TEST_ACCOUNT_PWD ? '"' + System.env.TEST_ACCOUNT_PWD + '"' : entourageTestPwd
def TEST_PFP_ACCOUNT_LOGIN = System.env.TEST_ACCOUNT_LOGIN ? '"' + System.env.TEST_PFP_ACCOUNT_LOGIN + '"' : pfpTestLogin
def TEST_PFP_ACCOUNT_PWD = System.env.TEST_ACCOUNT_PWD ? '"' + System.env.TEST_PFP_ACCOUNT_PWD + '"' : pfpTestPwd

defaultConfig {
applicationId 'social.entourage.android'
Expand Down Expand Up @@ -49,13 +47,6 @@ android {
storePassword "${System.env.KEYSTORE_PASS}"
}

googleplay_pfp {
keyAlias 'googleplay-pfp'
keyPassword "${System.env.KEYSTORE_PASS}"
storeFile file('../keystore/googleplay-pfp-keystore.jks')
storePassword "${System.env.KEYSTORE_PASS}"
}

debug {
storeFile file('../keystore/debug.keystore')
}
Expand Down Expand Up @@ -88,33 +79,11 @@ android {
]
}
}
pfp {
dimension 'app'
applicationId 'social.entourage.android.pfp'
buildConfigField 'String', 'API_KEY', '"14fe3580873758c2a63f14aa"'

buildConfigField 'String', 'TEST_ACCOUNT_LOGIN', TEST_PFP_ACCOUNT_LOGIN
buildConfigField 'String', 'TEST_ACCOUNT_PWD', TEST_PFP_ACCOUNT_PWD

ext {
prod = [
serverURL : "https://apipxtgs.entourage.social/api/v1/",
deepLinksHostName: "www.entourage.social/pfp",
deepLinksScheme : "pfp-prod"
]
staging = [
serverURL : "https://pfp-back-preprod.herokuapp.com/api/v1/",
deepLinksHostName: "entourage-landingpages-preprod.herokuapp.com",
deepLinksScheme : "pfp-staging"
]
}
}
}

buildTypes {
release {
productFlavors.entourage.signingConfig signingConfigs.googleplay
productFlavors.pfp.signingConfig signingConfigs.googleplay_pfp
debuggable false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DeepLinkingTest {

@Before
fun setUp() {
/*if(EntourageApplication.get(activityTestRule.activity).entourageComponent.authenticationController?.isAuthenticated == false) {
/*if(EntourageApplication.get(activityTestRule.activity).entourageComponent.authenticationController.isAuthenticated == false) {
Espresso.onView(ViewMatchers.withId(R.id.login_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_edit_phone)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_LOGIN), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.login_edit_code)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_PWD), ViewActions.closeSoftKeyboard())
Expand Down
41 changes: 21 additions & 20 deletions app/src/androidTest/java/social/entourage/android/LoginTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.view.autofill.AutofillManager
import androidx.test.espresso.Espresso
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.IdlingResource
import androidx.test.espresso.action.TypeTextAction
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.matcher.ViewMatchers
Expand All @@ -17,7 +18,7 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import social.entourage.android.authentication.login.LoginActivity
import social.entourage.android.onboarding.login.LoginActivity

@RunWith(AndroidJUnit4::class)
@LargeTest
Expand All @@ -39,7 +40,7 @@ class LoginTest {
}

private fun checkNoUserIsLoggedIn() {
EntourageApplication.get(activityRule.activity).entourageComponent.authenticationController?.logOutUser()
EntourageApplication.get(activityRule.activity).entourageComponent.authenticationController.logOutUser()
}

@After
Expand All @@ -51,24 +52,24 @@ class LoginTest {
@Test
fun loginOK() {
checkNoUserIsLoggedIn()
Espresso.onView(ViewMatchers.withId(R.id.login_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_edit_phone)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_LOGIN), ViewActions.closeSoftKeyboard())
//Espresso.onView(ViewMatchers.withId(R.id.ui_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_phone_et_phone)).perform(TypeTextAction(BuildConfig.TEST_ACCOUNT_LOGIN), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_edit_code)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_PWD), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_et_code)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_PWD), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_button_signin)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_button_signup)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withText(R.string.login_error_title)).check(ViewAssertions.doesNotExist())
//checkNoUserIsLoggedIn();
}

@Test
fun loginOKwithoutCountryCode() {
Espresso.onView(ViewMatchers.withId(R.id.login_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_edit_phone)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_LOGIN.replaceFirst("\\+33".toRegex(), "0")), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_phone_et_phone)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_LOGIN.replaceFirst("\\+33".toRegex(), "0")), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_edit_code)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_PWD), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_et_code)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_PWD), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_button_signin)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_button_signup)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withText(R.string.login_error_title)).check(ViewAssertions.doesNotExist())
//checkNoUserIsLoggedIn();
}
Expand All @@ -84,27 +85,27 @@ class LoginTest {
@Test
fun loginFailureWrongPassword() {
checkNoUserIsLoggedIn()
Espresso.onView(ViewMatchers.withId(R.id.login_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_edit_phone)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_LOGIN), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_phone_et_phone)).perform(ViewActions.typeText(BuildConfig.TEST_ACCOUNT_LOGIN), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_edit_code)).perform(ViewActions.typeText("999999"), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_et_code)).perform(ViewActions.typeText("999999"), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_button_signin)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_button_signup)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withText(R.string.login_error_title)).check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
Espresso.onView(ViewMatchers.withText(R.string.login_retry_label)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_back_button)).perform(ViewActions.click())
//Espresso.onView(ViewMatchers.withId(R.id.login_back_button)).perform(ViewActions.click())
}

@Test
fun loginFailureWrongPhoneNumberFormat() {
Espresso.onView(ViewMatchers.withId(R.id.login_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_edit_phone)).perform(ViewActions.typeText("012345678"), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_button_login)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_phone_et_phone)).perform(ViewActions.typeText("012345678"), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_edit_code)).perform(ViewActions.typeText("000000"), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_et_code)).perform(ViewActions.typeText("000000"), ViewActions.closeSoftKeyboard())
closeAutofill()
Espresso.onView(ViewMatchers.withId(R.id.login_button_signin)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.ui_login_button_signup)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withText(R.string.login_error_title)).check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
Espresso.onView(ViewMatchers.withText(R.string.login_retry_label)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.login_back_button)).perform(ViewActions.click())
//Espresso.onView(ViewMatchers.withId(R.id.login_back_button)).perform(ViewActions.click())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PushNotificationTest {
val content = "{\"extra\":{\"joinable_id\":"+entourageID+",\"joinable_type\":\"Entourage\",\"group_type\":\"action\",\"type\":\"NEW_CHAT_MESSAGE\"},\"message\":\"test\"}"
val message = Message("test Entourage", myobject, content, 0, null)
args.putSerializable(PushNotificationManager.PUSH_MESSAGE, message)
intent.putExtras(args);
intent.putExtras(args)
startIntent(intent)
Espresso.onView(ViewMatchers.withId(R.id.entourage_info_comment)).check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
}
Expand Down
1 change: 1 addition & 0 deletions app/src/entourage/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
android:name=".EntourageApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config"
Expand Down
Binary file modified app/src/entourageStaging/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/entourageStaging/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/entourageStaging/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/entourageStaging/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/entourageStaging/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#A53A3C</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#60F55F24</color>
</resources>
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
android:name=".EntourageApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:fullBackupContent="@xml/backup_descriptor"
Expand Down
Binary file added app/src/main/ic_launcher_round-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 16 additions & 9 deletions app/src/main/java/social/entourage/android/EntourageApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class EntourageApplication : MultiDexApplication() {
private lateinit var librariesSupport: LibrariesSupport

enum class WhiteLabelApp {
ENTOURAGE_APP, PFP_APP
ENTOURAGE_APP,
}

// ----------------------------------
Expand Down Expand Up @@ -74,7 +74,7 @@ class EntourageApplication : MultiDexApplication() {
get() = librariesSupport.firebaseAnalytics

fun me(): User? {
return entourageComponent.authenticationController?.me ?: return null
return entourageComponent.authenticationController.me ?: return null
}

fun onActivityCreated(activity: EntourageActivity) {
Expand Down Expand Up @@ -165,6 +165,15 @@ class EntourageApplication : MultiDexApplication() {
updateBadgeCount()
}

fun updateBadgeCountForCount(count: Int) {
badgeCount = count
if (badgeCount == 0) {
ShortcutBadger.removeCount(applicationContext)
} else {
ShortcutBadger.applyCount(applicationContext, badgeCount)
}
}

// ----------------------------------
// FeedItemsStorage
// ----------------------------------
Expand All @@ -179,7 +188,7 @@ class EntourageApplication : MultiDexApplication() {
}

fun storeNewPushNotification(message: Message, isAdded: Boolean): Int {
val me = entourageComponent.authenticationController?.me ?: return -1
val me = entourageComponent.authenticationController.me ?: return -1
return userFeedItemListCache.saveFeedItemFromNotification(me.id, message, isAdded)
}

Expand All @@ -188,12 +197,12 @@ class EntourageApplication : MultiDexApplication() {
}

private fun updateStorageFeedItem(feedItem: FeedItem) {
val me = entourageComponent.authenticationController?.me ?: return
val me = entourageComponent.authenticationController.me ?: return
userFeedItemListCache.updateFeedItem(me.id, feedItem)
}

fun clearFeedStorage(): Boolean {
val me = entourageComponent.authenticationController?.me ?: return false
val me = entourageComponent.authenticationController.me ?: return false
return userFeedItemListCache.clear(me.id)
}

Expand All @@ -208,23 +217,21 @@ class EntourageApplication : MultiDexApplication() {

const val KEY_IS_FROM_ONBOARDING = "isFromOnboarding"
const val KEY_ONBOARDING_USER_TYPE = "userType"
const val KEY_ONBOARDING_SHOW_POP_FIRSTLOGIN = "isFirstLogin"
// ----------------------------------
// MEMBERS
// ----------------------------------
private lateinit var instance: EntourageApplication
@JvmStatic
fun get(): EntourageApplication {
return instance
}

const val ENTOURAGE_APP = "entourage"
const val PFP_APP = "pfp"
@JvmStatic

operator fun get(context: Context?): EntourageApplication {
return (if (context != null) context.applicationContext as EntourageApplication else get())
}

@JvmStatic
fun me(context: Context?): User? {
return get(context).me()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface EntourageComponent {
val newsfeedRequest: NewsfeedRequest
val invitationRequest: InvitationRequest
val partnerRequest: PartnerRequest
val sharingRequest: SharingRequest
val okHttpClient: OkHttpClient
val complexPreferences: ComplexPreferences?
}
Loading

0 comments on commit e62605f

Please sign in to comment.