Merge remote branch 'origin/master' into dev
Conflicts: astrid/AndroidManifest.xml astrid/plugin-src/com/todoroo/astrid/producteev/sync/ProducteevDataService.java astrid/plugin-src/com/todoroo/astrid/rmilk/MilkBackgroundService.java astrid/plugin-src/com/todoroo/astrid/rmilk/MilkDetailExposer.java astrid/plugin-src/com/todoroo/astrid/rmilk/MilkPreferences.java astrid/plugin-src/com/todoroo/astrid/rmilk/api/data/RtmTask.java astrid/plugin-src/com/todoroo/astrid/rmilk/data/MilkNote.java astrid/plugin-src/com/todoroo/astrid/rmilk/sync/RTMSyncProvider.java astrid/plugin-src/com/todoroo/astrid/rmilk/sync/RTMTaskContainer.java astrid/src/com/todoroo/astrid/activity/TaskListActivity.java astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java astrid/src/com/todoroo/astrid/service/StartupService.javapull/14/head
@ -0,0 +1,87 @@
|
||||
/**
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.api;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/**
|
||||
* Represents an intent that can be called to perform synchronization
|
||||
*
|
||||
* @author Tim Su <tim@todoroo.com>
|
||||
*
|
||||
*/
|
||||
public class SyncAction implements Parcelable {
|
||||
|
||||
/**
|
||||
* Label
|
||||
*/
|
||||
public String label = null;
|
||||
|
||||
/**
|
||||
* Intent to call when invoking this operation
|
||||
*/
|
||||
public PendingIntent intent = null;
|
||||
|
||||
/**
|
||||
* Create an EditOperation object
|
||||
*
|
||||
* @param label
|
||||
* label to display
|
||||
* @param intent
|
||||
* intent to invoke. {@link EXTRAS_TASK_ID} will be passed
|
||||
*/
|
||||
public SyncAction(String label, PendingIntent intent) {
|
||||
super();
|
||||
this.label = label;
|
||||
this.intent = intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label of this action
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return label;
|
||||
}
|
||||
|
||||
// --- parcelable helpers
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(label);
|
||||
dest.writeParcelable(intent, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parcelable creator
|
||||
*/
|
||||
public static final Parcelable.Creator<SyncAction> CREATOR = new Parcelable.Creator<SyncAction>() {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public SyncAction createFromParcel(Parcel source) {
|
||||
return new SyncAction(source.readString(), (PendingIntent)source.readParcelable(
|
||||
PendingIntent.class.getClassLoader()));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public SyncAction[] newArray(int size) {
|
||||
return new SyncAction[size];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
package com.todoroo.astrid.api;
|
||||
package com.todoroo.astrid.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.todoroo.andlib.utility.AndroidUtilities;
|
||||
import com.todoroo.astrid.common.SyncProvider;
|
||||
import com.todoroo.astrid.model.Metadata;
|
||||
import com.todoroo.astrid.model.Task;
|
||||
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.producteev;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.astrid.api.AstridApiConstants;
|
||||
import com.todoroo.astrid.api.SyncAction;
|
||||
|
||||
/**
|
||||
* Exposes sync action
|
||||
*
|
||||
*/
|
||||
public class ProducteevSyncActionExposer extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// if we aren't logged in, don't expose sync action
|
||||
if(!ProducteevUtilities.INSTANCE.isLoggedIn())
|
||||
return;
|
||||
|
||||
Intent syncIntent = new Intent(ProducteevBackgroundService.SYNC_ACTION, null,
|
||||
context, ProducteevBackgroundService.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getService(context, 0, syncIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
SyncAction syncAction = new SyncAction(context.getString(R.string.producteev_PPr_header),
|
||||
pendingIntent);
|
||||
|
||||
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_SYNC_ACTIONS);
|
||||
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_ADDON, ProducteevUtilities.IDENTIFIER);
|
||||
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_RESPONSE, syncAction);
|
||||
context.sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.rmilk;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.astrid.api.AstridApiConstants;
|
||||
import com.todoroo.astrid.api.SyncAction;
|
||||
|
||||
/**
|
||||
* Exposes sync action
|
||||
*
|
||||
*/
|
||||
public class MilkSyncActionExposer extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// if we aren't logged in, don't expose sync action
|
||||
if(!MilkUtilities.isLoggedIn())
|
||||
return;
|
||||
|
||||
Intent syncIntent = new Intent(MilkBackgroundService.SYNC_ACTION, null,
|
||||
context, MilkBackgroundService.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getService(context, 0, syncIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
SyncAction syncAction = new SyncAction(context.getString(R.string.rmilk_MPr_header),
|
||||
pendingIntent);
|
||||
|
||||
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_SEND_SYNC_ACTIONS);
|
||||
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_ADDON, MilkUtilities.IDENTIFIER);
|
||||
broadcastIntent.putExtra(AstridApiConstants.EXTRAS_RESPONSE, syncAction);
|
||||
context.sendBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
|
||||
}
|
||||
|
||||
}
|
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 773 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 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.
|
||||
-->
|
||||
|
||||
<transition xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/list_selector_background_pressed" />
|
||||
<item android:drawable="@drawable/list_selector_background_longpress" />
|
||||
</transition>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 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.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_window_focused="false"
|
||||
android:drawable="@color/task_list_selected" />
|
||||
|
||||
<item android:state_focused="true" android:state_pressed="true"
|
||||
android:drawable="@drawable/list_selector_background_transition" />
|
||||
<item android:state_focused="false" android:state_pressed="true"
|
||||
android:drawable="@drawable/list_selector_background_transition" />
|
||||
|
||||
<item android:state_focused="true"
|
||||
android:drawable="@drawable/list_selector_background_focus" />
|
||||
|
||||
</selector>
|
After Width: | Height: | Size: 723 B |
@ -1,26 +0,0 @@
|
||||
package com.todoroo.astrid.api;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* Internal API for Task Details
|
||||
*
|
||||
* @author Tim Su <tim@todoroo.com>
|
||||
*
|
||||
*/
|
||||
public interface DetailExposer {
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* task id
|
||||
* @param extended
|
||||
* whether this request is for extended details (which are
|
||||
* displayed when user presses a task), or standard (which are
|
||||
* always displayed)
|
||||
* @return null if no details, or task details
|
||||
*/
|
||||
public String getTaskDetails(Context context, long id, boolean extended);
|
||||
|
||||
public String getPluginIdentifier();
|
||||
|
||||
}
|