[Libreoffice-commits] online.git: 5 commits - android/app android/build.gradle
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Mar 27 13:52:17 UTC 2019
android/app/build.gradle | 18
android/app/src/main/AndroidManifest.xml | 157 -
android/app/src/main/assets/templates/untitled.odg |binary
android/app/src/main/assets/templates/untitled.odp |binary
android/app/src/main/assets/templates/untitled.ods |binary
android/app/src/main/assets/templates/untitled.odt |binary
android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java | 111
android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java | 161 +
android/app/src/main/java/org/libreoffice/androidapp/LibreOfficeApplication.java | 33
android/app/src/main/java/org/libreoffice/androidapp/LocaleHelper.java | 56
android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java | 129
android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderSettingsActivity.java | 103
android/app/src/main/java/org/libreoffice/androidapp/storage/IDocumentProvider.java | 70
android/app/src/main/java/org/libreoffice/androidapp/storage/IFile.java | 116
android/app/src/main/java/org/libreoffice/androidapp/storage/IOUtils.java | 56
android/app/src/main/java/org/libreoffice/androidapp/storage/external/BrowserSelectorActivity.java | 154 +
android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserActivity.java | 43
android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserFragment.java | 200 +
android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExternalFile.java | 164 +
android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java | 176 +
android/app/src/main/java/org/libreoffice/androidapp/storage/external/IExternalDocumentProvider.java | 22
android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java | 90
android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsDirectoryProvider.java | 74
android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsProvider.java | 60
android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalFile.java | 103
android/app/src/main/java/org/libreoffice/androidapp/ui/FileUtilities.java | 278 ++
android/app/src/main/java/org/libreoffice/androidapp/ui/FolderIconView.java | 204 +
android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java | 1309 ++++++++++
android/app/src/main/java/org/libreoffice/androidapp/ui/PageView.java | 69
android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java | 94
android/app/src/main/res/anim/fab_close.xml | 19
android/app/src/main/res/anim/fab_open.xml | 19
android/app/src/main/res/drawable-hdpi/lo_icon.png |binary
android/app/src/main/res/drawable-mdpi/lo_icon.png |binary
android/app/src/main/res/drawable/calc.png |binary
android/app/src/main/res/drawable/draw.png |binary
android/app/src/main/res/drawable/dummy_page.png |binary
android/app/src/main/res/drawable/ic_add_black_24dp.xml | 9
android/app/src/main/res/drawable/ic_cloud_black_24dp.xml | 9
android/app/src/main/res/drawable/ic_filter_list_black_24dp.xml | 9
android/app/src/main/res/drawable/ic_folder_black_24dp.xml | 5
android/app/src/main/res/drawable/ic_menu_back.png |binary
android/app/src/main/res/drawable/ic_sd_card_black_24dp.xml | 9
android/app/src/main/res/drawable/ic_settings_black_24dp.xml | 9
android/app/src/main/res/drawable/ic_sort_black_24dp.xml | 13
android/app/src/main/res/drawable/ic_storage_black_24dp.xml | 9
android/app/src/main/res/drawable/ic_usb_black_24dp.xml | 7
android/app/src/main/res/drawable/impress.png |binary
android/app/src/main/res/drawable/label_background.xml | 9
android/app/src/main/res/drawable/writer.png |binary
android/app/src/main/res/layout/about.xml | 45
android/app/src/main/res/layout/activity_directory_browser.xml | 6
android/app/src/main/res/layout/activity_document_browser.xml | 266 ++
android/app/src/main/res/layout/file_explorer_grid_item.xml | 42
android/app/src/main/res/layout/file_list_item.xml | 58
android/app/src/main/res/layout/fragment_directory_browser.xml | 71
android/app/src/main/res/layout/item_recent_files.xml | 38
android/app/src/main/res/menu/context_menu.xml | 7
android/app/src/main/res/menu/navigation_menu.xml | 35
android/app/src/main/res/menu/view_menu.xml | 65
android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml | 5
android/app/src/main/res/values/arrays.xml | 6
android/app/src/main/res/values/colors.xml | 44
android/app/src/main/res/values/dimens.xml | 8
android/app/src/main/res/values/ids.xml | 4
android/app/src/main/res/values/integers.xml | 4
android/app/src/main/res/values/strings.xml | 102
android/app/src/main/res/values/styles.xml | 6
android/app/src/main/res/values/themes.xml | 32
android/app/src/main/res/xml/documentprovider_preferences.xml | 38
android/build.gradle | 2
dev/null |binary
72 files changed, 4980 insertions(+), 80 deletions(-)
New commits:
commit 3bcd9ba2a6fc719052d56691f895651c1f7e82d0
Author: Florin Ciornei <florin.ciornei at collabora.com>
AuthorDate: Wed Mar 27 13:24:26 2019 +0100
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Mar 27 14:48:58 2019 +0100
android: Display notification when creating file if such a file already exists
Change-Id: I2901e499135903d2649ee8ee62f144fc10a17a05
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
index cacc30761..059462052 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
@@ -27,7 +27,9 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
+import android.text.Editable;
import android.text.InputType;
+import android.text.TextWatcher;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@@ -599,10 +601,26 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
private void createNewFileInputDialog(final String defaultFileName, final String newDocumentType,final String extension) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.create_new_document_title);
+
+ LinearLayout layout = new LinearLayout(this);
+ layout.setOrientation(LinearLayout.VERTICAL);
+
+ //file name input
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_TEXT);
input.setText(defaultFileName);
- builder.setView(input);
+ layout.addView(input);
+
+
+ //warning text to notify the user that such a file already exists
+ final TextView warningText = new TextView(this);
+ warningText.setText("A file with this name already exits, and it will be overwritten.");
+ layout.addView(warningText);
+ //check if the file exists when showing the create dialog
+ File tempFile = new File(currentDirectory.getUri().getPath() + input.getText().toString());
+ warningText.setVisibility(tempFile.exists()?View.VISIBLE:View.GONE);
+
+ builder.setView(layout);
builder.setPositiveButton(R.string.action_create, new DialogInterface.OnClickListener() {
@Override
@@ -618,6 +636,19 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
});
+ //check if a file with this name already exists and notify the user
+ input.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void onTextChanged(CharSequence c, int start, int before, int count) {
+ File tempFile = new File(currentDirectory.getUri().getPath() + input.getText().toString());
+ warningText.setVisibility(tempFile.exists()?View.VISIBLE:View.GONE);
+ }
+ @Override
+ public void afterTextChanged(Editable s) {}
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
+ });
+
builder.show();
}
commit 887856736925199791a706d693b0d8c85a73be7c
Author: Florin Ciornei <florin.ciornei at collabora.com>
AuthorDate: Tue Mar 26 18:01:01 2019 +0100
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Mar 27 14:35:23 2019 +0100
android: Add create document option
Activity should be restarted to see the newly created documents
Change-Id: I57113ca92e99dc58301d3cddae165f4edfdddcc1
diff --git a/android/app/src/main/assets/templates/untitled.odg b/android/app/src/main/assets/templates/untitled.odg
new file mode 100644
index 000000000..e511018d0
Binary files /dev/null and b/android/app/src/main/assets/templates/untitled.odg differ
diff --git a/android/app/src/main/assets/templates/untitled.odp b/android/app/src/main/assets/templates/untitled.odp
new file mode 100644
index 000000000..7fc84f8e8
Binary files /dev/null and b/android/app/src/main/assets/templates/untitled.odp differ
diff --git a/android/app/src/main/assets/templates/untitled.ods b/android/app/src/main/assets/templates/untitled.ods
new file mode 100644
index 000000000..d8db004b2
Binary files /dev/null and b/android/app/src/main/assets/templates/untitled.ods differ
diff --git a/android/app/src/main/assets/templates/untitled.odt b/android/app/src/main/assets/templates/untitled.odt
new file mode 100644
index 000000000..1d86776b7
Binary files /dev/null and b/android/app/src/main/assets/templates/untitled.odt differ
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
index 552ca89c0..cacc30761 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
@@ -60,9 +60,16 @@ import org.libreoffice.androidapp.storage.DocumentProviderSettingsActivity;
import org.libreoffice.androidapp.storage.IDocumentProvider;
import org.libreoffice.androidapp.storage.IFile;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileFilter;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
@@ -87,13 +94,12 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-
//import org.libreoffice.LOKitShell;
//import org.libreoffice.LibreOfficeMainActivity;
//import org.libreoffice.SettingsActivity;
//import org.libreoffice.SettingsListenerModel;
-public class LibreOfficeUIActivity extends AppCompatActivity implements /*SettingsListenerModel.OnSettingsPreferenceChangedListener,*/ View.OnClickListener{
+public class LibreOfficeUIActivity extends AppCompatActivity implements /*SettingsListenerModel.OnSettingsPreferenceChangedListener,*/ View.OnClickListener {
private String LOGTAG = LibreOfficeUIActivity.class.getSimpleName();
private SharedPreferences prefs;
private int filterMode = FileUtilities.ALL;
@@ -185,7 +191,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
@Override
protected void attachBaseContext(Context newBase) {
- super.attachBaseContext(LocaleHelper.onAttach(newBase,"en"));
+ super.attachBaseContext(LocaleHelper.onAttach(newBase, "en"));
}
public void createUI() {
@@ -193,7 +199,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
setContentView(R.layout.activity_document_browser);
- Toolbar toolbar=findViewById(R.id.toolbar);
+ Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
actionBar = getSupportActionBar();
@@ -224,11 +230,11 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
final ArrayList<IFile> recentFiles = new ArrayList<IFile>();
for (String recentFileString : recentFileStrings) {
try {
- if(documentProvider != null)
+ if (documentProvider != null)
recentFiles.add(documentProvider.createFromUri(this, new URI(recentFileString)));
} catch (URISyntaxException e) {
e.printStackTrace();
- } catch (RuntimeException e){
+ } catch (RuntimeException e) {
e.printStackTrace();
}
}
@@ -252,7 +258,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
// Loop through the document providers menu items and check if they are available or not
//TODO remove -1. Used right now to ignore opencloud
- for (int index = 0; index < providerNames.size()-1; index++) {
+ for (int index = 0; index < providerNames.size() - 1; index++) {
MenuItem item = navigationDrawer.getMenu().getItem(index);
item.setEnabled(documentProviderFactory.getProvider(index).checkProviderAvailability(this));
}
@@ -409,7 +415,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
- ContextMenuInfo menuInfo) {
+ ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.context_menu, menu);
@@ -429,7 +435,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
}
- private boolean isViewModeList(){
+ private boolean isViewModeList() {
return viewMode == LIST_VIEW;
}
@@ -446,17 +452,16 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
List<IFile> paths = homeDirectory.listFiles(FileUtilities
.getFileFilter(filterMode));
filePaths = new ArrayList<IFile>();
- for(IFile file: paths) {
- if(showHiddenFiles){
+ for (IFile file : paths) {
+ if (showHiddenFiles) {
filePaths.add(file);
} else {
- if(!file.getName().startsWith(".")){
+ if (!file.getName().startsWith(".")) {
filePaths.add(file);
}
}
}
- }
- catch (final RuntimeException e) {
+ } catch (final RuntimeException e) {
final Activity activity = LibreOfficeUIActivity.this;
activity.runOnUiThread(new Runnable() {
@Override
@@ -466,7 +471,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
});
startActivity(new Intent(activity, DocumentProviderSettingsActivity.class));
- Log.e(LOGTAG, "failed to switch document provider "+ e.getMessage(), e.getCause());
+ Log.e(LOGTAG, "failed to switch document provider " + e.getMessage(), e.getCause());
return null;
}
//no exception
@@ -499,7 +504,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
findViewById(R.id.header_recents).setVisibility((View.GONE));
actionBar.setTitle(dir.getName());
findViewById(R.id.text_directory_path).setVisibility(View.VISIBLE);
- ((TextView)findViewById(R.id.text_directory_path)).setText(getString(R.string.current_dir,
+ ((TextView) findViewById(R.id.text_directory_path)).setText(getString(R.string.current_dir,
dir.getUri().getPath()));
}
@@ -514,17 +519,16 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
List<IFile> paths = currentDirectory.listFiles(FileUtilities
.getFileFilter(filterMode));
filePaths = new ArrayList<IFile>();
- for(IFile file: paths) {
- if(showHiddenFiles){
+ for (IFile file : paths) {
+ if (showHiddenFiles) {
filePaths.add(file);
} else {
- if(!file.getName().startsWith(".")){
+ if (!file.getName().startsWith(".")) {
filePaths.add(file);
}
}
}
- }
- catch (final RuntimeException e) {
+ } catch (final RuntimeException e) {
final Activity activity = LibreOfficeUIActivity.this;
activity.runOnUiThread(new Runnable() {
@Override
@@ -592,7 +596,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
// Opens an Input dialog to get the name of new file
- private void createNewFileInputDialog(final String defaultFileName, final String newDocumentType) {
+ private void createNewFileInputDialog(final String defaultFileName, final String newDocumentType,final String extension) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.create_new_document_title);
final EditText input = new EditText(this);
@@ -603,8 +607,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
builder.setPositiveButton(R.string.action_create, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- final String newFilePath = currentDirectory.getUri().getPath() + input.getText().toString();
- loadNewDocument(newDocumentType, newFilePath);
+ createNewFile(currentDirectory.getUri().getPath() + input.getText().toString(),extension);
}
});
@@ -618,6 +621,39 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
builder.show();
}
+
+ /**
+ * Creates a new file at the specified path, by copying an empty template to that location.
+ * @param path the complete path (including the file name) where the file will be created
+ * @param extension is required to now what template should be used when creating the document
+ */
+ private void createNewFile(final String path,final String extension){
+ InputStream templateFileStream = null;
+ //create a new file where the template will be written
+ File newFile = new File(path );
+ OutputStream newFileStream = null;
+ try {
+ //read the template and copy it to the new file
+ templateFileStream = getAssets().open("templates/untitled"+extension);
+ newFileStream = new FileOutputStream(newFile);
+ byte[] buffer = new byte[1024];
+ int length;
+ while ((length = templateFileStream.read(buffer)) > 0) {
+ newFileStream.write(buffer, 0, length);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ //close the streams
+ templateFileStream.close();
+ newFileStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
private void loadNewDocument(String newDocumentType, String newFilePath) {
//TODO finish document loading
// Intent intent = new Intent(LibreOfficeUIActivity.this, LibreOfficeMainActivity.class);
@@ -761,7 +797,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
switch (item.getItemId()) {
case android.R.id.home:
- if (!currentDirectory.equals(homeDirectory)){
+ if (!currentDirectory.equals(homeDirectory)) {
openParentDirectory();
}
break;
@@ -836,7 +872,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
AboutDialogFragment aboutDialogFragment = new AboutDialogFragment();
aboutDialogFragment.show(getSupportFragmentManager(), "AboutDialogFragment");
}
- return true;
+ return true;
case R.id.action_settings:
//TODO import the settings activity
// startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
@@ -848,12 +884,12 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
return true;
}
- public void readPreferences(){
+ public void readPreferences() {
prefs = getSharedPreferences(EXPLORER_PREFS_KEY, MODE_PRIVATE);
sortMode = prefs.getInt(SORT_MODE_KEY, FileUtilities.SORT_AZ);
SharedPreferences defaultPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
- viewMode = Integer.valueOf(defaultPrefs.getString(EXPLORER_VIEW_TYPE_KEY, ""+ GRID_VIEW));
- filterMode = Integer.valueOf(defaultPrefs.getString(FILTER_MODE_KEY , "-1"));
+ viewMode = Integer.valueOf(defaultPrefs.getString(EXPLORER_VIEW_TYPE_KEY, "" + GRID_VIEW));
+ filterMode = Integer.valueOf(defaultPrefs.getString(FILTER_MODE_KEY, "-1"));
showHiddenFiles = defaultPrefs.getBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY, false);
displayLanguage = defaultPrefs.getString(DISPLAY_LANGUAGE, "en");
@@ -869,12 +905,12 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
if (i.hasExtra(FILTER_MODE_KEY)) {
- filterMode = i.getIntExtra( FILTER_MODE_KEY, FileUtilities.ALL);
+ filterMode = i.getIntExtra(FILTER_MODE_KEY, FileUtilities.ALL);
Log.d(LOGTAG, FILTER_MODE_KEY);
}
if (i.hasExtra(EXPLORER_VIEW_TYPE_KEY)) {
- viewMode = i.getIntExtra( EXPLORER_VIEW_TYPE_KEY, GRID_VIEW);
+ viewMode = i.getIntExtra(EXPLORER_VIEW_TYPE_KEY, GRID_VIEW);
Log.d(LOGTAG, EXPLORER_VIEW_TYPE_KEY);
}
@@ -894,16 +930,16 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
// TODO Auto-generated method stub
super.onSaveInstanceState(outState);
- if(currentDirectory != null) {
+ if (currentDirectory != null) {
outState.putString(CURRENT_DIRECTORY_KEY, currentDirectory.getUri().toString());
Log.d(LOGTAG, currentDirectory.toString() + Integer.toString(filterMode) + Integer.toString(viewMode));
}
outState.putInt(FILTER_MODE_KEY, filterMode);
- outState.putInt(EXPLORER_VIEW_TYPE_KEY , viewMode);
- if(documentProvider != null)
+ outState.putInt(EXPLORER_VIEW_TYPE_KEY, viewMode);
+ if (documentProvider != null)
outState.putInt(DOC_PROVIDER_KEY, documentProvider.getId());
- outState.putBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY , showHiddenFiles);
+ outState.putBoolean(ENABLE_SHOW_HIDDEN_FILES_KEY, showHiddenFiles);
//prefs.edit().putInt(EXPLORER_VIEW_TYPE, viewType).commit();
Log.d(LOGTAG, "savedInstanceState");
@@ -913,7 +949,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
protected void onRestoreInstanceState(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onRestoreInstanceState(savedInstanceState);
- if (savedInstanceState.isEmpty()){
+ if (savedInstanceState.isEmpty()) {
return;
}
if (documentProvider == null) {
@@ -947,6 +983,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
}
};
+
@Override
protected void onPause() {
super.onPause();
@@ -957,7 +994,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
protected void onResume() {
super.onResume();
Log.d(LOGTAG, "onResume");
- Log.d(LOGTAG, "sortMode="+ sortMode + " filterMode=" + filterMode);
+ Log.d(LOGTAG, "sortMode=" + sortMode + " filterMode=" + filterMode);
createUI();
}
@@ -989,7 +1026,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
Log.d(LOGTAG, "onDestroy");
}
- private int dpToPx(int dp){
+ private int dpToPx(int dp) {
final float scale = getApplicationContext().getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}
@@ -1079,7 +1116,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
@Override
public void onClick(View v) {
int id = v.getId();
- switch (id){
+ switch (id) {
case R.id.editFAB:
if (isFabMenuOpen) {
collapseFabMenu();
@@ -1088,16 +1125,16 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
break;
case R.id.newWriterFAB:
- createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_WRITER_EXTENSION, NEW_WRITER_STRING_KEY);
+ createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_WRITER_EXTENSION, NEW_WRITER_STRING_KEY,FileUtilities.DEFAULT_WRITER_EXTENSION);
break;
case R.id.newImpressFAB:
- createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_IMPRESS_EXTENSION, NEW_IMPRESS_STRING_KEY);
+ createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_IMPRESS_EXTENSION, NEW_IMPRESS_STRING_KEY,FileUtilities.DEFAULT_IMPRESS_EXTENSION);
break;
case R.id.newCalcFAB:
- createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_SPREADSHEET_EXTENSION, NEW_CALC_STRING_KEY);
+ createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_SPREADSHEET_EXTENSION, NEW_CALC_STRING_KEY,FileUtilities.DEFAULT_SPREADSHEET_EXTENSION);
break;
case R.id.newDrawFAB:
- createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_DRAWING_EXTENSION, NEW_DRAW_STRING_KEY);
+ createNewFileInputDialog(getString(R.string.default_document_name) + FileUtilities.DEFAULT_DRAWING_EXTENSION, NEW_DRAW_STRING_KEY,FileUtilities.DEFAULT_DRAWING_EXTENSION);
break;
}
}
@@ -1167,7 +1204,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
// Date and Size field only exist when we are displaying items in a list.
- if(isViewModeList()) {
+ if (isViewModeList()) {
if (!file.isDirectory()) {
String size;
long length = filePaths.get(position).getSize();
@@ -1212,7 +1249,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
}
- private void setEditFABVisibility(final int visibility){
+ private void setEditFABVisibility(final int visibility) {
LOKitShell.getMainHandler().post(new Runnable() {
@Override
public void run() {
@@ -1223,17 +1260,17 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
- switch(requestCode){
+ switch (requestCode) {
case PERMISSION_WRITE_EXTERNAL_STORAGE:
- if(permissions.length>0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
+ if (permissions.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
switchToDocumentProvider(documentProviderFactory.getDefaultProvider());
setEditFABVisibility(View.VISIBLE);
} else {
setEditFABVisibility(View.INVISIBLE);
}
break;
- default:
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+ default:
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
}
commit 16e45aef60ddd5db74427d967fe17e9e70141b0f
Author: Florin Ciornei <florin.ciornei at collabora.com>
AuthorDate: Mon Mar 25 16:29:17 2019 +0100
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Mar 27 14:35:23 2019 +0100
android: Create FAB button now appears in the document browser.
Still have to implement the creations of the documents.
Change-Id: Icf1864b7d748636c6a3a0dec0eeb940d1fbcd8cc
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 0c53c80b5..9270a0a1b 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -12,6 +12,7 @@
<application
+ android:name=".LibreOfficeApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java b/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java
index db7094c16..61a8fde48 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java
@@ -23,7 +23,7 @@ public class LOKitShell {
// return metrics.density * 160;
// }
//
- //TODO right now this script is used only for this method that is neccessary to display the editFAB
+ //TODO right now this script is used only for this method that is necessary to display the editFAB
// Get a Handler for the main java thread
public static Handler getMainHandler() {
return LibreOfficeApplication.getMainHandler();
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
index 9aa0e0163..552ca89c0 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
@@ -52,6 +52,7 @@ import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.navigation.NavigationView;
import org.libreoffice.androidapp.AboutDialogFragment;
+import org.libreoffice.androidapp.LOKitShell;
import org.libreoffice.androidapp.LocaleHelper;
import org.libreoffice.androidapp.R;
import org.libreoffice.androidapp.storage.DocumentProviderFactory;
@@ -1212,12 +1213,12 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements /*Settin
}
private void setEditFABVisibility(final int visibility){
-// LOKitShell.getMainHandler().post(new Runnable() {
-// @Override
-// public void run() {
-// editFAB.setVisibility(visibility);
-// }
-// });
+ LOKitShell.getMainHandler().post(new Runnable() {
+ @Override
+ public void run() {
+ editFAB.setVisibility(visibility);
+ }
+ });
}
@Override
commit 89d920d682fb2f23e0186068dbccf17b044cda3b
Author: Florin Ciornei <florin.ciornei at collabora.com>
AuthorDate: Fri Mar 22 17:24:47 2019 +0100
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Mar 27 14:35:21 2019 +0100
android: Port document browser from the old Java app to the new one.
Edit FAB still doesn't work, and the opencloud document browser should be
implemented
Change-Id: I788bf271b543e397cb156b970116614e73f1ad95
diff --git a/android/app/build.gradle b/android/app/build.gradle
index a628b9ccf..305c66e4a 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -26,7 +26,7 @@ android {
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
- 'proguard-rules.pro'
+ 'proguard-rules.pro'
}
}
sourceSets {
@@ -54,6 +54,8 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation 'androidx.recyclerview:recyclerview:1.0.0'
+ implementation 'com.google.android.material:material:1.1.0-alpha04'
}
task copyUnpackAssets(type: Copy) {
@@ -165,11 +167,11 @@ task createStrippedConfigRegistry(type: Exec) {
task createRCfiles {
inputs.file "liboSettings.gradle"
dependsOn copyUnpackAssets, copyAssets
- def sofficerc = file('src/main/assets/unpack/program/sofficerc')
+ def sofficerc = file('src/main/assets/unpack/program/sofficerc')
def fundamentalrc = file('src/main/assets/program/fundamentalrc')
- def bootstraprc = file('src/main/assets/program/bootstraprc')
- def unorc = file('src/main/assets/program/unorc')
- def versionrc = file('src/main/assets/program/versionrc')
+ def bootstraprc = file('src/main/assets/program/bootstraprc')
+ def unorc = file('src/main/assets/program/unorc')
+ def versionrc = file('src/main/assets/program/versionrc')
outputs.files sofficerc, fundamentalrc, unorc, bootstraprc, versionrc
@@ -183,7 +185,7 @@ task createRCfiles {
OSL_SOCKET_PATH=$APP_DATA_DIR/cache
'''.stripIndent()
- fundamentalrc.text = '''\
+ fundamentalrc.text = '''\
[Bootstrap]
LO_LIB_DIR=file://$APP_DATA_DIR/lib/
BRAND_BASE_DIR=file:///assets
@@ -191,10 +193,10 @@ task createRCfiles {
URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
'''.stripIndent()
- bootstraprc.text = '''\
+ bootstraprc.text = '''\
[Bootstrap]
InstallMode=<installmode>
- ProductKey=LibreOffice '''+ "${liboVersionMajor}.${liboVersionMinor}" + '''
+ ProductKey=LibreOffice ''' + "${liboVersionMajor}.${liboVersionMinor}" + '''
UserInstallation=file://$APP_DATA_DIR
'''.stripIndent()
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 96b8667c3..0c53c80b5 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -2,6 +2,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libreoffice.androidapp">
+ <!-- App requires OpenGL ES 2.0 -->
+ <uses-feature android:glEsVersion="0x00020000" android:required="true" />
+ <!-- App wants to know if device supports USB host capability(not mandatory) -->
+ <uses-feature android:name="android.hardware.usb.host" android:required="false"/>
+ <uses-feature android:name="android.hardware.camera" android:required="false"/>
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
@@ -10,76 +16,112 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
- android:theme="@style/Theme.AppCompat.NoActionBar">
- <activity android:name=".MainActivity">
+ android:theme="@style/LibreOfficeTheme">
+
+
+ <!-- Document Browser Activity -->
+ <activity android:name=".ui.LibreOfficeUIActivity"
+ android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
-
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
-
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
+
<category android:name="android.intent.category.DEFAULT" />
- <data android:scheme="file"/>
- <data android:scheme="content"/>
-
- <!-- ODF -->
- <data android:mimeType="application/vnd.oasis.opendocument.text" />
- <data android:mimeType="application/vnd.oasis.opendocument.graphics" />
- <data android:mimeType="application/vnd.oasis.opendocument.presentation" />
- <data android:mimeType="application/vnd.oasis.opendocument.spreadsheet"/>
- <data android:mimeType="application/vnd.oasis.opendocument.text-flat-xml" />
- <data android:mimeType="application/vnd.oasis.opendocument.graphics-flat-xml" />
- <data android:mimeType="application/vnd.oasis.opendocument.presentation-flat-xml" />
- <data android:mimeType="application/vnd.oasis.opendocument.spreadsheet-flat-xml" />
-
- <!-- ODF templates -->
- <data android:mimeType="application/vnd.oasis.opendocument.text-template"/>
- <data android:mimeType="application/vnd.oasis.opendocument.spreadsheet-template"/>
- <data android:mimeType="application/vnd.oasis.opendocument.graphics-template"/>
- <!-- Seems at least Android 5.0 does not recognize this as the mime type of .otp files. -->
- <data android:mimeType="application/vnd.oasis.opendocument.presentation-template"/>
-
- <!-- MS -->
- <data android:mimeType="application/rtf" />
- <data android:mimeType="text/rtf" />
- <data android:mimeType="application/msword" />
- <data android:mimeType="application/vnd.ms-powerpoint" />
- <data android:mimeType="application/vnd.ms-excel"/>
- <data android:mimeType="application/vnd.visio" />
- <data android:mimeType="application/vnd.visio.xml" />
- <data android:mimeType="application/x-mspublisher" />
-
- <!-- OOXML -->
- <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
- <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" />
- <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.slideshow"/>
- <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
-
- <!-- OOXML templates -->
- <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.template"/>
- <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.template"/>
- <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.template"/>
-
- <!-- OTHER -->
- <data android:mimeType="text/csv"/>
- <data android:mimeType="text/comma-separated-values"/>
- <data android:mimeType="application/vnd.ms-works" />
- <data android:mimeType="application/vnd.apple.keynote" />
- <data android:mimeType="application/x-abiword" />
- <data android:mimeType="application/x-pagemaker" />
- <data android:mimeType="image/x-emf" />
- <data android:mimeType="image/x-svm" />
- <data android:mimeType="image/x-wmf" />
- <data android:mimeType="image/svg+xml" />
+ </intent-filter>
+ </activity>
+
+
+ <!--<activity android:name=".MainActivity">-->
+ <!--<intent-filter>-->
+ <!--<action android:name="android.intent.action.MAIN" />-->
+
+ <!--<category android:name="android.intent.category.LAUNCHER" />-->
+ <!--</intent-filter>-->
+ <!--<intent-filter>-->
+ <!--<action android:name="android.intent.action.VIEW" />-->
+ <!--<action android:name="android.intent.action.EDIT" />-->
+ <!--<action android:name="android.intent.action.PICK" />-->
+
+ <!--<category android:name="android.intent.category.DEFAULT" />-->
+
+ <!--<data android:scheme="file" />-->
+ <!--<data android:scheme="content" />-->
+
+ <!--<!– ODF –>-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.text" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.graphics" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.presentation" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.spreadsheet" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.text-flat-xml" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.graphics-flat-xml" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.presentation-flat-xml" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.spreadsheet-flat-xml" />-->
+ <!--<!– ODF templates –>-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.text-template" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.spreadsheet-template" />-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.graphics-template" />-->
+ <!--<!– Seems at least Android 5.0 does not recognize this as the mime type of .otp files. –>-->
+ <!--<data android:mimeType="application/vnd.oasis.opendocument.presentation-template" />-->
+
+ <!--<!– MS –>-->
+ <!--<data android:mimeType="application/rtf" />-->
+ <!--<data android:mimeType="text/rtf" />-->
+ <!--<data android:mimeType="application/msword" />-->
+ <!--<data android:mimeType="application/vnd.ms-powerpoint" />-->
+ <!--<data android:mimeType="application/vnd.ms-excel" />-->
+ <!--<data android:mimeType="application/vnd.visio" />-->
+ <!--<data android:mimeType="application/vnd.visio.xml" />-->
+ <!--<data android:mimeType="application/x-mspublisher" />-->
+
+ <!--<!– OOXML –>-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" />-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.slideshow" />-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />-->
+
+ <!--<!– OOXML templates –>-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.template" />-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.template" />-->
+ <!--<data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.template" />-->
+
+ <!--<!– OTHER –>-->
+ <!--<data android:mimeType="text/csv" />-->
+ <!--<data android:mimeType="text/comma-separated-values" />-->
+ <!--<data android:mimeType="application/vnd.ms-works" />-->
+ <!--<data android:mimeType="application/vnd.apple.keynote" />-->
+ <!--<data android:mimeType="application/x-abiword" />-->
+ <!--<data android:mimeType="application/x-pagemaker" />-->
+ <!--<data android:mimeType="image/x-emf" />-->
+ <!--<data android:mimeType="image/x-svm" />-->
+ <!--<data android:mimeType="image/x-wmf" />-->
+ <!--<data android:mimeType="image/svg+xml" />-->
+ <!--</intent-filter>-->
+ <!--</activity>-->
+
+ <!-- Document Provider Settings Activity -->
+ <activity android:name=".storage.DocumentProviderSettingsActivity"
+ android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
+ android:label="@string/storage_provider_settings">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
- </application>
+ <activity android:name=".storage.external.BrowserSelectorActivity" >
+ </activity>
+
+ <activity android:name=".storage.external.DirectoryBrowserActivity"
+ android:label="@string/directory_browser_label"
+ android:windowSoftInputMode="stateHidden">
+ </activity>
+
+ </application>
</manifest>
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java b/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java
index 6c944bae7..029e1609b 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java
@@ -7,33 +7,30 @@
*
*/
-package org.libreoffice;
+package org.libreoffice.androidapp;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
-import android.content.ComponentName;
import android.content.DialogInterface;
-import android.content.Intent;
import android.content.pm.PackageManager;
-import android.net.Uri;
import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.v4.app.DialogFragment;
import android.text.Html;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;
-import java.io.File;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.DialogFragment;
public class AboutDialogFragment extends DialogFragment {
private static final String DEFAULT_DOC_PATH = "/assets/example.odt";
- @NonNull @Override
+ @NonNull
+ @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
@SuppressLint("InflateParams") //suppressed because the view will be placed in a dialog
@@ -104,10 +101,11 @@ public class AboutDialogFragment extends DialogFragment {
}
private void loadFromAbout(String input) {
- Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(new File(input)));
- String packageName = getActivity().getApplicationContext().getPackageName();
- ComponentName componentName = new ComponentName(packageName, LibreOfficeMainActivity.class.getName());
- i.setComponent(componentName);
- getActivity().startActivity(i);
+ //TODO finish loading from about
+// Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(new File(input)));
+// String packageName = getActivity().getApplicationContext().getPackageName();
+// ComponentName componentName = new ComponentName(packageName, LibreOfficeMainActivity.class.getName());
+// i.setComponent(componentName);
+// getActivity().startActivity(i);
}
}
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java b/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java
index c69e02669..db7094c16 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/LOKitShell.java
@@ -6,164 +6,156 @@
* 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;
+package org.libreoffice.androidapp;
-import android.app.ActivityManager;
-import android.content.Context;
-import android.graphics.PointF;
-import android.graphics.RectF;
import android.os.Handler;
-import android.util.DisplayMetrics;
-import android.view.KeyEvent;
-
-import org.libreoffice.canvas.SelectionHandle;
-import org.mozilla.gecko.gfx.ComposedTileLayer;
/**
* Common static LOKit functions, functions to send events.
*/
public class LOKitShell {
- private static final String LOGTAG = LOKitShell.class.getSimpleName();
-
- public static float getDpi(Context context) {
- if (((LibreOfficeMainActivity)context).isSpreadsheet()) return 96f;
- DisplayMetrics metrics = context.getResources().getDisplayMetrics();
- return metrics.density * 160;
- }
-
+// private static final String LOGTAG = LOKitShell.class.getSimpleName();
+//
+// public static float getDpi(Context context) {
+// if (((LibreOfficeMainActivity)context).isSpreadsheet()) return 96f;
+// DisplayMetrics metrics = context.getResources().getDisplayMetrics();
+// return metrics.density * 160;
+// }
+//
+ //TODO right now this script is used only for this method that is neccessary to display the editFAB
// Get a Handler for the main java thread
public static Handler getMainHandler() {
return LibreOfficeApplication.getMainHandler();
}
-
- public static void showProgressSpinner(final LibreOfficeMainActivity context) {
- getMainHandler().post(new Runnable() {
- @Override
- public void run() {
- context.showProgressSpinner();
- }
- });
- }
-
- public static void hideProgressSpinner(final LibreOfficeMainActivity context) {
- getMainHandler().post(new Runnable() {
- @Override
- public void run() {
- context.hideProgressSpinner();
- }
- });
- }
-
- public static int getMemoryClass(Context context) {
- ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
- return activityManager.getMemoryClass() * 1024 * 1024;
- }
-
- public static boolean isEditingEnabled() {
- return LibreOfficeMainActivity.isExperimentalMode();
- }
-
- // EVENTS
-
- /**
- * Make sure LOKitThread is running and send event to it.
- */
- public static void sendEvent(LOEvent event) {
- LibreOfficeMainActivity.loKitThread.queueEvent(event);
- }
-
- public static void sendThumbnailEvent(ThumbnailCreator.ThumbnailCreationTask task) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.THUMBNAIL, task));
- }
-
- /**
- * Send touch event to LOKitThread.
- */
- public static void sendTouchEvent(String touchType, PointF documentTouchCoordinate) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, touchType, documentTouchCoordinate));
- }
-
- /**
- * Send key event to LOKitThread.
- */
- public static void sendKeyEvent(KeyEvent event) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.KEY_EVENT, event));
- }
-
- public static void sendSizeChangedEvent(int width, int height) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.SIZE_CHANGED));
- }
-
- public static void sendSwipeRightEvent() {
- LOKitShell.sendEvent(new LOEvent(LOEvent.SWIPE_RIGHT));
- }
-
- public static void sendSwipeLeftEvent() {
- LOKitShell.sendEvent(new LOEvent(LOEvent.SWIPE_LEFT));
- }
-
- public static void sendChangePartEvent(int part) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.CHANGE_PART, part));
- }
-
- public static void sendLoadEvent(String inputFilePath) {
- LOKitShell.sendEvent(new LOEvent(inputFilePath, LOEvent.LOAD));
- }
-
- public static void sendNewDocumentLoadEvent(String newDocumentPath, String newDocumentType) {
- LOKitShell.sendEvent(new LOEvent(newDocumentPath, newDocumentType, LOEvent.LOAD_NEW));
- }
-
- public static void sendSaveAsEvent(String filePath, String fileFormat) {
- LOKitShell.sendEvent(new LOEvent(filePath, fileFormat, LOEvent.SAVE_AS));
- }
-
- public static void sendResumeEvent(String inputFile, int partIndex) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.RESUME, inputFile, partIndex));
- }
-
- public static void sendCloseEvent() {
- LOKitShell.sendEvent(new LOEvent(LOEvent.CLOSE));
- }
-
- /**
- * Send tile reevaluation to LOKitThread.
- */
- public static void sendTileReevaluationRequest(ComposedTileLayer composedTileLayer) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.TILE_REEVALUATION_REQUEST, composedTileLayer));
- }
-
- /**
- * Send tile invalidation to LOKitThread.
- */
- public static void sendTileInvalidationRequest(RectF rect) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.TILE_INVALIDATION, rect));
- }
-
- /**
- * Send change handle position event to LOKitThread.
- */
- public static void sendChangeHandlePositionEvent(SelectionHandle.HandleType handleType, PointF documentCoordinate) {
- LOKitShell.sendEvent(new LOEvent(LOEvent.CHANGE_HANDLE_POSITION, handleType, documentCoordinate));
- }
-
- public static void sendNavigationClickEvent() {
- LOKitShell.sendEvent(new LOEvent(LOEvent.NAVIGATION_CLICK));
- }
-
- /**
- * Move the viewport to the desired point (top-left), and change the zoom level.
- * Ensure this runs on the UI thread.
- */
- public static void moveViewportTo(final LibreOfficeMainActivity context, final PointF position, final Float zoom) {
- context.getLayerClient().post(new Runnable() {
- @Override
- public void run() {
- context.getLayerClient().moveTo(position, zoom);
- }
- });
- }
+//
+// public static void showProgressSpinner(final LibreOfficeMainActivity context) {
+// getMainHandler().post(new Runnable() {
+// @Override
+// public void run() {
+// context.showProgressSpinner();
+// }
+// });
+// }
+//
+// public static void hideProgressSpinner(final LibreOfficeMainActivity context) {
+// getMainHandler().post(new Runnable() {
+// @Override
+// public void run() {
+// context.hideProgressSpinner();
+// }
+// });
+// }
+//
+// public static int getMemoryClass(Context context) {
+// ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+// return activityManager.getMemoryClass() * 1024 * 1024;
+// }
+//
+// public static boolean isEditingEnabled() {
+// return LibreOfficeMainActivity.isExperimentalMode();
+// }
+//
+// // EVENTS
+//
+// /**
+// * Make sure LOKitThread is running and send event to it.
+// */
+// public static void sendEvent(LOEvent event) {
+// LibreOfficeMainActivity.loKitThread.queueEvent(event);
+// }
+//
+// public static void sendThumbnailEvent(ThumbnailCreator.ThumbnailCreationTask task) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.THUMBNAIL, task));
+// }
+//
+// /**
+// * Send touch event to LOKitThread.
+// */
+// public static void sendTouchEvent(String touchType, PointF documentTouchCoordinate) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.TOUCH, touchType, documentTouchCoordinate));
+// }
+//
+// /**
+// * Send key event to LOKitThread.
+// */
+// public static void sendKeyEvent(KeyEvent event) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.KEY_EVENT, event));
+// }
+//
+// public static void sendSizeChangedEvent(int width, int height) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.SIZE_CHANGED));
+// }
+//
+// public static void sendSwipeRightEvent() {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.SWIPE_RIGHT));
+// }
+//
+// public static void sendSwipeLeftEvent() {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.SWIPE_LEFT));
+// }
+//
+// public static void sendChangePartEvent(int part) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.CHANGE_PART, part));
+// }
+//
+// public static void sendLoadEvent(String inputFilePath) {
+// LOKitShell.sendEvent(new LOEvent(inputFilePath, LOEvent.LOAD));
+// }
+//
+// public static void sendNewDocumentLoadEvent(String newDocumentPath, String newDocumentType) {
+// LOKitShell.sendEvent(new LOEvent(newDocumentPath, newDocumentType, LOEvent.LOAD_NEW));
+// }
+//
+// public static void sendSaveAsEvent(String filePath, String fileFormat) {
+// LOKitShell.sendEvent(new LOEvent(filePath, fileFormat, LOEvent.SAVE_AS));
+// }
+//
+// public static void sendResumeEvent(String inputFile, int partIndex) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.RESUME, inputFile, partIndex));
+// }
+//
+// public static void sendCloseEvent() {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.CLOSE));
+// }
+//
+// /**
+// * Send tile reevaluation to LOKitThread.
+// */
+// public static void sendTileReevaluationRequest(ComposedTileLayer composedTileLayer) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.TILE_REEVALUATION_REQUEST, composedTileLayer));
+// }
+//
+// /**
+// * Send tile invalidation to LOKitThread.
+// */
+// public static void sendTileInvalidationRequest(RectF rect) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.TILE_INVALIDATION, rect));
+// }
+//
+// /**
+// * Send change handle position event to LOKitThread.
+// */
+// public static void sendChangeHandlePositionEvent(SelectionHandle.HandleType handleType, PointF documentCoordinate) {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.CHANGE_HANDLE_POSITION, handleType, documentCoordinate));
+// }
+//
+// public static void sendNavigationClickEvent() {
+// LOKitShell.sendEvent(new LOEvent(LOEvent.NAVIGATION_CLICK));
+// }
+//
+// /**
+// * Move the viewport to the desired point (top-left), and change the zoom level.
+// * Ensure this runs on the UI thread.
+// */
+// public static void moveViewportTo(final LibreOfficeMainActivity context, final PointF position, final Float zoom) {
+// context.getLayerClient().post(new Runnable() {
+// @Override
+// public void run() {
+// context.getLayerClient().moveTo(position, zoom);
+// }
+// });
+// }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/LibreOfficeApplication.java b/android/app/src/main/java/org/libreoffice/androidapp/LibreOfficeApplication.java
index 07c146638..87f30f817 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/LibreOfficeApplication.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/LibreOfficeApplication.java
@@ -8,7 +8,7 @@
*
*/
-package org.libreoffice;
+package org.libreoffice.androidapp;
import android.app.Application;
import android.content.Context;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/LocaleHelper.java b/android/app/src/main/java/org/libreoffice/androidapp/LocaleHelper.java
index 26a31e431..3c5c78bc2 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/LocaleHelper.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/LocaleHelper.java
@@ -1,4 +1,4 @@
-package org.libreoffice;
+package org.libreoffice.androidapp;
import android.content.Context;
import android.content.SharedPreferences;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java
index acf5aebcd..2fc3e031a 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderFactory.java
@@ -7,25 +7,26 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage;
+package org.libreoffice.androidapp.storage;
+
+import android.content.Context;
+import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+
+import org.libreoffice.androidapp.storage.external.ExtsdDocumentsProvider;
+import org.libreoffice.androidapp.storage.external.OTGDocumentsProvider;
+import org.libreoffice.androidapp.storage.local.LocalDocumentsDirectoryProvider;
+import org.libreoffice.androidapp.storage.local.LocalDocumentsProvider;
import java.util.HashSet;
import java.util.Set;
-import org.libreoffice.storage.external.ExtsdDocumentsProvider;
-import org.libreoffice.storage.external.OTGDocumentsProvider;
-import org.libreoffice.storage.local.LocalDocumentsDirectoryProvider;
-import org.libreoffice.storage.local.LocalDocumentsProvider;
-import org.libreoffice.storage.owncloud.OwnCloudProvider;
-
-import android.content.Context;
-import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+//import org.libreoffice.androidapp.storage.owncloud.OwnCloudProvider;
/**
* Keeps the instances of the available IDocumentProviders in the system.
* Instances are maintained in a sorted list and providers have to be
* accessed from their position.
- *
+ * <p>
* The factory follows the Singleton pattern, there is only one instance of it
* in the application and it must be retrieved with
* DocumentProviderFactory.getInstance().
@@ -51,8 +52,7 @@ public final class DocumentProviderFactory {
* Initializes the factory with some context. If this method is called for
* twice or more times those calls will have no effect.
*
- * @param context
- * Application context for the factory.
+ * @param context Application context for the factory.
*/
public static void initialize(Context context) {
if (instance == null) {
@@ -64,15 +64,16 @@ public final class DocumentProviderFactory {
instance.providers[0] = new LocalDocumentsDirectoryProvider(0);
instance.providers[1] = new LocalDocumentsProvider(1);
instance.providers[OTG_PROVIDER_INDEX] = new OTGDocumentsProvider(OTG_PROVIDER_INDEX, context);
- instance.providers[4] = new OwnCloudProvider(4, context);
+// instance.providers[4] = new OwnCloudProvider(4, context);
instance.providers[EXTSD_PROVIDER_INDEX] = new ExtsdDocumentsProvider(EXTSD_PROVIDER_INDEX, context);
// initialize document provider names list
instance.providerNames = new String[instance.providers.length];
for (int i = 0; i < instance.providers.length; i++) {
- instance.providerNames[i] = context.getString(instance
- .getProvider(i).getNameResource());
+ if (instance.providerNames[i] != null)//own cloud is not declared yet
+ instance.providerNames[i] = context.getString(instance
+ .getProvider(i).getNameResource());
}
}
}
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderSettingsActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderSettingsActivity.java
index b842e79fa..58b3107ee 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderSettingsActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/DocumentProviderSettingsActivity.java
@@ -7,12 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage;
-
-import java.util.Set;
-
-import org.libreoffice.R;
-import org.libreoffice.storage.external.BrowserSelectorActivity;
+package org.libreoffice.androidapp.storage;
import android.content.Intent;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
@@ -21,7 +16,13 @@ import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
-import android.support.v7.app.AppCompatActivity;
+
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.external.BrowserSelectorActivity;
+
+import java.util.Set;
+
+import androidx.appcompat.app.AppCompatActivity;
public class DocumentProviderSettingsActivity extends AppCompatActivity {
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/IDocumentProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/IDocumentProvider.java
index 044d7ddb4..474610ab1 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/IDocumentProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/IDocumentProvider.java
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage;
+package org.libreoffice.androidapp.storage;
import android.content.Context;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/IFile.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/IFile.java
index c9cfa7f11..da8067bd0 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/IFile.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/IFile.java
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage;
+package org.libreoffice.androidapp.storage;
import android.content.Context;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/IOUtils.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/IOUtils.java
index f345f5cbe..e998c0696 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/IOUtils.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/IOUtils.java
@@ -1,4 +1,4 @@
-package org.libreoffice.storage;
+package org.libreoffice.androidapp.storage;
import android.util.Log;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/BrowserSelectorActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/BrowserSelectorActivity.java
index 07b64623b..e992a0860 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/BrowserSelectorActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/BrowserSelectorActivity.java
@@ -1,4 +1,4 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.annotation.TargetApi;
import android.content.ContentResolver;
@@ -9,14 +9,15 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
-import android.support.v7.app.AppCompatActivity;
import android.util.Log;
-import org.libreoffice.R;
-import org.libreoffice.storage.DocumentProviderFactory;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.DocumentProviderFactory;
import java.util.Set;
+import androidx.appcompat.app.AppCompatActivity;
+
/**
* Activity to select which directory browser to use.
* Android 5+ will use the DocumentTree intent to locate a browser.
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserActivity.java
index 1cf9f52fa..3f81bb7c7 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserActivity.java
@@ -1,14 +1,15 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.app.AppCompatActivity;
-import org.libreoffice.R;
+import org.libreoffice.androidapp.R;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
/**
* Container for DirectoryBrowserFragment
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserFragment.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserFragment.java
index 18165650a..446ba94ac 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserFragment.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/DirectoryBrowserFragment.java
@@ -1,4 +1,4 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.app.Activity;
import android.app.Fragment;
@@ -7,7 +7,6 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
-import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -21,13 +20,15 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
-import org.libreoffice.R;
-import org.libreoffice.storage.IOUtils;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.IOUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
+import androidx.annotation.Nullable;
+
/**
* A simple directory browser.
*/
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExternalFile.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExternalFile.java
index aff33e441..6a78f983c 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExternalFile.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExternalFile.java
@@ -1,11 +1,10 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.content.Context;
-import android.support.v4.provider.DocumentFile;
import android.util.Log;
-import org.libreoffice.storage.IFile;
-import org.libreoffice.storage.IOUtils;
+import org.libreoffice.androidapp.storage.IFile;
+import org.libreoffice.androidapp.storage.IOUtils;
import java.io.File;
import java.io.FileFilter;
@@ -19,6 +18,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import androidx.documentfile.provider.DocumentFile;
+
/**
* Implementation of IFile for the external file system, for Android 4.4+
*
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java
index e45929374..46dec56f7 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/ExtsdDocumentsProvider.java
@@ -1,4 +1,4 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.Manifest;
import android.content.Context;
@@ -9,17 +9,18 @@ import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.preference.PreferenceManager;
-import android.support.v4.content.ContextCompat;
-import android.support.v4.provider.DocumentFile;
import android.util.Log;
-import org.libreoffice.R;
-import org.libreoffice.storage.DocumentProviderSettingsActivity;
-import org.libreoffice.storage.IFile;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.DocumentProviderSettingsActivity;
+import org.libreoffice.androidapp.storage.IFile;
import java.io.File;
import java.net.URI;
+import androidx.core.content.ContextCompat;
+import androidx.documentfile.provider.DocumentFile;
+
/**
* Implementation of IDocumentProvider for the external file system, for android 4.4+
*
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/IExternalDocumentProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/IExternalDocumentProvider.java
index a439417b6..77308f1eb 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/IExternalDocumentProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/IExternalDocumentProvider.java
@@ -1,8 +1,8 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.content.Context;
-import org.libreoffice.storage.IDocumentProvider;
+import org.libreoffice.androidapp.storage.IDocumentProvider;
/**
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java
index 4341bc354..899486c51 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/external/OTGDocumentsProvider.java
@@ -1,4 +1,4 @@
-package org.libreoffice.storage.external;
+package org.libreoffice.androidapp.storage.external;
import android.content.Context;
import android.content.SharedPreferences;
@@ -6,11 +6,11 @@ import android.content.pm.PackageManager;
import android.preference.PreferenceManager;
import android.util.Log;
-import org.libreoffice.R;
-import org.libreoffice.storage.DocumentProviderSettingsActivity;
-import org.libreoffice.storage.IFile;
-import org.libreoffice.storage.IOUtils;
-import org.libreoffice.storage.local.LocalFile;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.DocumentProviderSettingsActivity;
+import org.libreoffice.androidapp.storage.IFile;
+import org.libreoffice.androidapp.storage.IOUtils;
+import org.libreoffice.androidapp.storage.local.LocalFile;
import java.io.File;
import java.net.URI;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsDirectoryProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsDirectoryProvider.java
index 15522e93a..5c54b0000 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsDirectoryProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsDirectoryProvider.java
@@ -7,21 +7,22 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage.local;
-
-import java.io.File;
-
-import org.libreoffice.storage.IFile;
-import org.libreoffice.R;
+package org.libreoffice.androidapp.storage.local;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Environment;
-import android.support.v4.content.ContextCompat;
import android.util.Log;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.IFile;
+
+import java.io.File;
+
+import androidx.core.content.ContextCompat;
+
/**
* A convenience IDocumentProvider to browse the /sdcard/Documents directory.
*
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsProvider.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsProvider.java
index 1a10fad42..e1b709b9f 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsProvider.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalDocumentsProvider.java
@@ -7,20 +7,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage.local;
-
-import java.net.URI;
-
-import org.libreoffice.storage.IDocumentProvider;
-import org.libreoffice.storage.IFile;
-
-import org.libreoffice.R;
+package org.libreoffice.androidapp.storage.local;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Environment;
-import android.support.v4.content.ContextCompat;
+
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.IDocumentProvider;
+import org.libreoffice.androidapp.storage.IFile;
+
+import java.net.URI;
+
+import androidx.core.content.ContextCompat;
/**
* Implementation of IDocumentProvider for the local file system.
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalFile.java b/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalFile.java
index 4ff5bbf11..0594c7272 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalFile.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/storage/local/LocalFile.java
@@ -7,7 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.storage.local;
+package org.libreoffice.androidapp.storage.local;
import android.content.Context;
@@ -18,7 +18,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import org.libreoffice.storage.IFile;
+import org.libreoffice.androidapp.storage.IFile;
/**
* Implementation of IFile for the local file system.
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/FileUtilities.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/FileUtilities.java
index 7a5848600..1ca28de45 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/FileUtilities.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/FileUtilities.java
@@ -6,9 +6,9 @@
* 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.ui;
+package org.libreoffice.androidapp.ui;
-import org.libreoffice.storage.IFile;
+import org.libreoffice.androidapp.storage.IFile;
import java.io.File;
import java.io.FileFilter;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/FolderIconView.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/FolderIconView.java
index cde6cd27a..b8109eb47 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/FolderIconView.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/FolderIconView.java
@@ -6,7 +6,7 @@
* 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.ui;
+package org.libreoffice.androidapp.ui;
import android.content.Context;
import android.graphics.Bitmap;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
index 3fb715e46..9aa0e0163 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java
@@ -7,13 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.ui;
+package org.libreoffice.androidapp.ui;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
-import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -22,27 +21,12 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
-import android.graphics.drawable.Icon;
import android.hardware.usb.UsbManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.preference.PreferenceManager;
-import android.support.annotation.NonNull;
-import android.support.design.widget.FloatingActionButton;
-import android.support.design.widget.NavigationView;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.content.ContextCompat;
-import android.support.v4.view.ViewCompat;
-import android.support.v4.widget.DrawerLayout;
-import android.support.v7.app.ActionBar;
-import android.support.v7.app.ActionBarDrawerToggle;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.GridLayoutManager;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.Toolbar;
import android.text.InputType;
import android.util.Log;
import android.view.ContextMenu;
@@ -64,17 +48,16 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
-import org.libreoffice.AboutDialogFragment;
-import org.libreoffice.LOKitShell;
-import org.libreoffice.LibreOfficeMainActivity;
-import org.libreoffice.LocaleHelper;
-import org.libreoffice.R;
-import org.libreoffice.SettingsActivity;
-import org.libreoffice.SettingsListenerModel;
-import org.libreoffice.storage.DocumentProviderFactory;
-import org.libreoffice.storage.DocumentProviderSettingsActivity;
-import org.libreoffice.storage.IDocumentProvider;
-import org.libreoffice.storage.IFile;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.android.material.navigation.NavigationView;
+
+import org.libreoffice.androidapp.AboutDialogFragment;
+import org.libreoffice.androidapp.LocaleHelper;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.DocumentProviderFactory;
+import org.libreoffice.androidapp.storage.DocumentProviderSettingsActivity;
+import org.libreoffice.androidapp.storage.IDocumentProvider;
+import org.libreoffice.androidapp.storage.IFile;
import java.io.File;
import java.io.FileFilter;
@@ -89,7 +72,27 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-public class LibreOfficeUIActivity extends AppCompatActivity implements SettingsListenerModel.OnSettingsPreferenceChangedListener, View.OnClickListener{
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.ActionBarDrawerToggle;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+import androidx.core.view.ViewCompat;
+import androidx.drawerlayout.widget.DrawerLayout;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+
+
+//import org.libreoffice.LOKitShell;
+//import org.libreoffice.LibreOfficeMainActivity;
+//import org.libreoffice.SettingsActivity;
+//import org.libreoffice.SettingsListenerModel;
+
+public class LibreOfficeUIActivity extends AppCompatActivity implements /*SettingsListenerModel.OnSettingsPreferenceChangedListener,*/ View.OnClickListener{
private String LOGTAG = LibreOfficeUIActivity.class.getSimpleName();
private SharedPreferences prefs;
private int filterMode = FileUtilities.ALL;
@@ -162,7 +165,10 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
PreferenceManager.setDefaultValues(this, R.xml.documentprovider_preferences, false);
readPreferences();
- SettingsListenerModel.getInstance().setListener(this);
+
+ //TODO finish importing settings
+// SettingsListenerModel.getInstance().setListener(this);
+
// Registering the USB detect broadcast receiver
IntentFilter filter = new IntentFilter();
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
@@ -185,8 +191,10 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
setContentView(R.layout.activity_document_browser);
- Toolbar toolbar = findViewById(R.id.toolbar);
+
+ Toolbar toolbar=findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
+
actionBar = getSupportActionBar();
if (actionBar != null) {
@@ -242,7 +250,8 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
);
// Loop through the document providers menu items and check if they are available or not
- for (int index = 0; index < providerNames.size(); index++) {
+ //TODO remove -1. Used right now to ignore opencloud
+ for (int index = 0; index < providerNames.size()-1; index++) {
MenuItem item = navigationDrawer.getMenu().getItem(index);
item.setEnabled(documentProviderFactory.getProvider(index).checkProviderAvailability(this));
}
@@ -537,47 +546,48 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
public void open(final IFile document) {
addDocumentToRecents(document);
- new AsyncTask<IFile, Void, File>() {
- @Override
- protected File doInBackground(IFile... document) {
- // this operation may imply network access and must be run in
- // a different thread
- try {
- return document[0].getDocument();
- }
- catch (final RuntimeException e) {
- final Activity activity = LibreOfficeUIActivity.this;
- activity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- Toast.makeText(activity, e.getMessage(),
- Toast.LENGTH_SHORT).show();
- }
- });
- Log.e(LOGTAG, e.getMessage(), e.getCause());
- return null;
- }
- }
-
- @Override
- protected void onPostExecute(File file) {
- if (file != null) {
- Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
- String packageName = getApplicationContext().getPackageName();
- ComponentName componentName = new ComponentName(packageName,
- LibreOfficeMainActivity.class.getName());
- i.setComponent(componentName);
-
- // these extras allow to rebuild the IFile object in LOMainActivity
- i.putExtra("org.libreoffice.document_provider_id",
- documentProvider.getId());
- i.putExtra("org.libreoffice.document_uri",
- document.getUri());
-
- startActivity(i);
- }
- }
- }.execute(document);
+ //TODO finish document opening
+// new AsyncTask<IFile, Void, File>() {
+// @Override
+// protected File doInBackground(IFile... document) {
+// // this operation may imply network access and must be run in
+// // a different thread
+// try {
+// return document[0].getDocument();
+// }
+// catch (final RuntimeException e) {
+// final Activity activity = LibreOfficeUIActivity.this;
+// activity.runOnUiThread(new Runnable() {
+// @Override
+// public void run() {
+// Toast.makeText(activity, e.getMessage(),
+// Toast.LENGTH_SHORT).show();
+// }
+// });
+// Log.e(LOGTAG, e.getMessage(), e.getCause());
+// return null;
+// }
+// }
+//
+// @Override
+// protected void onPostExecute(File file) {
+// if (file != null) {
+// Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
+// String packageName = getApplicationContext().getPackageName();
+// ComponentName componentName = new ComponentName(packageName,
+// LibreOfficeMainActivity.class.getName());
+// i.setComponent(componentName);
+//
+// // these extras allow to rebuild the IFile object in LOMainActivity
+// i.putExtra("org.libreoffice.document_provider_id",
+// documentProvider.getId());
+// i.putExtra("org.libreoffice.document_uri",
+// document.getUri());
+//
+// startActivity(i);
+// }
+// }
+// }.execute(document);
}
// Opens an Input dialog to get the name of new file
@@ -608,10 +618,11 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
}
private void loadNewDocument(String newDocumentType, String newFilePath) {
- Intent intent = new Intent(LibreOfficeUIActivity.this, LibreOfficeMainActivity.class);
- intent.putExtra(NEW_DOC_TYPE_KEY, newDocumentType);
- intent.putExtra(NEW_FILE_PATH_KEY, newFilePath);
- startActivity(intent);
+ //TODO finish document loading
+// Intent intent = new Intent(LibreOfficeUIActivity.this, LibreOfficeMainActivity.class);
+// intent.putExtra(NEW_DOC_TYPE_KEY, newDocumentType);
+// intent.putExtra(NEW_FILE_PATH_KEY, newFilePath);
+// startActivity(intent);
}
private void open(int position) {
@@ -826,7 +837,8 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
}
return true;
case R.id.action_settings:
- startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
+ //TODO import the settings activity
+// startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
return true;
default:
@@ -868,11 +880,13 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
LocaleHelper.setLocale(this, displayLanguage);
}
- @Override
- public void settingsPreferenceChanged(SharedPreferences sharedPreferences, String key) {
- readPreferences();
- refreshView();
- }
+
+ //TODO finish importing settings
+// @Override
+// public void settingsPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+// readPreferences();
+// refreshView();
+// }
@Override
protected void onSaveInstanceState(Bundle outState) {
@@ -1041,19 +1055,21 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
//for some reason, getName uses %20 instead of space
String filename = file.getName().replace("%20", " ");
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
- String packageName = this.getApplicationContext().getPackageName();
- ComponentName componentName = new ComponentName(packageName, LibreOfficeMainActivity.class.getName());
- intent.setComponent(componentName);
-
- ShortcutInfo shortcut = new ShortcutInfo.Builder(this, filename)
- .setShortLabel(filename)
- .setLongLabel(filename)
- .setIcon(Icon.createWithResource(this, drawable))
- .setIntent(intent)
- .build();
-
- shortcuts.add(shortcut);
+ //TODO finish adding to recents
+
+// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
+// String packageName = this.getApplicationContext().getPackageName();
+// ComponentName componentName = new ComponentName(packageName, LibreOfficeMainActivity.class.getName());
+// intent.setComponent(componentName);
+//
+// ShortcutInfo shortcut = new ShortcutInfo.Builder(this, filename)
+// .setShortLabel(filename)
+// .setLongLabel(filename)
+// .setIcon(Icon.createWithResource(this, drawable))
+// .setIntent(intent)
+// .build();
+//
+// shortcuts.add(shortcut);
}
shortcutManager.setDynamicShortcuts(shortcuts);
}
@@ -1196,12 +1212,12 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings
}
private void setEditFABVisibility(final int visibility){
- LOKitShell.getMainHandler().post(new Runnable() {
- @Override
- public void run() {
- editFAB.setVisibility(visibility);
- }
- });
+// LOKitShell.getMainHandler().post(new Runnable() {
+// @Override
+// public void run() {
+// editFAB.setVisibility(visibility);
+// }
+// });
}
@Override
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/PageView.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/PageView.java
index 1d32a7de7..4f4aab973 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/PageView.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/PageView.java
@@ -1,8 +1,8 @@
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-package org.libreoffice.ui;
+package org.libreoffice.androidapp.ui;
-import org.libreoffice.R;
+import org.libreoffice.androidapp.R;
import android.content.Context;
import android.graphics.Bitmap;
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java
index 7f81df877..51468a627 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java
@@ -7,21 +7,23 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-package org.libreoffice.ui;
+package org.libreoffice.androidapp.ui;
+
-import android.support.v4.content.ContextCompat;
-import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
-import org.libreoffice.R;
-import org.libreoffice.storage.IFile;
+import org.libreoffice.androidapp.R;
+import org.libreoffice.androidapp.storage.IFile;
import java.util.List;
+import androidx.core.content.ContextCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
class RecentFilesAdapter extends RecyclerView.Adapter<RecentFilesAdapter.ViewHolder> {
private LibreOfficeUIActivity mActivity;
diff --git a/android/app/src/main/res/layout/activity_document_browser.xml b/android/app/src/main/res/layout/activity_document_browser.xml
index 8e17a3e16..8c8e7fd59 100644
--- a/android/app/src/main/res/layout/activity_document_browser.xml
+++ b/android/app/src/main/res/layout/activity_document_browser.xml
@@ -6,15 +6,17 @@
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/.
-->
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
+
<!-- The toolbar -->
- <android.support.v7.widget.Toolbar
+ <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -30,10 +32,10 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
- </android.support.v7.widget.Toolbar>
+ </androidx.appcompat.widget.Toolbar>
- <android.support.v4.widget.DrawerLayout
+ <androidx.drawerlayout.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="0dp"
android:layout_height="0dp"
@@ -47,7 +49,7 @@
app:layout_constraintLeft_toLeftOf="parent">
<!-- The content -->
- <android.support.v4.widget.NestedScrollView
+ <androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -69,7 +71,7 @@
android:textStyle="bold" />
<!--Recent files-->
- <android.support.v7.widget.RecyclerView
+ <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_recent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -97,7 +99,7 @@
<!--Document browser-->
- <android.support.v7.widget.RecyclerView
+ <androidx.recyclerview.widget.RecyclerView
android:id="@+id/file_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -106,10 +108,10 @@
</LinearLayout>
- </android.support.v4.widget.NestedScrollView>
+ </androidx.core.widget.NestedScrollView>
<!-- The navigation drawer -->
- <android.support.design.widget.NavigationView
+ <com.google.android.material.navigation.NavigationView
android:id="@+id/navigation_drawer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -118,9 +120,9 @@
app:menu="@menu/navigation_menu"
android:theme="@style/LibreOfficeTheme.NavigationView" />
- </android.support.v4.widget.DrawerLayout>
+ </androidx.drawerlayout.widget.DrawerLayout>
- <android.support.design.widget.FloatingActionButton
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/editFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -151,7 +153,7 @@
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
android:text="@string/new_textdocument" />
- <android.support.design.widget.FloatingActionButton
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/newWriterFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -183,7 +185,7 @@
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
android:text="@string/new_presentation" />
- <android.support.design.widget.FloatingActionButton
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/newImpressFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -215,7 +217,7 @@
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
android:text="@string/new_spreadsheet" />
- <android.support.design.widget.FloatingActionButton
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/newCalcFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -247,7 +249,7 @@
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
android:text="@string/new_drawing" />
- <android.support.design.widget.FloatingActionButton
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/newDrawFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -261,4 +263,4 @@
</LinearLayout>
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index eca70cfe5..000000000
--- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
- <background android:drawable="@drawable/ic_launcher_background" />
- <foreground android:drawable="@drawable/ic_launcher_foreground" />
-</adaptive-icon>
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index dffca3601..000000000
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted file mode 100644
index dae5e0823..000000000
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted file mode 100644
index 14ed0af35..000000000
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted file mode 100644
index d8ae03154..000000000
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted file mode 100644
index beed3cdd2..000000000
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/android/app/src/main/res/values/arrays.xml b/android/app/src/main/res/values/arrays.xml
index 3b2c71c3d..365171568 100644
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list