diff options
author | Tomasz Mikolajewski <mtomasz@google.com> | 2015-06-12 16:22:17 -0700 |
---|---|---|
committer | Tomasz Mikolajewski <mtomasz@google.com> | 2015-06-17 16:12:14 -0700 |
commit | 0e591f95bd023fc153520efe0852180bb580a442 (patch) | |
tree | f56826513568a6700e66056cc457e617b390e82e /packages/DocumentsUI | |
parent | c20c1eec9e222870b08c079898dbc334858994cc (diff) | |
download | frameworks_base-0e591f95bd023fc153520efe0852180bb580a442.zip frameworks_base-0e591f95bd023fc153520efe0852180bb580a442.tar.gz frameworks_base-0e591f95bd023fc153520efe0852180bb580a442.tar.bz2 |
Allow to customize title of the dialog.
TEST=adb shell am start -a android.intent.action.OPEN_DOCUMENT -e
android.intent.extra.TITLE 'Upload!' -t "text/plain"
BUG=19150996
Change-Id: Ibded6cfaa2de3698c5eada154efbee2b323464d4
Diffstat (limited to 'packages/DocumentsUI')
-rw-r--r-- | packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java index 90ccf91..4211406 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +++ b/packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java @@ -393,13 +393,18 @@ public class DocumentsActivity extends BaseActivity { @Override public void updateActionBar() { if (mRootsToolbar != null) { - if (mState.action == ACTION_OPEN || - mState.action == ACTION_GET_CONTENT || - mState.action == ACTION_OPEN_TREE) { - mRootsToolbar.setTitle(R.string.title_open); - } else if (mState.action == ACTION_CREATE || - mState.action == ACTION_OPEN_COPY_DESTINATION) { - mRootsToolbar.setTitle(R.string.title_save); + final String prompt = getIntent().getStringExtra(DocumentsContract.EXTRA_PROMPT); + if (prompt != null) { + mRootsToolbar.setTitle(prompt); + } else { + if (mState.action == ACTION_OPEN || + mState.action == ACTION_GET_CONTENT || + mState.action == ACTION_OPEN_TREE) { + mRootsToolbar.setTitle(R.string.title_open); + } else if (mState.action == ACTION_CREATE || + mState.action == ACTION_OPEN_COPY_DESTINATION) { + mRootsToolbar.setTitle(R.string.title_save); + } } } |