80 lines
2.5 KiB
Diff
80 lines
2.5 KiB
Diff
|
diff --git a/bushido-blocks-android/src/com/sandeel/bushidoblocks/AndroidLeaderboard.java b/bushido-blocks-android/src/com/sandeel/bushidoblocks/AndroidLeaderboard.java
|
||
|
index 6f70a79..73ba50f 100644
|
||
|
--- a/bushido-blocks-android/src/com/sandeel/bushidoblocks/AndroidLeaderboard.java
|
||
|
+++ b/bushido-blocks-android/src/com/sandeel/bushidoblocks/AndroidLeaderboard.java
|
||
|
@@ -20,38 +20,19 @@
|
||
|
package com.sandeel.bushidoblocks;
|
||
|
|
||
|
import com.sandeel.bushidoblocks.Leaderboard;
|
||
|
-import com.swarmconnect.Swarm;
|
||
|
-import com.swarmconnect.SwarmLeaderboard;
|
||
|
-import com.swarmconnect.SwarmLeaderboard.GotLeaderboardCB;
|
||
|
|
||
|
public class AndroidLeaderboard implements Leaderboard {
|
||
|
|
||
|
- GotLeaderboardCB callback = new GotLeaderboardCB() {
|
||
|
- public void gotLeaderboard(SwarmLeaderboard lb) {
|
||
|
-
|
||
|
- if (lb != null) {
|
||
|
-
|
||
|
- // Save the leaderboard for later use
|
||
|
- service = lb;
|
||
|
- }
|
||
|
- }
|
||
|
- };
|
||
|
-
|
||
|
- private SwarmLeaderboard service;
|
||
|
|
||
|
public AndroidLeaderboard() {
|
||
|
- SwarmLeaderboard.getLeaderboardById(ID, callback);
|
||
|
}
|
||
|
|
||
|
public void submitScore(int score) {
|
||
|
- if (service != null) service.submitScore(score);
|
||
|
}
|
||
|
|
||
|
public void showLeaderboards() {
|
||
|
- if (service != null) service.showLeaderboard();
|
||
|
}
|
||
|
|
||
|
public void showDash() {
|
||
|
- Swarm.showDashboard();
|
||
|
}
|
||
|
}
|
||
|
diff --git a/bushido-blocks-android/src/com/sandeel/bushidoblocks/MainActivity.java b/bushido-blocks-android/src/com/sandeel/bushidoblocks/MainActivity.java
|
||
|
index 12e4392..c5d735c 100644
|
||
|
--- a/bushido-blocks-android/src/com/sandeel/bushidoblocks/MainActivity.java
|
||
|
+++ b/bushido-blocks-android/src/com/sandeel/bushidoblocks/MainActivity.java
|
||
|
@@ -30,7 +30,6 @@ import com.google.ads.AdRequest;
|
||
|
import com.google.ads.AdSize;
|
||
|
import com.google.ads.AdView;
|
||
|
import com.sandeel.bushidoblocks.BushidoBlocks;
|
||
|
-import com.swarmconnect.Swarm;
|
||
|
|
||
|
public class MainActivity extends AndroidApplication {
|
||
|
|
||
|
@@ -39,9 +38,6 @@ public class MainActivity extends AndroidApplication {
|
||
|
|
||
|
super.onCreate(savedInstanceState);
|
||
|
|
||
|
- Swarm.setActive(this);
|
||
|
- Swarm.init(this, ID, "KEY");
|
||
|
-
|
||
|
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
||
|
cfg.useGL20 = true;
|
||
|
cfg.useAccelerometer = false;
|
||
|
@@ -88,11 +84,9 @@ public class MainActivity extends AndroidApplication {
|
||
|
|
||
|
public void onResume() {
|
||
|
super.onResume();
|
||
|
- Swarm.setActive(this);
|
||
|
}
|
||
|
|
||
|
public void onPause() {
|
||
|
super.onPause();
|
||
|
- Swarm.setInactive(this);
|
||
|
}
|
||
|
-}
|
||
|
\ No newline at end of file
|
||
|
+}
|