Add document name in toolbar
This commit is contained in:
parent
7f59118453
commit
c6fb2aceda
@ -440,6 +440,15 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
|
|||||||
return mPasswordPromptFragment;
|
return mPasswordPromptFragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setToolbarTitleWithDocumentName() {
|
||||||
|
String documentName = getCurrentDocumentName();
|
||||||
|
if (documentName != null && !documentName.isEmpty()) {
|
||||||
|
getSupportActionBar().setTitle(documentName);
|
||||||
|
} else {
|
||||||
|
getSupportActionBar().setTitle(R.string.app_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@ -471,6 +480,7 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
|
|||||||
@Override
|
@Override
|
||||||
public void onLoadFinished(@NonNull Loader<List<CharSequence>> loader, List<CharSequence> data) {
|
public void onLoadFinished(@NonNull Loader<List<CharSequence>> loader, List<CharSequence> data) {
|
||||||
mDocumentProperties = data;
|
mDocumentProperties = data;
|
||||||
|
setToolbarTitleWithDocumentName();
|
||||||
LoaderManager.getInstance(this).destroyLoader(DocumentPropertiesLoader.ID);
|
LoaderManager.getInstance(this).destroyLoader(DocumentPropertiesLoader.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user