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 @@ -10,6 +10,7 @@ import android.content.Intent
import android.net.Uri
import android.os.SystemClock
import android.util.Log
import android.view.View
import androidx.core.content.FileProvider
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
Expand Down Expand Up @@ -48,6 +49,7 @@ import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicReference
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.anyOf
import org.hamcrest.Matchers.equalTo
import org.junit.After
import org.junit.AfterClass
Expand Down Expand Up @@ -253,13 +255,14 @@ class MainActivityTests {
)
}

// the toolbar action now launches ACTION_OPEN_DOCUMENT directly, which the test stubs out.
// it used to raise a chooser of our own that a file manager had to be picked from first.
// the landing screen is the only thing offering to open a document now that the toolbar
// action is gone. exactly one of its two entry points is on screen - the fab is hidden
// while the empty state is up - and which one depends on whether an earlier test already
// left a document in the recent list, so match either.
private fun openDocumentThroughPicker() {
onView(
allOf(
withId(R.id.menu_open),
withContentDescription("Open document"),
anyOf<View>(withId(R.id.landing_open_fab), withId(R.id.landing_empty_open)),
isDisplayed(),
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,6 @@ class MainActivity : AppCompatActivity(), MenuProvider {
analyticsManager.report(AnalyticsConstants.EVENT_SEARCH)
}

R.id.menu_open -> {
findDocument()

analyticsManager.report("menu_open")
analyticsManager.report(
AnalyticsConstants.EVENT_SELECT_CONTENT,
AnalyticsConstants.PARAM_CONTENT_TYPE,
"choose",
)
}

R.id.menu_open_with -> {
documentFragment?.openWith(this)

Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<item
android:id="@+id/menu_open"
android:icon="@drawable/ic_folder_open"
android:title="@string/menu_open"
app:showAsAction="always"
tools:ignore="AlwaysShowAction" />

<item
android:id="@+id/menu_edit"
android:icon="@drawable/ic_edit"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<string name="dialog_uploading_message_appendix">Uploaded files are private and automatically deleted after 24 hours.</string>
<string name="dialog_upload_file">We aren\'t able to open this document, because we don\'t support its format. Do you want to upload it to our server temporarily, so we can display it for you anyway? Uploaded files are private and automatically deleted after 24 hours.</string>
<string name="menu_search">Search in document</string>
<string name="menu_open">Open document</string>
<string name="menu_open_with">Open with...</string>
<string name="menu_share">Share document</string>
<string name="menu_edit">Edit document</string>
Expand Down
Loading