Make resource values for some hardcoded string

This commit is contained in:
David A. Velasco 2012-07-27 15:02:03 +02:00
parent 275eb1f8f8
commit 7c93676d6f
7 changed files with 13 additions and 51 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/createAccount" android:title="Create Account" android:showAsAction="ifRoom|withText"></item>
<item android:id="@+id/createAccount" android:title="@string/create_account" android:showAsAction="ifRoom|withText"></item>
</menu>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/delete_account" android:title="Delete account"></item>
<item android:id="@+id/delete_account" android:title="@string/delete_account"></item>
</menu>

View file

@ -7,5 +7,5 @@
<!-- <item android:id="@+id/search" android:title="@string/actionbar_search" android:icon="@drawable/ic_action_search"></item>-->
<item android:id="@+id/action_upload" android:title="@string/actionbar_upload" android:icon="@drawable/ic_action_upload"></item>
<item android:id="@+id/action_settings" android:title="@string/actionbar_settings" android:icon="@android:drawable/ic_menu_preferences"></item>
<item android:id="@+id/about_app" android:title="About" android:icon="@android:drawable/ic_menu_info_details"></item>
<item android:id="@+id/about_app" android:title="@string/about_title" android:icon="@android:drawable/ic_menu_info_details"></item>
</menu>

View file

@ -33,6 +33,7 @@
<string name="prefs_trackmydevice_interval">Update interval</string>
<string name="prefs_trackmydevice_interval_summary">Update every %1$s minutes</string>
<string name="prefs_accounts">Accounts</string>
<string name="prefs_manage_accounts">Manage accounts</string>
<string name="auth_host_url">ownCloud URL</string>
<string name="auth_username">Username</string>
@ -69,6 +70,12 @@
<string name="common_cancel">Cancel</string>
<string name="common_save_exit">Save &amp; Exit</string>
<string name="common_error">Error</string>
<string name="about_title">About</string>
<string name="delete_account">Delete account</string>
<string name="create_account">Create account</string>
<string name="upload_chooser_title">Upload file from &#8230;</string>
<string name="uploader_info_dirname">Directory name</string>
<string name="uploader_upload_in_progress_ticker">Uploading &#8230;</string>
<string name="uploader_upload_in_progress_content">%1$d%% Uploading %2$s</string>

View file

@ -7,7 +7,7 @@
android:title="@string/prefs_select_oc_account"
android:summary="@string/prefs_summary_select_oc_account"
/ -->
<Preference android:title="Manage accounts" android:key="manage_account" />
<Preference android:title="@string/prefs_manage_accounts" android:key="manage_account" />
<CheckBoxPreference android:title="ownCloud App PIN" android:key="set_pincode"
android:summary="Protect your ownCloud client"/>
<CheckBoxPreference android:key="instant_uploading"

View file

@ -185,7 +185,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
action = action.setType("*/*")
.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(
Intent.createChooser(action, "Upload file from..."),
Intent.createChooser(action, getString(R.string.upload_chooser_title)),
ACTION_SELECT_FILE);
break;
}
@ -441,7 +441,7 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements
break;
case DIALOG_ABOUT_APP: {
builder = new AlertDialog.Builder(this);
builder.setTitle("About");
builder.setTitle(getString(R.string.about_title));
PackageInfo pkg;
try {
pkg = getPackageManager().getPackageInfo(getPackageName(), 0);

View file

@ -406,51 +406,6 @@ public class FileDetailFragment extends SherlockFragment implements
setButtonsForDown();
// Change download button to open button
/*downloadButton.setText(R.string.filedetails_open);
downloadButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String storagePath = mFile.getStoragePath();
String encodedStoragePath = WebdavUtils.encodePath(storagePath);
try {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse("file://"+ encodedStoragePath), mFile.getMimetype());
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
startActivity(i);
} catch (Throwable t) {
Log.e(TAG, "Fail when trying to open with the mimeType provided from the ownCloud server: " + mFile.getMimetype());
boolean toastIt = true;
String mimeType = "";
try {
Intent i = new Intent(Intent.ACTION_VIEW);
mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(storagePath.substring(storagePath.lastIndexOf('.') + 1));
if (mimeType != null && !mimeType.equals(mFile.getMimetype())) {
i.setDataAndType(Uri.parse("file://"+ encodedStoragePath), mimeType);
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
startActivity(i);
toastIt = false;
}
} catch (IndexOutOfBoundsException e) {
Log.e(TAG, "Trying to find out MIME type of a file without extension: " + storagePath);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "No activity found to handle: " + storagePath + " with MIME type " + mimeType + " obtained from extension");
} catch (Throwable th) {
Log.e(TAG, "Unexpected problem when opening: " + storagePath, th);
} finally {
if (toastIt) {
Toast.makeText(getActivity(), "There is no application to handle file " + mFile.getFileName(), Toast.LENGTH_SHORT).show();
}
}
}
}
});*/
} else {
setButtonsForRemote();
}