Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,4 @@ abstract class BaseComposeGmailFlow(accountEntity: AccountEntity = BASE_ACCOUNT_
const val LOCATION_URL =
"/upload/gmail/v1/users/me/messages/send?uploadType=resumable&upload_id=Location"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
import androidx.test.espresso.action.ViewActions.pressImeActionButton
import androidx.test.espresso.action.ViewActions.replaceText
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.action.ViewActions.typeText
import androidx.test.espresso.action.ViewActions.typeTextIntoFocusedView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents.intending
Expand Down Expand Up @@ -120,7 +119,7 @@ abstract class BaseComposeScreenTest : BaseTest() {
.perform(
scrollTo(),
click(),
typeText(subject),
replaceText(subject),
pressImeActionButton(),
closeSoftKeyboard()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_ENCRYPTED
import jakarta.mail.internet.InternetAddress
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -60,7 +61,7 @@ import java.util.concurrent.TimeUnit
cc = [BaseGmailApiTest.DEFAULT_CC_RECIPIENT],
bcc = [BaseGmailApiTest.DEFAULT_BCC_RECIPIENT],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Fwd: $SUBJECT_EXISTING_ENCRYPTED",
isNew = false
)
class EncryptedForwardOfEncryptedMessageWithOriginalAttachmentsComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -186,4 +187,4 @@ class EncryptedForwardOfEncryptedMessageWithOriginalAttachmentsComposeGmailApiFl
checkEncryptedAttachment(multipart.getBodyPart(2), ATTACHMENT_NAME_3, attachmentsDataCache[2])
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_STANDARD
import jakarta.mail.internet.InternetAddress
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -62,7 +63,7 @@ import java.util.concurrent.TimeUnit
cc = [BaseGmailApiTest.DEFAULT_CC_RECIPIENT],
bcc = [BaseGmailApiTest.DEFAULT_BCC_RECIPIENT],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Fwd: $SUBJECT_EXISTING_STANDARD",
isNew = false
)
class EncryptedForwardOfStandardMessageWithOriginalAttachmentsComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -188,4 +189,4 @@ class EncryptedForwardOfStandardMessageWithOriginalAttachmentsComposeGmailApiFlo
checkEncryptedAttachment(multipart.getBodyPart(2), ATTACHMENT_NAME_3, attachmentsDataCache[2])
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_ENCRYPTED
import jakarta.mail.Message
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -60,7 +61,7 @@ import java.util.concurrent.TimeUnit
cc = [],
bcc = [BaseGmailApiTest.DEFAULT_BCC_RECIPIENT],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Re: $SUBJECT_EXISTING_ENCRYPTED",
isNew = false
)
class EncryptedReplyAllComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -186,4 +187,4 @@ class EncryptedReplyAllComposeGmailApiFlow : BaseComposeGmailFlow() {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import com.flowcrypt.email.rules.RetryRule
import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_STANDARD
import jakarta.mail.Message
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -61,7 +62,7 @@ import java.util.concurrent.TimeUnit
cc = [],
bcc = [],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Re: $SUBJECT_EXISTING_STANDARD",
isNew = false
)
class EncryptedReplyComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -186,4 +187,4 @@ class EncryptedReplyComposeGmailApiFlow : BaseComposeGmailFlow() {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_ENCRYPTED
import jakarta.mail.internet.InternetAddress
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -62,7 +63,7 @@ import java.util.concurrent.TimeUnit
cc = [BaseGmailApiTest.DEFAULT_CC_RECIPIENT],
bcc = [BaseGmailApiTest.DEFAULT_BCC_RECIPIENT],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Fwd: $SUBJECT_EXISTING_ENCRYPTED",
isNew = false
)
class StandardForwardOfEncryptedMessageWithOriginalAttachmentsComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -193,4 +194,4 @@ class StandardForwardOfEncryptedMessageWithOriginalAttachmentsComposeGmailApiFlo
checkStandardAttachment(multipart.getBodyPart(2), ATTACHMENT_NAME_3, attachmentsDataCache[2])
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_PGP_MIME
import jakarta.mail.internet.InternetAddress
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -61,7 +62,7 @@ import java.util.concurrent.TimeUnit
cc = [],
bcc = [],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Fwd: $SUBJECT_EXISTING_PGP_MIME",
isNew = false
)
class StandardForwardOfEncryptedPgpMimeMessageWithOriginalAttachmentsComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -191,4 +192,4 @@ class StandardForwardOfEncryptedPgpMimeMessageWithOriginalAttachmentsComposeGmai
checkStandardAttachment(multipart.getBodyPart(3), ATTACHMENT_NAME_3, attachmentsDataCache[2])
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_STANDARD
import jakarta.mail.internet.InternetAddress
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -60,7 +61,7 @@ import java.util.concurrent.TimeUnit
cc = [BaseGmailApiTest.DEFAULT_CC_RECIPIENT],
bcc = [BaseGmailApiTest.DEFAULT_BCC_RECIPIENT],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Fwd: $SUBJECT_EXISTING_STANDARD",
isNew = false
)
class StandardForwardOfStandardMessageWithOriginalAttachmentsComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -183,4 +184,4 @@ class StandardForwardOfStandardMessageWithOriginalAttachmentsComposeGmailApiFlow
checkStandardAttachment(multipart.getBodyPart(2), ATTACHMENT_NAME_3, attachmentsDataCache[2])
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_STANDARD
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
Expand All @@ -59,7 +60,7 @@ import java.util.concurrent.TimeUnit
cc = [],
bcc = [BaseGmailApiTest.DEFAULT_BCC_RECIPIENT],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Re: $SUBJECT_EXISTING_STANDARD",
isNew = false
)
class StandardReplyAllComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -160,4 +161,4 @@ class StandardReplyAllComposeGmailApiFlow : BaseComposeGmailFlow() {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import com.flowcrypt.email.rules.RetryRule
import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeGmailFlow
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.ui.base.BaseGmailApiTest.Companion.SUBJECT_EXISTING_STANDARD
import jakarta.mail.Message
import jakarta.mail.internet.MimeMultipart
import okhttp3.mockwebserver.Dispatcher
Expand All @@ -59,7 +60,7 @@ import java.util.concurrent.TimeUnit
cc = [],
bcc = [],
message = BaseComposeScreenTest.MESSAGE,
subject = "",
subject = "Re: $SUBJECT_EXISTING_STANDARD",
isNew = false
)
class StandardReplyComposeGmailApiFlow : BaseComposeGmailFlow() {
Expand Down Expand Up @@ -174,4 +175,4 @@ class StandardReplyComposeGmailApiFlow : BaseComposeGmailFlow() {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.widget.Toast
import androidx.activity.OnBackPressedCallback
import androidx.activity.enableEdgeToEdge
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.navigation.NavHostController
import androidx.navigation.ui.AppBarConfiguration
import com.flowcrypt.email.Constants
Expand Down Expand Up @@ -69,12 +73,14 @@ class CreateMessageActivity : BaseActivity<ActivityCreateMessageBinding>(),
}

override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
(navController as? NavHostController)?.enableOnBackPressed(true)
isNavigationArrowDisplayed = true
val navGraph = navController.navInflater.inflate(R.navigation.create_msg_graph)
navController.setGraph(navGraph, intent.extras)
FileAndDirectoryUtils.cleanDir(File(cacheDir, Constants.DRAFT_CACHE_DIR))
applyInsetsToSupportEdgeToEdge()
}

override fun onAccountInfoRefreshed(accountEntity: AccountEntity?) {
Expand All @@ -95,6 +101,15 @@ class CreateMessageActivity : BaseActivity<ActivityCreateMessageBinding>(),
}
}

fun applyInsetsToSupportEdgeToEdge() {
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _, insets ->
val bars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
binding.appBarLayout.updatePadding(top = bars.top)
binding.root.updatePadding(bottom = bars.bottom)
insets
}
}

companion object {
fun generateIntent(
context: Context?,
Expand Down
7 changes: 1 addition & 6 deletions FlowCrypt/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
~ Contributors: denbond7
-->

<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.Material3.DayNight">

<!-- A temporary solution to fix edge-to-edge issue, should be finally fixed by
https://github.com/FlowCrypt/flowcrypt-android/issues/2958
-->
<item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>

<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
Expand Down