diff options
author | aleksandar-stefanovic <theonewithideas@gmail.com> | 2017-03-14 19:44:41 +0100 |
---|---|---|
committer | Aleksandar Stefanović <theonewithideas@gmail.com> | 2017-03-17 08:48:55 +0000 |
commit | b0005f4319acb0a5444453466f056d9b5b4c4a39 (patch) | |
tree | 25eaae0a8c141328a9d7cb1b6c775f471ad2f674 /android | |
parent | e74eade4c10aec0021337c585494329b82a65c02 (diff) |
Made toolbar title use the name of the current dir
It uses the name of the current directory, and if the directory is the
root directory, it uses the app name instead.
Change-Id: I1d8ac2545acb3e75be5b19fb5c208a8cb242de11
Reviewed-on: https://gerrit.libreoffice.org/35201
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Aleksandar Stefanović <theonewithideas@gmail.com>
Diffstat (limited to 'android')
-rw-r--r-- | android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index 4861a8e7468e..f2f408a7c331 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -103,6 +103,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings private DrawerLayout drawerLayout; private NavigationView navigationDrawer; + private ActionBar actionBar; private ActionBarDrawerToggle drawerToggle; private RecyclerView fileRecyclerView; private RecyclerView recentRecyclerView; @@ -136,7 +137,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); - ActionBar actionBar = getSupportActionBar(); + actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); @@ -373,11 +374,13 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings recentRecyclerView.setVisibility(View.VISIBLE); findViewById(R.id.header_browser).setVisibility((View.VISIBLE)); findViewById(R.id.header_recents).setVisibility((View.VISIBLE)); - + actionBar.setTitle(R.string.app_name); } else { recentRecyclerView.setVisibility(View.GONE); findViewById(R.id.header_browser).setVisibility((View.GONE)); findViewById(R.id.header_recents).setVisibility((View.GONE)); + actionBar.setTitle(dir.getName()); + } new AsyncTask<IFile, Void, Void>() { |