mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
Fix a bug with Ok button in FileChooser
This commit is contained in:
parent
2db6151b21
commit
ba3a866690
1 changed files with 14 additions and 13 deletions
|
@ -364,7 +364,6 @@ public class FileChooserActivity extends Activity {
|
|||
else
|
||||
mHistory = new HistoryStore<IFile>(DisplayPrefs._DefHistoryCapacity);
|
||||
mHistory.addListener(new HistoryListener<IFile>() {
|
||||
|
||||
@Override
|
||||
public void onChanged(History<IFile> history) {
|
||||
int idx = history.indexOf(getLocation());
|
||||
|
@ -1363,6 +1362,11 @@ public class FileChooserActivity extends Activity {
|
|||
*/
|
||||
createLocationButtons(path);
|
||||
|
||||
/*
|
||||
* update UI elements
|
||||
*/
|
||||
updateUI(path);
|
||||
|
||||
if (listener != null)
|
||||
listener.onFinish(true, path);
|
||||
}// onPostExecute()
|
||||
|
@ -1391,7 +1395,6 @@ public class FileChooserActivity extends Activity {
|
|||
mHistory.truncateAfter(mLastPath);
|
||||
mHistory.push(dir);
|
||||
mFullHistory.push(dir);
|
||||
checkUIForFolderCreation(dir);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1586,7 +1589,6 @@ public class FileChooserActivity extends Activity {
|
|||
}
|
||||
}
|
||||
});
|
||||
checkUIForFolderCreation(preLoc);
|
||||
} else {
|
||||
mViewGoBack.setEnabled(false);
|
||||
}
|
||||
|
@ -1641,14 +1643,13 @@ public class FileChooserActivity extends Activity {
|
|||
}
|
||||
}
|
||||
});
|
||||
checkUIForFolderCreation(nextLoc);
|
||||
} else {
|
||||
mViewGoForward.setEnabled(false);
|
||||
}
|
||||
}
|
||||
};// mBtnGoForwardOnClickListener
|
||||
|
||||
private void checkUIForFolderCreation(IFile dir){
|
||||
private void updateUI(IFile dir){
|
||||
final boolean isDirectoryWriteable = ((File)dir).canWrite();
|
||||
mViewCreateFolder.setEnabled(isDirectoryWriteable);
|
||||
mBtnOk.setEnabled(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue