mirror of https://github.com/tasks/tasks
Fixing things
parent
9be5af7359
commit
990df8eb47
@ -1,27 +1,17 @@
|
||||
package org.tasks.receivers;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.todoroo.astrid.api.AstridApiConstants;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
|
||||
import org.tasks.injection.BroadcastComponent;
|
||||
import org.tasks.injection.InjectingBroadcastReceiver;
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class PushReceiver extends InjectingBroadcastReceiver {
|
||||
public class PushReceiver {
|
||||
|
||||
public static void broadcast(Context context, Task task, ContentValues values) {
|
||||
}
|
||||
@Inject
|
||||
public PushReceiver() {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
super.onReceive(context, intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void inject(BroadcastComponent component) {
|
||||
component.inject(this);
|
||||
public void push(Task task, Task original) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,17 @@
|
||||
package org.tasks.receivers;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.todoroo.astrid.api.AstridApiConstants;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
|
||||
import org.tasks.injection.BroadcastComponent;
|
||||
import org.tasks.injection.InjectingBroadcastReceiver;
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class PushReceiver extends InjectingBroadcastReceiver {
|
||||
public class PushReceiver {
|
||||
|
||||
public static void broadcast(Context context, Task task, ContentValues values) {
|
||||
}
|
||||
@Inject
|
||||
public PushReceiver() {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
super.onReceive(context, intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void inject(BroadcastComponent component) {
|
||||
component.inject(this);
|
||||
public void push(Task task, Task original) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,38 +1,19 @@
|
||||
package org.tasks.receivers;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.todoroo.astrid.api.AstridApiConstants;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
|
||||
import org.tasks.injection.BroadcastComponent;
|
||||
import org.tasks.injection.InjectingBroadcastReceiver;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class PushReceiver extends InjectingBroadcastReceiver {
|
||||
|
||||
public static void broadcast(Context context, Task task, Task original) {
|
||||
Intent intent = new Intent(context, PushReceiver.class);
|
||||
intent.putExtra(AstridApiConstants.EXTRAS_TASK, task);
|
||||
intent.putExtra(AstridApiConstants.EXTRAS_ORIGINAL, original);
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
@Inject GoogleTaskPusher googleTaskPusher;
|
||||
public class PushReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
super.onReceive(context, intent);
|
||||
private final GoogleTaskPusher googleTaskPusher;
|
||||
|
||||
googleTaskPusher.push(
|
||||
intent.getParcelableExtra(AstridApiConstants.EXTRAS_TASK),
|
||||
intent.getParcelableExtra(AstridApiConstants.EXTRAS_ORIGINAL));
|
||||
@Inject
|
||||
public PushReceiver(GoogleTaskPusher googleTaskPusher) {
|
||||
this.googleTaskPusher = googleTaskPusher;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void inject(BroadcastComponent component) {
|
||||
component.inject(this);
|
||||
public void push(Task task, Task original) {
|
||||
googleTaskPusher.push(task, original);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue