Panagiotis Triantafyllou

fixed home

package ly.warp.sdk.activities;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.MenuItem;
import androidx.annotation.NonNull;
......@@ -10,6 +12,8 @@ import androidx.fragment.app.FragmentActivity;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarView;
import org.json.JSONException;
import java.util.HashMap;
import ly.warp.sdk.R;
......@@ -61,19 +65,19 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
}).start();
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver);
}
}).start();
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.getUserCoupons(new WarplyUserCouponsRequest(), mUserCouponsReceiver);
}
}).start();
// new Thread(() -> {
// if (!Thread.currentThread().isInterrupted()) {
// Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver);
// }
// }).start();
//
// new Thread(() -> {
// if (!Thread.currentThread().isInterrupted()) {
// WarplyManager.getUserCoupons(new WarplyUserCouponsRequest(), mUserCouponsReceiver);
// }
// }).start();
initViews();
// initViews();
}
@Override
......@@ -145,7 +149,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
@Override
public void onSuccess(Consumer result) {
mConsumer = result;
Thread.currentThread().interrupt();
// Thread.currentThread().interrupt();
Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver);
}
@Override
......@@ -154,8 +159,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
};
private final CallbackReceiver<CampaignList> mInboxReceiver =
new CallbackReceiver<CampaignList>() {
private final CallbackReceiver<CampaignList> mInboxReceiver = new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList result) {
for (Campaign campaign : result) {
......@@ -170,7 +174,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
}
Thread.currentThread().interrupt();
// Thread.currentThread().interrupt();
WarplyManager.getUserCoupons(new WarplyUserCouponsRequest(), mUserCouponsReceiver);
}
@Override
......@@ -179,12 +184,14 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
};
private final CallbackReceiver<CouponList> mUserCouponsReceiver =
new CallbackReceiver<CouponList>() {
private final CallbackReceiver<CouponList> mUserCouponsReceiver = new CallbackReceiver<CouponList>() {
@Override
public void onSuccess(CouponList result) {
mCouponList = result;
Thread.currentThread().interrupt();
new Handler(Looper.getMainLooper()).post(() -> {
initViews();
});
}
@Override
......