mirror of https://github.com/tasks/tasks
Integrated OpenCRX plugin with Astrid.
parent
8f520a8088
commit
b5b6294972
@ -0,0 +1,406 @@
|
||||
package ru.otdelit.astrid.opencrx;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.andlib.data.TodorooCursor;
|
||||
import com.todoroo.andlib.data.Property.LongProperty;
|
||||
import com.todoroo.andlib.data.Property.StringProperty;
|
||||
import com.todoroo.andlib.service.Autowired;
|
||||
import com.todoroo.andlib.service.DependencyInjectionService;
|
||||
import com.todoroo.andlib.sql.Query;
|
||||
import com.todoroo.andlib.utility.DateUtilities;
|
||||
import com.todoroo.astrid.activity.TaskEditActivity.TaskEditControlSet;
|
||||
import com.todoroo.astrid.dao.StoreObjectDao;
|
||||
import com.todoroo.astrid.dao.StoreObjectDao.StoreObjectCriteria;
|
||||
import com.todoroo.astrid.data.Metadata;
|
||||
import com.todoroo.astrid.data.StoreObject;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
import com.todoroo.astrid.data.MetadataApiDao.MetadataCriteria;
|
||||
import com.todoroo.astrid.service.MetadataService;
|
||||
|
||||
/**
|
||||
* Control Set for managing contact/creator assignments in OpenCRX
|
||||
*
|
||||
* @author Andrey Marchenko <igendou@gmail.com>
|
||||
*
|
||||
*/
|
||||
public class OpencrxControlSet implements TaskEditControlSet {
|
||||
|
||||
/**
|
||||
* Class that represents OpenCRX ActivityCreator. Duplicates some functionality of OpenCRX plugin.
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private static class OpencrxActivityCreator {
|
||||
/** type*/
|
||||
public static final String TYPE = "opencrx-creator"; //$NON-NLS-1$
|
||||
|
||||
/** hashed creator id in opencrx */
|
||||
public static final LongProperty REMOTE_ID = new LongProperty(StoreObject.TABLE,
|
||||
StoreObject.ITEM.name);
|
||||
|
||||
/** creator name */
|
||||
public static final StringProperty NAME = new StringProperty(StoreObject.TABLE,
|
||||
StoreObject.VALUE1.name);
|
||||
|
||||
/**
|
||||
* String ID in OpenCRX system (ActivityCreator)
|
||||
*/
|
||||
public static final StringProperty CRX_ID = new StringProperty(StoreObject.TABLE,
|
||||
StoreObject.VALUE3.name);
|
||||
|
||||
// data class-part
|
||||
private final long id;
|
||||
private final String name;
|
||||
|
||||
private final String crxId;
|
||||
|
||||
public OpencrxActivityCreator (StoreObject creatorData) {
|
||||
this(creatorData.getValue(REMOTE_ID),creatorData.getValue(NAME),
|
||||
creatorData.containsValue(CRX_ID) ? creatorData.getValue(CRX_ID) : ""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public OpencrxActivityCreator(long id, String name, String crxId) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.crxId = crxId;
|
||||
}
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCrxId() {
|
||||
return crxId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class that represents OpenCRX Contact. Duplicates some functionality of OpenCRX plugin.
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private static class OpencrxContact {
|
||||
public static final String TYPE = "opencrx-contacts"; //$NON-NLS-1$
|
||||
|
||||
/** hash contact id in opencrx */
|
||||
public static final LongProperty REMOTE_ID = new LongProperty(StoreObject.TABLE,
|
||||
StoreObject.ITEM.name);
|
||||
|
||||
/** contact first name */
|
||||
public static final StringProperty FIRST_NAME = new StringProperty(StoreObject.TABLE,
|
||||
StoreObject.VALUE1.name);
|
||||
|
||||
/** contact last name */
|
||||
public static final StringProperty LAST_NAME = new StringProperty(StoreObject.TABLE,
|
||||
StoreObject.VALUE2.name);
|
||||
|
||||
/** id in OpenCRX as string */
|
||||
public static final StringProperty CRX_ID = new StringProperty(StoreObject.TABLE,
|
||||
StoreObject.VALUE3.name);
|
||||
|
||||
private final long id;
|
||||
|
||||
private final String email;
|
||||
|
||||
private final String firstname;
|
||||
|
||||
private final String lastname;
|
||||
|
||||
private final String crxId;
|
||||
|
||||
public OpencrxContact(long id, String email, String firstname,
|
||||
String lastname, String crxId) {
|
||||
this.id = id;
|
||||
this.email = email;
|
||||
this.firstname = firstname;
|
||||
this.lastname = lastname;
|
||||
this.crxId = crxId;
|
||||
}
|
||||
|
||||
public OpencrxContact(StoreObject userData){
|
||||
this(userData.getValue(REMOTE_ID), "", userData.getValue(FIRST_NAME), userData.getValue(LAST_NAME), userData.getValue(CRX_ID) ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
public String getCrxId() {
|
||||
return crxId;
|
||||
}
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String displayString = ""; //$NON-NLS-1$
|
||||
boolean hasFirstname = false;
|
||||
boolean hasLastname = false;
|
||||
if (firstname != null && firstname.length() > 0) {
|
||||
displayString += firstname;
|
||||
hasFirstname = true;
|
||||
}
|
||||
if (lastname != null && lastname.length() > 0)
|
||||
hasLastname = true;
|
||||
if (hasFirstname && hasLastname)
|
||||
displayString += " "; //$NON-NLS-1$
|
||||
if (hasLastname)
|
||||
displayString += lastname;
|
||||
|
||||
if (!hasFirstname && !hasLastname && email != null
|
||||
&& email.length() > 0)
|
||||
displayString += email;
|
||||
return displayString;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- instance variables
|
||||
|
||||
private final Activity activity;
|
||||
|
||||
private final Spinner assignedToSelector;
|
||||
private final Spinner creatorSelector;
|
||||
|
||||
private final AutoCompleteTextView assignedToTextInput;
|
||||
private final AutoCompleteTextView creatorTextInput;
|
||||
|
||||
private ArrayList<OpencrxContact> users = null;
|
||||
private ArrayList<OpencrxActivityCreator> dashboards = null;
|
||||
|
||||
@Autowired
|
||||
private MetadataService metadataService;
|
||||
|
||||
@Autowired
|
||||
private StoreObjectDao storeObjectDao;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public OpencrxControlSet(final Activity activity, ViewGroup parent) {
|
||||
DependencyInjectionService.getInstance().inject(this);
|
||||
|
||||
this.activity = activity;
|
||||
|
||||
View view = LayoutInflater.from(activity).inflate(R.layout.opencrx_control, parent, true);
|
||||
|
||||
this.assignedToSelector = (Spinner) activity.findViewById(R.id.opencrx_TEA_task_assign);
|
||||
TextView emptyView = new TextView(activity);
|
||||
emptyView.setText(activity.getText(R.string.opencrx_no_creator));
|
||||
assignedToSelector.setEmptyView(emptyView);
|
||||
|
||||
this.creatorSelector = (Spinner) activity.findViewById(R.id.opencrx_TEA_dashboard_assign);
|
||||
|
||||
this.assignedToTextInput = (AutoCompleteTextView) activity.findViewById(R.id.opencrx_TEA_contact_textinput);
|
||||
this.creatorTextInput = (AutoCompleteTextView) activity.findViewById(R.id.opencrx_TEA_creator_textinput);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromTask(Task task) {
|
||||
|
||||
|
||||
Metadata metadata = getTaskMetadata(task.getId());
|
||||
if(metadata == null)
|
||||
metadata = OpencrxCoreUtils.INSTANCE.newMetadata();
|
||||
|
||||
// Fill the dashboard-spinner and set the current dashboard
|
||||
long dashboardId = OpencrxCoreUtils.INSTANCE.getDefaultCreator();
|
||||
if(metadata.containsNonNullValue(OpencrxCoreUtils.ACTIVITY_CREATOR_ID))
|
||||
dashboardId = metadata.getValue(OpencrxCoreUtils.ACTIVITY_CREATOR_ID);
|
||||
|
||||
StoreObject[] dashboardsData = readStoreObjects(OpencrxActivityCreator.TYPE);
|
||||
dashboards = new ArrayList<OpencrxActivityCreator>(dashboardsData.length);
|
||||
int dashboardSpinnerIndex = -1;
|
||||
|
||||
for (int i=0;i<dashboardsData.length;i++) {
|
||||
OpencrxActivityCreator dashboard = new OpencrxActivityCreator(dashboardsData[i]);
|
||||
dashboards.add(dashboard);
|
||||
if(dashboard.getId() == dashboardId) {
|
||||
dashboardSpinnerIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
//dashboard to not sync as first spinner-entry
|
||||
dashboards.add(0, new OpencrxActivityCreator(OpencrxCoreUtils.CREATOR_NO_SYNC, activity.getString(R.string.opencrx_no_creator), "")); //$NON-NLS-1$
|
||||
|
||||
ArrayAdapter<OpencrxActivityCreator> dashAdapter = new ArrayAdapter<OpencrxActivityCreator>(activity,
|
||||
android.R.layout.simple_spinner_item, dashboards);
|
||||
dashAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
creatorSelector.setAdapter(dashAdapter);
|
||||
creatorSelector.setSelection(dashboardSpinnerIndex+1);
|
||||
|
||||
ArrayAdapter<OpencrxActivityCreator> creatorAdapterTextInput = new ArrayAdapter<OpencrxActivityCreator>(activity,
|
||||
android.R.layout.simple_spinner_item, dashboards);
|
||||
creatorTextInput.setAdapter(creatorAdapterTextInput);
|
||||
creatorTextInput.setOnItemClickListener(new OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapter, View view, int position,
|
||||
long id) {
|
||||
OpencrxActivityCreator creatorInput = (OpencrxActivityCreator) adapter.getItemAtPosition(position);
|
||||
|
||||
if (creatorInput == null) return;
|
||||
|
||||
int selectedIndex = creatorSelector.getSelectedItemPosition();
|
||||
|
||||
for (int i = 0; i < creatorSelector.getAdapter().getCount(); ++i){
|
||||
OpencrxActivityCreator current = (OpencrxActivityCreator) creatorSelector.getAdapter().getItem(i);
|
||||
if (current != null && current.getId() == creatorInput.getId()){
|
||||
selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
creatorSelector.setSelection(selectedIndex);
|
||||
}
|
||||
});
|
||||
|
||||
// Assigned user
|
||||
long responsibleId = OpencrxCoreUtils.INSTANCE.getDefaultAssignedUser();
|
||||
if (metadata.containsNonNullValue(OpencrxCoreUtils.ACTIVITY_ASSIGNED_TO_ID)){
|
||||
responsibleId = metadata.getValue(OpencrxCoreUtils.ACTIVITY_ASSIGNED_TO_ID);
|
||||
}
|
||||
|
||||
StoreObject[] usersData = readStoreObjects(OpencrxContact.TYPE);
|
||||
this.users = new ArrayList<OpencrxContact>();
|
||||
for (StoreObject user : usersData){
|
||||
this.users.add(new OpencrxContact(user));
|
||||
}
|
||||
|
||||
ArrayAdapter<OpencrxContact> usersAdapter = new ArrayAdapter<OpencrxContact>(activity,
|
||||
android.R.layout.simple_spinner_item, this.users);
|
||||
usersAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
assignedToSelector.setAdapter(usersAdapter);
|
||||
|
||||
int responsibleSpinnerIndex = 0;
|
||||
|
||||
for (int i = 0; i < this.users.size() ; i++) {
|
||||
if (this.users.get(i).getId() == responsibleId ) {
|
||||
responsibleSpinnerIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assignedToSelector.setSelection(responsibleSpinnerIndex);
|
||||
|
||||
ArrayAdapter<OpencrxContact> contactAdapterTextInput = new ArrayAdapter<OpencrxContact>(activity,
|
||||
android.R.layout.simple_spinner_item, this.users);
|
||||
|
||||
assignedToTextInput.setAdapter(contactAdapterTextInput);
|
||||
assignedToTextInput.setOnItemClickListener(new OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapter, View view, int position,
|
||||
long id) {
|
||||
|
||||
OpencrxContact userInput = (OpencrxContact) adapter.getItemAtPosition(position);
|
||||
|
||||
if (userInput == null) return;
|
||||
|
||||
int selectedIndex = assignedToSelector.getSelectedItemPosition();
|
||||
|
||||
for (int i = 0; i < assignedToSelector.getAdapter().getCount(); ++i){
|
||||
OpencrxContact current = (OpencrxContact) assignedToSelector.getAdapter().getItem(i);
|
||||
if (current != null && current.getId() == userInput.getId()){
|
||||
selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assignedToSelector.setSelection(selectedIndex);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String writeToModel(Task task) {
|
||||
Metadata metadata = getTaskMetadata(task.getId());
|
||||
try {
|
||||
if (metadata == null) {
|
||||
metadata = OpencrxCoreUtils.INSTANCE.newMetadata();
|
||||
}
|
||||
|
||||
OpencrxActivityCreator dashboard = (OpencrxActivityCreator) creatorSelector.getSelectedItem();
|
||||
metadata.setValue(OpencrxCoreUtils.ACTIVITY_CREATOR_ID, dashboard.getId());
|
||||
|
||||
OpencrxContact responsibleUser = (OpencrxContact) assignedToSelector.getSelectedItem();
|
||||
|
||||
if(responsibleUser == null)
|
||||
metadata.setValue(OpencrxCoreUtils.ACTIVITY_ASSIGNED_TO_ID, 0L);
|
||||
else
|
||||
metadata.setValue(OpencrxCoreUtils.ACTIVITY_ASSIGNED_TO_ID, responsibleUser.getId());
|
||||
|
||||
if(metadata.getSetValues().size() > 0) {
|
||||
metadataService.save(metadata);
|
||||
task.setValue(Task.MODIFICATION_DATE, DateUtilities.now());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("opencrx-error", "Error Saving Metadata", e); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads metadata out of a task
|
||||
* @return null if no metadata found
|
||||
*/
|
||||
private Metadata getTaskMetadata(long taskId) {
|
||||
TodorooCursor<Metadata> cursor = metadataService.query(Query.select(Metadata.PROPERTIES).where(
|
||||
MetadataCriteria.byTaskAndwithKey(taskId, OpencrxCoreUtils.OPENCRX_ACTIVITY_METADATA_KEY))
|
||||
);
|
||||
try {
|
||||
if(cursor.getCount() == 0)
|
||||
return null;
|
||||
cursor.moveToFirst();
|
||||
return new Metadata(cursor);
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
private StoreObject[] readStoreObjects(String type) {
|
||||
StoreObject[] ret;
|
||||
TodorooCursor<StoreObject> cursor = storeObjectDao.query(Query.select(StoreObject.PROPERTIES).
|
||||
where(StoreObjectCriteria.byType(type)));
|
||||
try {
|
||||
ret = new StoreObject[cursor.getCount()];
|
||||
for(int i = 0; i < ret.length; i++) {
|
||||
cursor.moveToNext();
|
||||
StoreObject dashboard = new StoreObject(cursor);
|
||||
ret[i] = dashboard;
|
||||
}
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package ru.otdelit.astrid.opencrx;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
|
||||
import com.todoroo.andlib.data.Property.LongProperty;
|
||||
import com.todoroo.andlib.data.Property.StringProperty;
|
||||
import com.todoroo.andlib.service.ContextManager;
|
||||
import com.todoroo.astrid.data.Metadata;
|
||||
import com.todoroo.astrid.sync.SyncProviderUtilities;
|
||||
|
||||
public class OpencrxCoreUtils extends SyncProviderUtilities{
|
||||
|
||||
public static final String OPENCRX_ACTIVITY_METADATA_KEY = "opencrx"; //$NON-NLS-1$
|
||||
|
||||
public static final String IDENTIFIER = "crx"; //$NON-NLS-1$
|
||||
|
||||
public static final LongProperty ACTIVITY_ID = new LongProperty(Metadata.TABLE, Metadata.VALUE1.name);
|
||||
public static final LongProperty ACTIVITY_CREATOR_ID = new LongProperty(Metadata.TABLE, Metadata.VALUE2.name);
|
||||
public static final LongProperty ACTIVITY_USERCREATOR_ID = new LongProperty(Metadata.TABLE, Metadata.VALUE3.name);
|
||||
public static final LongProperty ACTIVITY_ASSIGNED_TO_ID = new LongProperty(Metadata.TABLE, Metadata.VALUE4.name);
|
||||
public static final StringProperty ACTIVITY_CRX_ID = new StringProperty(Metadata.TABLE, Metadata.VALUE5.name);
|
||||
|
||||
private static final String PREF_USER_ID = "crx_userid"; //$NON-NLS-1$
|
||||
private static final String PREF_DEFAULT_CREATOR = "opencrx_defaultcreator"; //$NON-NLS-1$
|
||||
private static final String PREFS_FILE = "crx-prefs"; //$NON-NLS-1$
|
||||
|
||||
private static final String OPENCRX_PACKAGE = "ru.otdelit.astrid.opencrx"; //$NON-NLS-1$
|
||||
|
||||
public static final long CREATOR_NO_SYNC = -1;
|
||||
|
||||
public static final OpencrxCoreUtils INSTANCE = new OpencrxCoreUtils();
|
||||
|
||||
private OpencrxCoreUtils(){
|
||||
// prevent instantiation
|
||||
}
|
||||
|
||||
public Metadata newMetadata() {
|
||||
Metadata metadata = new Metadata();
|
||||
metadata.setValue(Metadata.KEY, OPENCRX_ACTIVITY_METADATA_KEY);
|
||||
metadata.setValue(ACTIVITY_ID, 0L);
|
||||
metadata.setValue(ACTIVITY_CREATOR_ID, getDefaultCreator());
|
||||
metadata.setValue(ACTIVITY_USERCREATOR_ID, getDefaultAssignedUser());
|
||||
metadata.setValue(ACTIVITY_ASSIGNED_TO_ID, getDefaultAssignedUser());
|
||||
metadata.setValue(ACTIVITY_CRX_ID, ""); //$NON-NLS-1$
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopOngoing() {
|
||||
SharedPreferences sharedPreferences = OpencrxCoreUtils.getPrefs();
|
||||
|
||||
if (sharedPreferences != null){
|
||||
Editor editor = sharedPreferences.edit();
|
||||
editor.putBoolean(getIdentifier() + PREF_ONGOING, false);
|
||||
editor.commit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets default creator from setting
|
||||
* @return CREATOR_NO_SYNC if should not sync, otherwise remote id
|
||||
*/
|
||||
public long getDefaultCreator() {
|
||||
long defaultCreatorId = CREATOR_NO_SYNC ;
|
||||
SharedPreferences sharedPreferences = OpencrxCoreUtils.getPrefs();
|
||||
|
||||
if (sharedPreferences != null){
|
||||
String defCreatorString = sharedPreferences.getString(PREF_DEFAULT_CREATOR, String.valueOf(CREATOR_NO_SYNC));
|
||||
|
||||
try{
|
||||
defaultCreatorId = Long.parseLong(defCreatorString);
|
||||
}catch(Exception ex){
|
||||
defaultCreatorId = CREATOR_NO_SYNC;
|
||||
}
|
||||
}
|
||||
|
||||
return defaultCreatorId;
|
||||
}
|
||||
|
||||
public long getDefaultAssignedUser(){
|
||||
SharedPreferences sharedPreferences = OpencrxCoreUtils.getPrefs();
|
||||
|
||||
if (sharedPreferences != null){
|
||||
return sharedPreferences.getLong(PREF_USER_ID, -1);
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
protected static SharedPreferences getPrefs() {
|
||||
try {
|
||||
Context crxContext = ContextManager.getContext().createPackageContext(OPENCRX_PACKAGE, 0);
|
||||
SharedPreferences sharedPreferences = crxContext.getSharedPreferences(PREFS_FILE,
|
||||
Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE);
|
||||
return sharedPreferences;
|
||||
} catch (NameNotFoundException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLoggedIn() {
|
||||
SharedPreferences sharedPreferences = OpencrxCoreUtils.getPrefs();
|
||||
|
||||
if (sharedPreferences != null)
|
||||
return sharedPreferences.getString(getIdentifier() + PREF_TOKEN, null) != null;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return IDENTIFIER;
|
||||
}
|
||||
@Override
|
||||
public int getSyncIntervalKey() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- See the file "LICENSE" for the full license governing this code. -->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- opencrx task assignment controlset -->
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/opencrx_TEA_creator_assign_label"
|
||||
style="@style/TextAppearance.GEN_EditLabel" />
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/opencrx_TEA_creator_textinput"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/opencrx_creator_input_hint"
|
||||
/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/opencrx_TEA_dashboard_assign"
|
||||
android:prompt="@string/opencrx_TEA_creator_assign_label"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/opencrx_TEA_task_assign_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/opencrx_TEA_task_assign_label"
|
||||
style="@style/TextAppearance.GEN_EditLabel" />
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/opencrx_TEA_contact_textinput"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/opencrx_contact_input_hint"
|
||||
/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/opencrx_TEA_task_assign"
|
||||
android:prompt="@string/opencrx_TEA_task_assign_label"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="1dip"
|
||||
android:padding="5dip"
|
||||
android:background="@android:drawable/divider_horizontal_dark" />
|
||||
|
||||
</merge>
|
||||
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file contains preference keys and preference list values.
|
||||
These should not be translated
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="opencrx_PPr_interval_key">opencrx_sync_freq</string>
|
||||
<string name="opencrx_PPr_login">opencrx_email</string>
|
||||
<string name="opencrx_PPr_password">opencrx_password</string>
|
||||
<string name="opencrx_PPr_defaultcreator_key">opencrx_defaultcreator</string>
|
||||
<string name="opencrx_PPr_host_key">opencrx_host</string>
|
||||
<string name="opencrx_PPr_segment_key">opencrx_segment</string>
|
||||
<string name="opencrx_PPr_provider_key">opencrx_provider</string>
|
||||
</resources>
|
@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- See the file "LICENSE" for the full license governing this code. -->
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- ====================== Plugin Boilerplate ========================= -->
|
||||
|
||||
<!-- filters header: OpenCRX -->
|
||||
<string name="opencrx_FEx_header">OpenCRX</string>
|
||||
|
||||
<!-- filter category for OpenCRX ActivityCreators -->
|
||||
<string name="opencrx_FEx_dashboard">Workspaces</string>
|
||||
|
||||
<!-- filter category for OpenCRX responsible person -->
|
||||
<string name="opencrx_FEx_responsible">Assigned To</string>
|
||||
|
||||
<!-- OpenCRX assignedTo filter title (%s => assigned contact) -->
|
||||
<string name="opencrx_FEx_responsible_title">Assigned To \'%s\'</string>
|
||||
|
||||
<!-- detail for showing tasks created by someone else (%s => person name) -->
|
||||
<string name="opencrx_PDE_task_from">from %s</string>
|
||||
|
||||
<!-- replacement string for task edit "Notes" when using OpenCRX -->
|
||||
<string name="opencrx_TEA_notes">Add a Comment</string>
|
||||
|
||||
<string name="opencrx_creator_input_hint">Creator</string>
|
||||
|
||||
<string name="opencrx_contact_input_hint">Assigned to</string>
|
||||
<!-- ==================================================== Preferences == -->
|
||||
|
||||
<!-- Preferences Title: OpenCRX -->
|
||||
<string name="opencrx_PPr_header">OpenCRX</string>
|
||||
|
||||
<!-- creator title for tasks that are not synchronized -->
|
||||
<string name="opencrx_no_creator">(Do Not Synchronize)</string>
|
||||
|
||||
<!-- preference title for default creator -->
|
||||
<string name="opencrx_PPr_defaultcreator_title">Default ActivityCreator</string>
|
||||
|
||||
<!-- preference description for default creator (%s -> setting) -->
|
||||
<string name="opencrx_PPr_defaultcreator_summary">New activities will be created by: %s</string>
|
||||
|
||||
<!-- preference description for default dashboard (when set to 'not synchronized') -->
|
||||
<string name="opencrx_PPr_defaultcreator_summary_none">New activities will not be synchronized by default</string>
|
||||
|
||||
<!-- OpenCRX host and segment group name -->
|
||||
<string name="opencrx_group">OpenCRX server</string>
|
||||
|
||||
<!-- preference description for OpenCRX host -->
|
||||
<string name="opencrx_host_title">Host</string>
|
||||
|
||||
<!-- dialog title for OpenCRX host -->
|
||||
<string name="opencrx_host_dialog_title">OpenCRX host</string>
|
||||
|
||||
<!-- example for OpenCRX host -->
|
||||
<string name="opencrx_host_summary">For example: <i>mydomain.com</i></string>
|
||||
|
||||
<!-- preference description for OpenCRX segment -->
|
||||
<string name="opencrx_segment_title">Segment</string>
|
||||
|
||||
<!-- dialog title for OpenCRX segment -->
|
||||
<string name="opencrx_segment_dialog_title">Synchronized segment</string>
|
||||
|
||||
<!-- example for OpenCRX segment -->
|
||||
<string name="opencrx_segment_summary">For example: <i>Standard</i></string>
|
||||
|
||||
<!-- default value for OpenCRX segment -->
|
||||
<string name="opencrx_segment_default">Standard</string>
|
||||
|
||||
<!-- preference description for OpenCRX provider -->
|
||||
<string name="opencrx_provider_title">Provider</string>
|
||||
|
||||
<!-- dialog title for OpenCRX provider -->
|
||||
<string name="opencrx_provider_dialog_title">OpenCRX data provider</string>
|
||||
|
||||
<!-- example for OpenCRX provider -->
|
||||
<string name="opencrx_provider_summary">For example: <i>CRX</i></string>
|
||||
|
||||
<!-- default value for OpenCRX provider -->
|
||||
<string name="opencrx_provider_default">CRX</string>
|
||||
<!-- ================================================= Login Activity == -->
|
||||
|
||||
<!-- Activity Title: Opencrx Login -->
|
||||
<string name="opencrx_PLA_title">Log In to OpenCRX</string>
|
||||
|
||||
<!-- Instructions: Opencrx login -->
|
||||
<string name="opencrx_PLA_body">Sign in with your OpenCRX account</string>
|
||||
|
||||
<!-- Sign In Button -->
|
||||
<string name="opencrx_PLA_signIn">Sign In</string>
|
||||
|
||||
<!-- Login Label -->
|
||||
<string name="opencrx_PLA_login">Login</string>
|
||||
|
||||
<!-- Password Label -->
|
||||
<string name="opencrx_PLA_password">Password</string>
|
||||
|
||||
<!-- Error Message when fields aren't filled out -->
|
||||
<string name="opencrx_PLA_errorEmpty">Error: fillout all fields</string>
|
||||
|
||||
<!-- Error Message when we receive a HTTP 401 Unauthorized -->
|
||||
<string name="opencrx_PLA_errorAuth">Error: login or password incorrect!</string>
|
||||
|
||||
<!-- ================================================ Synchronization == -->
|
||||
|
||||
<!-- title for notification tray after synchronizing -->
|
||||
<string name="opencrx_notification_title">OpenCRX</string>
|
||||
|
||||
<!-- text for notification tray when synchronizing -->
|
||||
<string name="opencrx_notification_text">%s tasks updated / click for more details</string>
|
||||
|
||||
<!-- Error msg when io exception -->
|
||||
<string name="opencrx_ioerror">Connection Error! Check your Internet connection.</string>
|
||||
|
||||
<!-- opencrx Login not specified-->
|
||||
<string name="opencrx_MLA_email_empty">Login was not specified!</string>
|
||||
|
||||
<!-- opencrx password not specified-->
|
||||
<string name="opencrx_MLA_password_empty">Password was not specified!</string>
|
||||
|
||||
<!-- ================================================ labels for layout-elements == -->
|
||||
|
||||
<!-- label for task-assignment spinner on taskeditactivity -->
|
||||
<string name="opencrx_TEA_task_assign_label">Assign this task to this person:</string>
|
||||
|
||||
<!-- Spinner-item for unassigned tasks on taskeditactivity -->
|
||||
<string name="opencrx_TEA_task_unassigned"><Unassigned></string>
|
||||
|
||||
<!-- label for dashboard-assignment spinner on taskeditactivity -->
|
||||
<string name="opencrx_TEA_creator_assign_label">Assign this task to this creator:</string>
|
||||
|
||||
<!-- Spinner-item for default dashboard on taskeditactivity -->
|
||||
<string name="opencrx_TEA_dashboard_default"><Default></string>
|
||||
|
||||
<string name="CFC_opencrx_in_workspace_text">In workspace: ?</string>
|
||||
|
||||
<string name="CFC_opencrx_in_workspace_name">In workspace...</string>
|
||||
|
||||
<string name="CFC_opencrx_assigned_to_text">Assigned to: ?</string>
|
||||
|
||||
<string name="CFC_opencrx_assigned_to_name">Assigned to...</string>
|
||||
|
||||
</resources>
|
@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sync_SPr_group_status">
|
||||
|
||||
<Preference
|
||||
android:layout="@layout/status_preference"
|
||||
android:key="@string/sync_SPr_status_key"
|
||||
android:textSize="24sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sync_SPr_group_options">
|
||||
|
||||
<ListPreference
|
||||
android:key="@string/opencrx_PPr_interval_key"
|
||||
android:entries="@array/sync_SPr_interval_entries"
|
||||
android:entryValues="@array/sync_SPr_interval_values"
|
||||
android:title="@string/sync_SPr_interval_title" />
|
||||
|
||||
<ListPreference
|
||||
android:key="@string/opencrx_PPr_defaultcreator_key"
|
||||
android:title="@string/opencrx_PPr_defaultcreator_title" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/opencrx_group">
|
||||
<EditTextPreference
|
||||
android:key="@string/opencrx_PPr_host_key"
|
||||
android:title="@string/opencrx_host_title"
|
||||
android:dialogTitle="@string/opencrx_host_dialog_title"
|
||||
android:summary="@string/opencrx_host_summary"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:key="@string/opencrx_PPr_segment_key"
|
||||
android:title="@string/opencrx_segment_title"
|
||||
android:dialogTitle="@string/opencrx_segment_dialog_title"
|
||||
android:summary="@string/opencrx_segment_summary"
|
||||
android:defaultValue="@string/opencrx_segment_default"
|
||||
/>
|
||||
<EditTextPreference
|
||||
android:key="@string/opencrx_PPr_provider_key"
|
||||
android:title="@string/opencrx_provider_title"
|
||||
android:dialogTitle="@string/opencrx_provider_dialog_title"
|
||||
android:summary="@string/opencrx_provider_summary"
|
||||
android:defaultValue="@string/opencrx_provider_default"
|
||||
/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/sync_SPr_group_actions">
|
||||
<Preference
|
||||
android:key="@string/sync_SPr_sync_key"
|
||||
android:title="@string/sync_SPr_sync" />
|
||||
|
||||
<Preference
|
||||
android:key="@string/sync_SPr_forget_key"
|
||||
android:title="@string/sync_SPr_forget"
|
||||
android:summary="@string/sync_SPr_forget_description" />
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
Loading…
Reference in New Issue