diff --git a/android/source/AndroidManifest.xml.in b/android/source/AndroidManifest.xml.in index 06b8089ef9ed..b45918297322 100644 --- a/android/source/AndroidManifest.xml.in +++ b/android/source/AndroidManifest.xml.in @@ -106,6 +106,14 @@ + + + + + + + diff --git a/android/source/res/values/strings.xml b/android/source/res/values/strings.xml index d978413b092e..d2970b28c4d8 100644 --- a/android/source/res/values/strings.xml +++ b/android/source/res/values/strings.xml @@ -57,4 +57,12 @@ Show keyboard Save + + Storage provider settings + ownCloud settings + Server URL + URL and port of the ownCloud server. + User name + Password + diff --git a/android/source/res/xml/documentprovider_preferences.xml b/android/source/res/xml/documentprovider_preferences.xml new file mode 100644 index 000000000000..a359d14c4460 --- /dev/null +++ b/android/source/res/xml/documentprovider_preferences.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/android/source/src/java/org/libreoffice/storage/DocumentProviderSettingsActivity.java b/android/source/src/java/org/libreoffice/storage/DocumentProviderSettingsActivity.java new file mode 100644 index 000000000000..bb04855ab95c --- /dev/null +++ b/android/source/src/java/org/libreoffice/storage/DocumentProviderSettingsActivity.java @@ -0,0 +1,37 @@ +/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package org.libreoffice.storage; + +import org.libreoffice.R; + +import android.app.Activity; +import android.os.Bundle; +import android.preference.PreferenceFragment; + +public class DocumentProviderSettingsActivity extends Activity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Display the fragment as the main content. + getFragmentManager().beginTransaction() + .replace(android.R.id.content, new SettingsFragment()).commit(); + } + + public static class SettingsFragment extends PreferenceFragment { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Load the preferences from an XML resource + addPreferencesFromResource(R.xml.documentprovider_preferences); + } + } +} diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index 7ac40e4f8049..76842ec77357 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -108,7 +108,10 @@ public class LibreOfficeUIActivity extends ActionBarActivity implements ActionBa DocumentProviderFactory.initialize(this); documentProviderFactory = DocumentProviderFactory.getInstance(); + PreferenceManager.setDefaultValues(this, R.xml.documentprovider_preferences, false); + readPreferences(); + // init UI and populate with contents from the provider createUI(); switchToDocumentProvider(documentProviderFactory.getDefaultProvider());