mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
update dependencies
This commit is contained in:
parent
9d89d65419
commit
3d12e22c81
29 changed files with 107 additions and 98 deletions
|
|
@ -38,9 +38,8 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'io.reactivex:rxjava:1.0.10'
|
||||
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
|
||||
compile 'com.squareup.okhttp:okhttp:2.3.0'
|
||||
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.2.0'
|
||||
compile 'com.squareup.okhttp3:okhttp:3.2.0'
|
||||
compile 'com.squareup.retrofit:retrofit:1.9.0'
|
||||
|
||||
compile('com.crashlytics.sdk.android:crashlytics:2.3.0@aar') {
|
||||
|
|
@ -50,23 +49,19 @@ dependencies {
|
|||
// View Elements Binding :)
|
||||
compile 'com.jakewharton:butterknife:7.0.1'
|
||||
|
||||
compile('com.mikepenz:materialdrawer:4.3.8@aar') {
|
||||
compile('com.mikepenz:materialdrawer:5.0.9@aar') {
|
||||
transitive = true
|
||||
}
|
||||
compile 'com.mikepenz:google-material-typeface:2.2.0.1@aar'
|
||||
|
||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||
compile 'com.android.support:design:23.1.1'
|
||||
compile 'com.android.support:gridlayout-v7:23.1.1'
|
||||
compile 'com.android.support:recyclerview-v7:23.1.1'
|
||||
compile 'com.android.support:preference-v14:23.1.1'
|
||||
compile 'com.android.support:appcompat-v7:23.2.0'
|
||||
compile 'com.android.support:design:23.2.0'
|
||||
compile 'com.android.support:gridlayout-v7:23.2.0'
|
||||
compile 'com.android.support:recyclerview-v7:23.2.0'
|
||||
compile 'com.android.support:preference-v14:23.2.0'
|
||||
|
||||
// Image Loading/Caching
|
||||
compile 'com.squareup.picasso:picasso:2.5.2'
|
||||
|
||||
// Icons
|
||||
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar'
|
||||
|
||||
// Emojis
|
||||
compile 'com.github.data5tream:emoji-lib:0.0.2.1'
|
||||
|
||||
|
|
@ -82,24 +77,29 @@ dependencies {
|
|||
}
|
||||
|
||||
// a better fab alternative
|
||||
compile 'com.github.clans:fab:1.6.1'
|
||||
compile 'com.github.clans:fab:1.6.2'
|
||||
|
||||
// ORM
|
||||
provided 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
|
||||
compile "com.raizlabs.android:DBFlow-Core:2.2.1"
|
||||
compile "com.raizlabs.android:DBFlow:2.2.1"
|
||||
|
||||
compile 'de.greenrobot:eventbus:2.4.0'
|
||||
compile 'org.greenrobot:eventbus:3.0.0'
|
||||
|
||||
// IAP Handling / Verification
|
||||
compile 'org.solovyev.android:checkout:0.7.5@aar'
|
||||
|
||||
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
|
||||
compile('com.facebook.android:facebook-android-sdk:4.10.0') {
|
||||
transitive = true
|
||||
}
|
||||
|
||||
//Material Dialogs
|
||||
compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar')
|
||||
|
||||
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
|
||||
|
||||
compile 'com.github.traex.rippleeffect:library:1.3'
|
||||
|
||||
compile 'com.amplitude:android-sdk:2.5.0'
|
||||
|
||||
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
|
||||
|
|
|
|||
|
|
@ -1,37 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dip"
|
||||
android:layout_marginRight="10dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_height="72dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="8"
|
||||
app:hintTextAppearance="@style/TextAppearance.AppCompat">
|
||||
|
||||
<com.github.data5tream.emojilib.EmojiEditText
|
||||
<EditText
|
||||
android:id="@+id/editText"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@android:color/black"
|
||||
android:hint="Add Tag"
|
||||
android:hint="@string/add_tag"
|
||||
android:inputType="text" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAdd"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:textColor="@color/white"
|
||||
android:text="+" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:visibility="@{party.quest.active? View.VISIBLE : View.GONE}">
|
||||
android:visibility="@{group.quest.active? View.VISIBLE : View.GONE}">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnQuestAbort"
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
android:backgroundTint="@color/btn_warning"
|
||||
android:text="@string/quest.abort"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="@{(party.quest != null && user.getId().equals(party.quest.leader))? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{(group.quest != null && user.getId().equals(group.quest.leader))? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnQuestLeave"
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
android:backgroundTint="@color/btn_warning"
|
||||
android:text="@string/quest.leave"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="@{(!user.getId().equals(party.quest.leader) && party.quest.members.containsKey(user.getId()))? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{(!user.getId().equals(group.quest.leader) && group.quest.members.containsKey(user.getId()))? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -174,7 +174,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:visibility="@{!party.quest.active? View.VISIBLE : View.GONE}">
|
||||
android:visibility="@{!group.quest.active? View.VISIBLE : View.GONE}">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnQuestAccept"
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
android:backgroundTint="@color/btn_warning"
|
||||
android:text="@string/quest.begin"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="@{user.getId().equals(party.quest.leader) ? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{user.getId().equals(group.quest.leader) ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnQuestCancel"
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
android:backgroundTint="@color/btn_danger"
|
||||
android:text="@string/quest.cancel"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="@{user.getId().equals(party.quest.leader) ? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{user.getId().equals(group.quest.leader) ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -232,4 +232,5 @@ To start, which parts of your life do you want to improve?</string>
|
|||
<string name="delete">Delete</string>
|
||||
<string name="name">Name</string>
|
||||
<string name="description">Description</string>
|
||||
<string name="add_tag">Add Tag</string>
|
||||
</resources>
|
||||
|
|
@ -5,7 +5,7 @@ import com.habitrpg.android.habitica.events.SkillUsedEvent;
|
|||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.Skill;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.habitrpg.android.habitica.callbacks;
|
|||
import android.util.Log;
|
||||
import com.habitrpg.android.habitica.events.TaskCreatedEvent;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.habitrpg.android.habitica.callbacks;
|
|||
import android.util.Log;
|
||||
import com.habitrpg.android.habitica.events.TaskUpdatedEvent;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ import com.habitrpg.android.habitica.userpicture.UserPicture;
|
|||
import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.Stats;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
/**
|
||||
* Created by Negue on 14.06.2015.
|
||||
|
|
@ -180,6 +181,7 @@ public class AvatarWithBarsViewModel implements View.OnClickListener {
|
|||
valueBar.icHeader.setImageResource(icon);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(BoughtGemsEvent gemsEvent){
|
||||
Double gems = userObject.getBalance() * 4;
|
||||
gems += gemsEvent.NewGemsToAdd;
|
||||
|
|
|
|||
|
|
@ -3,25 +3,24 @@ package com.habitrpg.android.habitica.ui;
|
|||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.github.data5tream.emojilib.EmojiEditText;
|
||||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.events.commands.CreateTagCommand;
|
||||
import com.habitrpg.android.habitica.ui.helpers.ViewHelper;
|
||||
import com.mikepenz.materialdrawer.model.BasePrimaryDrawerItem;
|
||||
import com.mikepenz.materialdrawer.model.utils.ViewHolderFactory;
|
||||
import com.mikepenz.materialdrawer.model.BaseViewHolder;
|
||||
import com.mikepenz.fastadapter.utils.ViewHolderFactory;
|
||||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Created by Negue on 18.06.2015.
|
||||
*/
|
||||
public class EditTextDrawer extends BasePrimaryDrawerItem<EditTextDrawer> {
|
||||
public class EditTextDrawer extends BasePrimaryDrawerItem<EditTextDrawer, EditTextDrawer.ViewHolder> {
|
||||
@Override
|
||||
public String getType() {
|
||||
return "EDIT_TEXT_DRAWER";
|
||||
public int getType() {
|
||||
return R.id.material_drawer_item_primary;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -30,33 +29,27 @@ public class EditTextDrawer extends BasePrimaryDrawerItem<EditTextDrawer> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bindView(RecyclerView.ViewHolder viewHolder) {
|
||||
final ViewHolder holder = (ViewHolder) viewHolder;
|
||||
// ((ViewHolder) viewHolder).btnAdd
|
||||
|
||||
public void bindView(ViewHolder holder) {
|
||||
onPostBindView(this, holder.itemView);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ViewHolderFactory getFactory() {
|
||||
return new ItemFactory();
|
||||
}
|
||||
|
||||
public static class ItemFactory implements ViewHolderFactory<ViewHolder> {
|
||||
public ViewHolder factory(View v) {
|
||||
public static class ItemFactory implements ViewHolderFactory<EditTextDrawer.ViewHolder> {
|
||||
public ViewHolder create(View v) {
|
||||
return new ViewHolder(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class ViewHolder extends BaseViewHolder implements View.OnClickListener {
|
||||
|
||||
View view;
|
||||
|
||||
@Bind(R.id.editText)
|
||||
EmojiEditText editText;
|
||||
EditText editText;
|
||||
|
||||
@Bind(R.id.btnAdd)
|
||||
Button btnAdd;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ public class MainDrawerBuilder {
|
|||
BaseMainFragment fragment = null;
|
||||
Class newActivityClass = null;
|
||||
|
||||
switch (drawerItem.getIdentifier()) {
|
||||
int identifier = (int) drawerItem.getIdentifier();
|
||||
switch (identifier) {
|
||||
case SIDEBAR_TASKS: {
|
||||
fragment = new TasksFragment();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ import com.raizlabs.android.dbflow.sql.language.From;
|
|||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
import com.raizlabs.android.dbflow.sql.language.Where;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.solovyev.android.checkout.ActivityCheckout;
|
||||
|
|
@ -91,7 +92,7 @@ import java.util.TimeZone;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.Bind;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
@ -504,23 +505,28 @@ public class MainActivity extends BaseActivity implements HabitRPGUserCallback.O
|
|||
|
||||
// region Events
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(ToggledInnStateEvent evt) {
|
||||
avatarInHeader.updateData(user);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(UpdateUserCommand event) {
|
||||
mAPIHelper.apiService.updateUser(event.updateData, new HabitRPGUserCallback(this));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(UnlockPathCommand event) {
|
||||
this.user.setBalance(this.user.getBalance() - event.balanceDiff);
|
||||
mAPIHelper.apiService.unlockPath(event.path, new UnlockCallback(this, this.user));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(OpenMenuItemCommand event) {
|
||||
drawer.setSelection(event.identifier);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final BuyRewardCommand event) {
|
||||
final String rewardKey = event.Reward.getId();
|
||||
|
||||
|
|
@ -588,6 +594,7 @@ public class MainActivity extends BaseActivity implements HabitRPGUserCallback.O
|
|||
user.async().save();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final DeleteTaskCommand cmd) {
|
||||
mAPIHelper.apiService.deleteTask(cmd.TaskIdToDelete, new Callback<Void>() {
|
||||
@Override
|
||||
|
|
@ -602,14 +609,17 @@ public class MainActivity extends BaseActivity implements HabitRPGUserCallback.O
|
|||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(OpenGemPurchaseFragmentCommand cmd) {
|
||||
drawer.setSelection(MainDrawerBuilder.SIDEBAR_PURCHASE);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(DisplayTutorialEvent tutorialEvent) {
|
||||
this.displayTutorialStep(tutorialEvent.step, tutorialEvent.tutorialText);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(DisplayFragmentEvent event) {
|
||||
this.displayFragment(event.fragment);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
|||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
|
@ -31,7 +32,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import butterknife.Bind;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
@ -146,6 +147,7 @@ public class SetupActivity extends BaseActivity implements View.OnClickListener,
|
|||
pager.addOnPageChangeListener(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(UpdateUserCommand event) {
|
||||
this.apiHelper.apiService.updateUser(event.updateData, new HabitRPGUserCallback(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ import java.util.GregorianCalendar;
|
|||
import java.util.List;
|
||||
|
||||
import butterknife.Bind;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
|
||||
public class TaskFormActivity extends BaseActivity implements AdapterView.OnItemSelectedListener {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.Map;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Created by viirus on 13/01/16.
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Created by viirus on 25/11/15.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import java.util.Map;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class CustomizationSetupAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ import com.habitrpg.android.habitica.ui.helpers.EmojiKeyboard;
|
|||
import com.habitrpg.android.habitica.ui.helpers.DataBindingUtils;
|
||||
import com.habitrpg.android.habitica.ui.helpers.ViewHelper;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.ChatMessage;
|
||||
import com.mikepenz.fontawesome_typeface_library.FontAwesome;
|
||||
import com.mikepenz.iconics.Iconics;
|
||||
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
|
@ -39,7 +38,7 @@ import java.util.Map;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Created by Negue on 20.08.2015.
|
||||
|
|
@ -207,10 +206,6 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
btnSendNewMessage.setOnClickListener(this);
|
||||
int color = ContextCompat.getColor(context, R.color.brand);
|
||||
|
||||
// Using the Iconics buttons, it is unable to tint the background
|
||||
btnSendNewMessage.setTypeface(Iconics.findFont(FontAwesome.Icon.faw_comment).getTypeface(context));
|
||||
btnSendNewMessage.setText(new Iconics.IconicsBuilder().ctx(context).on("{faw-comment}").build());
|
||||
|
||||
ViewHelper.SetBackgroundTint(btnSendNewMessage, color);
|
||||
|
||||
// Set up the emoji keyboard
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import java.util.ArrayList;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ import java.util.UUID;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
|
||||
public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
||||
|
|
@ -103,10 +104,12 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(FilterTasksByTagsCommand cmd) {
|
||||
filter();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(TaskCheckedCommand evnt){
|
||||
if (!taskType.equals(evnt.Task.getType()))
|
||||
return;
|
||||
|
|
@ -119,6 +122,7 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
filter();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(TaskUpdatedEvent evnt) {
|
||||
if (!taskType.equals(evnt.task.getType()))
|
||||
return;
|
||||
|
|
@ -126,6 +130,7 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
filter();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(TaskCreatedEvent evnt) {
|
||||
if (!taskType.equals(evnt.task.getType()))
|
||||
return;
|
||||
|
|
@ -134,6 +139,7 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
|||
filter();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(TaskRemovedEvent evnt) {
|
||||
Task taskToDelete = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import org.json.JSONObject;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class BaseFragment extends Fragment {
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import com.magicmicky.habitrpgwrapper.lib.models.HabitRPGUser;
|
|||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import de.greenrobot.event.EventBusException;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.EventBusException;
|
||||
|
||||
public abstract class BaseMainFragment extends BaseFragment {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import com.habitrpg.android.habitica.HabiticaApplication;
|
|||
import com.habitrpg.android.habitica.R;
|
||||
import com.habitrpg.android.habitica.events.BoughtGemsEvent;
|
||||
import com.habitrpg.android.habitica.ui.helpers.ViewHelper;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import io.fabric.sdk.android.Fabric;
|
||||
import org.solovyev.android.checkout.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import com.habitrpg.android.habitica.R;
|
|||
import com.habitrpg.android.habitica.events.commands.AddNewTaskCommand;
|
||||
import com.habitrpg.android.habitica.ui.adapter.SkillTasksRecyclerViewAdapter;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* Created by viirus on 28/11/15.
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import com.magicmicky.habitrpgwrapper.lib.models.Skill;
|
|||
import com.raizlabs.android.dbflow.sql.builder.Condition;
|
||||
import com.raizlabs.android.dbflow.sql.language.Select;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.Bind;
|
||||
|
|
@ -94,6 +96,7 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
checkUserLoadSkills();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(UseSkillCommand command) {
|
||||
Skill skill = command.skill;
|
||||
if (skill.target.equals("task")) {
|
||||
|
|
@ -106,6 +109,7 @@ public class SkillsFragment extends BaseMainFragment {
|
|||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(SkillUsedEvent event) {
|
||||
removeProgressDialog();
|
||||
Skill skill = event.usedSkill;
|
||||
|
|
|
|||
|
|
@ -40,8 +40,10 @@ import java.util.List;
|
|||
|
||||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import de.greenrobot.event.EventBusException;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.EventBusException;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
@ -213,6 +215,7 @@ public class ChatListFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final FlagChatMessageCommand cmd) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setMessage(R.string.chat_flag_confirmation)
|
||||
|
|
@ -236,6 +239,7 @@ public class ChatListFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||
builder.show();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final ToggleLikeMessageCommand cmd) {
|
||||
apiHelper.apiService.likeMessage(cmd.groupId, cmd.chatMessage.id, new Callback<List<Void>>() {
|
||||
@Override
|
||||
|
|
@ -250,6 +254,7 @@ public class ChatListFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final DeleteChatMessageCommand cmd) {
|
||||
apiHelper.apiService.deleteMessage(cmd.groupId, cmd.chatMessage.id, new Callback<Void>() {
|
||||
@Override
|
||||
|
|
@ -268,6 +273,7 @@ public class ChatListFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||
});
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(SendNewGroupMessageCommand cmd) {
|
||||
|
||||
apiHelper.apiService.postGroupChat(cmd.TargetGroupId, cmd.Message, new Callback<PostChatMessageResult>() {
|
||||
|
|
@ -290,6 +296,7 @@ public class ChatListFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||
}
|
||||
|
||||
// If the ChatList is Tavern, we're able to toggle the sleep-mode
|
||||
@Subscribe
|
||||
public void onEvent(ToggleInnCommand event) {
|
||||
apiHelper.toggleSleep(new Callback<Void>() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ import com.magicmicky.habitrpgwrapper.lib.models.QuestContent;
|
|||
import butterknife.Bind;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import de.greenrobot.event.EventBus;
|
||||
import de.greenrobot.event.EventBusException;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.EventBusException;
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class GuildFragment extends BaseMainFragment implements Callback<Group> {
|
|||
|
||||
switch (position) {
|
||||
case 0: {
|
||||
fragment = guildInformationFragment = GroupInformationFragment.newInstance(GuildFragment.this.guild);
|
||||
fragment = guildInformationFragment = GroupInformationFragment.newInstance(GuildFragment.this.guild, user, mAPIHelper);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import com.habitrpg.android.habitica.ui.adapter.tasks.HabitItemRecyclerViewAdapt
|
|||
import com.habitrpg.android.habitica.ui.fragments.BaseFragment;
|
||||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* TaskRecyclerViewFragment
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.greenrobot.event.EventBus;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import retrofit.Callback;
|
||||
import retrofit.RetrofitError;
|
||||
import retrofit.client.Response;
|
||||
|
|
@ -373,6 +375,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
|
||||
//region Events
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final CreateTagCommand event) {
|
||||
final Tag t = new Tag();
|
||||
t.setName(event.tagName);
|
||||
|
|
@ -398,6 +401,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(TaskTappedEvent event) {
|
||||
if (this.displayingTaskForm) {
|
||||
return;
|
||||
|
|
@ -414,21 +418,22 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
}
|
||||
|
||||
public void onEvent(TaskLongPressedEvent event) {
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(TaskCheckedCommand event) {
|
||||
mAPIHelper.updateTaskDirection(event.Task.getId(), event.Task.getCompleted() ? TaskDirection.down : TaskDirection.up, new TaskScoringCallback(activity, event.Task.getId()));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(HabitScoreEvent event) {
|
||||
mAPIHelper.updateTaskDirection(event.Habit.getId(), event.Up ? TaskDirection.up : TaskDirection.down, new TaskScoringCallback(activity, event.Habit.getId()));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(AddNewTaskCommand event) {
|
||||
openNewTaskActivity(event.ClassType.toLowerCase());
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(final TaskSaveEvent event) {
|
||||
Task task = (Task) event.task;
|
||||
if (event.created) {
|
||||
|
|
@ -440,6 +445,7 @@ public class TasksFragment extends BaseMainFragment implements OnCheckedChangeLi
|
|||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onEvent(ToggledInnStateEvent event) {
|
||||
user.getPreferences().setSleep(event.Inn);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue