projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf23f0b
)
Fixed update of id.home action bar button on navigation through FileDisplayActivity
author
David A. Velasco
<dvelasco@solidgear.es>
Mon, 1 Jun 2015 23:00:14 +0000
(
01:00
+0200)
committer
David A. Velasco
<dvelasco@solidgear.es>
Mon, 1 Jun 2015 23:00:14 +0000
(
01:00
+0200)
res/values/strings.xml
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/FileActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
patch
|
blob
|
blame
|
history
diff --git
a/res/values/strings.xml
b/res/values/strings.xml
index
a8ddd76
..
a429808
100644
(file)
--- a/
res/values/strings.xml
+++ b/
res/values/strings.xml
@@
-27,7
+27,6
@@
<string name="drawer_item_on_device">On device</string>-->
<string name="drawer_item_settings">Settings</string>
<string name="drawer_item_logs">Logs</string>
<string name="drawer_item_on_device">On device</string>-->
<string name="drawer_item_settings">Settings</string>
<string name="drawer_item_logs">Logs</string>
- <string name="drawer_open">ownCloud</string>
<string name="drawer_close">Close</string>
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">More</string>
<string name="drawer_close">Close</string>
<string name="prefs_category_general">General</string>
<string name="prefs_category_more">More</string>
diff --git
a/src/com/owncloud/android/ui/activity/FileActivity.java
b/src/com/owncloud/android/ui/activity/FileActivity.java
index
d3efb01
..
28f74e0
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileActivity.java
@@
-39,6
+39,7
@@
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
+import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
@@
-286,6
+287,10
@@
public class FileActivity extends ActionBarActivity
// Sync the toggle state after onRestoreInstanceState has occurred.
if (mDrawerToggle != null) {
mDrawerToggle.syncState();
// Sync the toggle state after onRestoreInstanceState has occurred.
if (mDrawerToggle != null) {
mDrawerToggle.syncState();
+ if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
+ getSupportActionBar().setTitle(R.string.app_name);
+ mDrawerToggle.setDrawerIndicatorEnabled(true);
+ }
}
}
}
}
@@
-357,13
+362,13
@@
public class FileActivity extends ActionBarActivity
this,
mDrawerLayout,
R.drawable.ic_drawer,
this,
mDrawerLayout,
R.drawable.ic_drawer,
- R.string.
drawer_open
,
+ R.string.
app_name
,
R.string.drawer_close) {
/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
R.string.drawer_close) {
/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
super.onDrawerClosed(view);
- updateActionBarTitle();
+ updateActionBarTitle
AndHomeButton
();
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
invalidateOptionsMenu();
getSupportActionBar().setDisplayShowTitleEnabled(true);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
invalidateOptionsMenu();
@@
-372,7
+377,7
@@
public class FileActivity extends ActionBarActivity
/** Called when a drawer has settled in a completely open state. */
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
/** Called when a drawer has settled in a completely open state. */
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
- getSupportActionBar().setTitle(R.string.
drawer_open
);
+ getSupportActionBar().setTitle(R.string.
app_name
);
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
mDrawerToggle.setDrawerIndicatorEnabled(true);
invalidateOptionsMenu();
getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
mDrawerToggle.setDrawerIndicatorEnabled(true);
invalidateOptionsMenu();
@@
-387,7
+392,7
@@
public class FileActivity extends ActionBarActivity
mDrawerLayout.setDrawerListener(mDrawerToggle);
}
mDrawerLayout.setDrawerListener(mDrawerToggle);
}
- protected void updateActionBarTitle(){
+ protected void updateActionBarTitle
AndHomeButton
(){
if (mFile.getParentId() == 0) {
getSupportActionBar().setTitle(getString(
R.string.default_display_name_for_root_folder));
if (mFile.getParentId() == 0) {
getSupportActionBar().setTitle(getString(
R.string.default_display_name_for_root_folder));
diff --git
a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
index
2b07fa4
..
8a64bce
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
@@
-195,9
+195,6
@@
public class FileDisplayActivity extends HookActivity
getSupportActionBar().setHomeButtonEnabled(true); // mandatory since Android ICS,
// according to the official
// documentation
getSupportActionBar().setHomeButtonEnabled(true); // mandatory since Android ICS,
// according to the official
// documentation
- if (getFile() != null) {
- updateActionBarTitle();
- }
setSupportProgressBarIndeterminateVisibility(mSyncInProgress
/*|| mRefreshSharesInProgress*/);
setSupportProgressBarIndeterminateVisibility(mSyncInProgress
/*|| mRefreshSharesInProgress*/);
@@
-263,7
+260,7
@@
public class FileDisplayActivity extends HookActivity
} else {
updateFragmentsVisibility(!file.isFolder());
} else {
updateFragmentsVisibility(!file.isFolder());
- update
NavigationElementsInActionBar
(file.isFolder() ? null : file);
+ update
ActionBarTitleAndHomeButton
(file.isFolder() ? null : file);
}
}
}
}
}
}
@@
-294,7
+291,7
@@
public class FileDisplayActivity extends HookActivity
if (secondFragment != null) {
setSecondFragment(secondFragment);
updateFragmentsVisibility(true);
if (secondFragment != null) {
setSecondFragment(secondFragment);
updateFragmentsVisibility(true);
- update
NavigationElementsInActionBar
(file);
+ update
ActionBarTitleAndHomeButton
(file);
} else {
cleanSecondFragment();
} else {
cleanSecondFragment();
@@
-402,7
+399,7
@@
public class FileDisplayActivity extends HookActivity
tr.commit();
}
updateFragmentsVisibility(false);
tr.commit();
}
updateFragmentsVisibility(false);
- update
NavigationElementsInActionBar
(null);
+ update
ActionBarTitleAndHomeButton
(null);
}
protected void refreshListOfFilesFragment() {
}
protected void refreshListOfFilesFragment() {
@@
-747,7
+744,6
@@
public class FileDisplayActivity extends HookActivity
if (listOfFiles != null) { // should never be null, indeed
setFile(listOfFiles.getCurrentFile());
}
if (listOfFiles != null) { // should never be null, indeed
setFile(listOfFiles.getCurrentFile());
}
- updateActionBarTitle();
cleanSecondFragment();
}
cleanSecondFragment();
}
@@
-1126,7
+1122,6
@@
public class FileDisplayActivity extends HookActivity
// listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root, false);
// listOfFiles.listDirectory(root, MainApp.getOnlyOnDevice());
setFile(listOfFiles.getCurrentFile());
startSyncFolderOperation(root, false);
- updateActionBarTitle();
}
cleanSecondFragment();
}
cleanSecondFragment();
@@
-1140,9
+1135,8
@@
public class FileDisplayActivity extends HookActivity
*/
@Override
public void onBrowsedDownTo(OCFile directory) {
*/
@Override
public void onBrowsedDownTo(OCFile directory) {
- cleanSecondFragment();
setFile(directory);
setFile(directory);
-
updateActionBarTitle
();
+
cleanSecondFragment
();
// Sync Folder
startSyncFolderOperation(directory, false);
// Sync Folder
startSyncFolderOperation(directory, false);
@@
-1159,7
+1153,7
@@
public class FileDisplayActivity extends HookActivity
Fragment detailFragment = new FileDetailFragment(file, getAccount());
setSecondFragment(detailFragment);
updateFragmentsVisibility(true);
Fragment detailFragment = new FileDetailFragment(file, getAccount());
setSecondFragment(detailFragment);
updateFragmentsVisibility(true);
- update
NavigationElementsInActionBar
(file);
+ update
ActionBarTitleAndHomeButton
(file);
setFile(file);
}
setFile(file);
}
@@
-1167,7
+1161,7
@@
public class FileDisplayActivity extends HookActivity
/**
* TODO
*/
/**
* TODO
*/
- private void update
NavigationElementsInActionBar
(OCFile chosenFile) {
+ private void update
ActionBarTitleAndHomeButton
(OCFile chosenFile) {
ActionBar actionBar = getSupportActionBar();
// For adding content description tag to a title field in the action bar
ActionBar actionBar = getSupportActionBar();
// For adding content description tag to a title field in the action bar
@@
-1177,10
+1171,11
@@
public class FileDisplayActivity extends HookActivity
// only list of files - set for browsing through folders
OCFile currentDir = getCurrentDir();
boolean noRoot = (currentDir != null && currentDir.getParentId() != 0);
// only list of files - set for browsing through folders
OCFile currentDir = getCurrentDir();
boolean noRoot = (currentDir != null && currentDir.getParentId() != 0);
-
//
actionBar.setDisplayHomeAsUpEnabled(noRoot);
-
//
actionBar.setDisplayShowTitleEnabled(!noRoot);
+
//
actionBar.setDisplayHomeAsUpEnabled(noRoot);
+
//
actionBar.setDisplayShowTitleEnabled(!noRoot);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
+ mDrawerToggle.setDrawerIndicatorEnabled(!noRoot);
if (!noRoot) {
actionBar.setTitle(getString(R.string.default_display_name_for_root_folder));
View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
if (!noRoot) {
actionBar.setTitle(getString(R.string.default_display_name_for_root_folder));
View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
@@
-1194,6
+1189,7
@@
public class FileDisplayActivity extends HookActivity
} else {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
} else {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
+ mDrawerToggle.setDrawerIndicatorEnabled(false);
actionBar.setTitle(chosenFile.getFileName());
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
actionBar.setTitle(chosenFile.getFileName());
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
@@
-1665,7
+1661,7
@@
public class FileDisplayActivity extends HookActivity
autoplay);
setSecondFragment(mediaFragment);
updateFragmentsVisibility(true);
autoplay);
setSecondFragment(mediaFragment);
updateFragmentsVisibility(true);
- update
NavigationElementsInActionBar
(file);
+ update
ActionBarTitleAndHomeButton
(file);
setFile(file);
}
setFile(file);
}
@@
-1682,7
+1678,7
@@
public class FileDisplayActivity extends HookActivity
mWaitingToPreview = file;
requestForDownload();
updateFragmentsVisibility(true);
mWaitingToPreview = file;
requestForDownload();
updateFragmentsVisibility(true);
- update
NavigationElementsInActionBar
(file);
+ update
ActionBarTitleAndHomeButton
(file);
setFile(file);
}
setFile(file);
}