Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2022-03-29 14:33:44 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a187c60a4716ff59c4028ae247c3edf980e94cb3
a187c60a
1 parent
3978fb53
fixed home
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
a187c60
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
...
...
Please
register
or
login
to post a comment