mirror of https://github.com/tasks/tasks
Remove backup activity
* Move import/export tasks to backup preferences * Remove unused translations * Translation updates from kuzyasun, Kackar, rchacinpull/28/merge
parent
982fe1163f
commit
edb314663d
@ -1,73 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.backup;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.tasks.R;
|
||||
import com.todoroo.andlib.service.ContextManager;
|
||||
import com.todoroo.astrid.utility.Flags;
|
||||
|
||||
public class BackupActivity extends Activity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ContextManager.setContext(this);
|
||||
setContentView(R.layout.backup_activity);
|
||||
setTitle(R.string.backup_BAc_title);
|
||||
|
||||
((Button)findViewById(R.id.importButton)).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
importTasks();
|
||||
}
|
||||
});
|
||||
|
||||
((Button)findViewById(R.id.exportButton)).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
exportTasks();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void importTasks() {
|
||||
FilePickerBuilder.OnFilePickedListener listener = new FilePickerBuilder.OnFilePickedListener() {
|
||||
@Override
|
||||
public void onFilePicked(String filePath) {
|
||||
TasksXmlImporter.importTasks(BackupActivity.this, filePath,
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
Flags.set(Flags.REFRESH);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
new FilePickerBuilder(this,
|
||||
getString(R.string.import_file_prompt),
|
||||
BackupConstants.defaultExportDirectory(),
|
||||
listener).show();
|
||||
}
|
||||
|
||||
private void exportTasks() {
|
||||
TasksXmlExporter.exportTasks(this, TasksXmlExporter.ExportType.EXPORT_TYPE_MANUAL, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setResult(RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
}, null, null);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
**
|
||||
** Copyright 2008, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:minWidth="300dip"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dip"
|
||||
android:padding="5dip"
|
||||
android:background="@android:drawable/divider_horizontal_dark" />
|
||||
|
||||
<Button android:id="@+id/importButton"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/backup_BAc_import" />
|
||||
|
||||
<Button android:id="@+id/exportButton"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/backup_BAc_export" />
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in New Issue