forked from hagarbi/AndroidStore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new method for event handling using Square's 'otto'
- Loading branch information
Showing
17 changed files
with
426 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.soomla.store; | ||
|
||
/* | ||
* Copyright (C) 2012 Square, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import com.squareup.otto.Bus; | ||
|
||
/** | ||
* Maintains a singleton instance for obtaining the bus. Ideally this would be replaced with a more efficient means | ||
* such as through injection directly into interested classes. | ||
*/ | ||
public final class BusProvider { | ||
private static final Bus BUS = new Bus(); | ||
|
||
public static Bus getInstance() { | ||
return BUS; | ||
} | ||
|
||
private BusProvider() { | ||
// No instances. | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
SoomlaAndroidStore/src/com/soomla/store/events/BillingNotSupportedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
|
||
public class BillingNotSupportedEvent { | ||
} |
20 changes: 20 additions & 0 deletions
20
SoomlaAndroidStore/src/com/soomla/store/events/BillingSupportedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
|
||
public class BillingSupportedEvent { | ||
} |
20 changes: 20 additions & 0 deletions
20
SoomlaAndroidStore/src/com/soomla/store/events/ClosingStoreEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
|
||
public class ClosingStoreEvent { | ||
} |
37 changes: 37 additions & 0 deletions
37
SoomlaAndroidStore/src/com/soomla/store/events/CurrencyBalanceChangedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.VirtualCurrency; | ||
|
||
public class CurrencyBalanceChangedEvent { | ||
|
||
private VirtualCurrency mCurrency; | ||
private int mBalance; | ||
|
||
public CurrencyBalanceChangedEvent(VirtualCurrency currency, int balance) { | ||
mCurrency = currency; | ||
mBalance = balance; | ||
} | ||
|
||
public VirtualCurrency getCurrency() { | ||
return mCurrency; | ||
} | ||
|
||
public int getBalance() { | ||
return mBalance; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
SoomlaAndroidStore/src/com/soomla/store/events/GoodBalanceChangedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.VirtualGood; | ||
|
||
public class GoodBalanceChangedEvent { | ||
|
||
private VirtualGood mGood; | ||
private int mBalance; | ||
|
||
public GoodBalanceChangedEvent(VirtualGood good, int balance) { | ||
mGood = good; | ||
mBalance = balance; | ||
} | ||
|
||
public VirtualGood getGood() { | ||
return mGood; | ||
} | ||
|
||
public int getBalance() { | ||
return mBalance; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
SoomlaAndroidStore/src/com/soomla/store/events/GoodPurchaseStartedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.VirtualGood; | ||
|
||
public class GoodPurchaseStartedEvent { | ||
|
||
private VirtualGood mGood; | ||
|
||
public GoodPurchaseStartedEvent(VirtualGood good) { | ||
mGood = good; | ||
} | ||
|
||
public VirtualGood getGood() { | ||
return mGood; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
SoomlaAndroidStore/src/com/soomla/store/events/GoodPurchasedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.VirtualGood; | ||
|
||
public class GoodPurchasedEvent { | ||
|
||
private VirtualGood mGood; | ||
|
||
public GoodPurchasedEvent(VirtualGood good) { | ||
mGood = good; | ||
} | ||
|
||
public VirtualGood getGood() { | ||
return mGood; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
SoomlaAndroidStore/src/com/soomla/store/events/MarketPurchaseEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.GoogleMarketItem; | ||
|
||
public class MarketPurchaseEvent { | ||
|
||
private GoogleMarketItem mGoogleMarketItem; | ||
|
||
public MarketPurchaseEvent(GoogleMarketItem googleMarketItem) { | ||
mGoogleMarketItem = googleMarketItem; | ||
} | ||
|
||
public GoogleMarketItem getGoogleMarketItem() { | ||
return mGoogleMarketItem; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
SoomlaAndroidStore/src/com/soomla/store/events/MarketPurchaseStartedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.GoogleMarketItem; | ||
|
||
public class MarketPurchaseStartedEvent { | ||
|
||
private GoogleMarketItem mGoogleMarketItem; | ||
|
||
public MarketPurchaseStartedEvent(GoogleMarketItem googleMarketItem) { | ||
mGoogleMarketItem = googleMarketItem; | ||
} | ||
|
||
public GoogleMarketItem getGoogleMarketItem() { | ||
return mGoogleMarketItem; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
SoomlaAndroidStore/src/com/soomla/store/events/MarketRefundEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
import com.soomla.store.domain.data.GoogleMarketItem; | ||
|
||
public class MarketRefundEvent { | ||
|
||
private GoogleMarketItem mGoogleMarketItem; | ||
|
||
public MarketRefundEvent(GoogleMarketItem googleMarketItem) { | ||
mGoogleMarketItem = googleMarketItem; | ||
} | ||
|
||
public GoogleMarketItem getGoogleMarketItem() { | ||
return mGoogleMarketItem; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
SoomlaAndroidStore/src/com/soomla/store/events/OpeningStoreEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
|
||
public class OpeningStoreEvent { | ||
} |
20 changes: 20 additions & 0 deletions
20
SoomlaAndroidStore/src/com/soomla/store/events/UnexpectedStoreErrorEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (C) 2012 Soomla Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.soomla.store.events; | ||
|
||
|
||
public class UnexpectedStoreErrorEvent { | ||
} |
Oops, something went wrong.