Commit 60308914ac2e08a5bfd17e112d996e3aa3505880
1 parent
db41d854
- add hide/show hidebar of About
Showing
2 changed files
with
35 additions
and
3 deletions
app/build.gradle
1 | 1 | apply plugin: 'com.android.application' |
2 | 2 | |
3 | 3 | android { |
4 | + signingConfigs { | |
5 | + releaseKey { | |
6 | + keyAlias 'devfac_userstory' | |
7 | + keyPassword 'trp1004o' | |
8 | + storeFile file('/Users/Onether/_Project/_AndroidStudio_workspace/UserStory/app/keystore.jks') | |
9 | + storePassword 'trp1004o' | |
10 | + } | |
11 | + } | |
4 | 12 | compileSdkVersion 22 |
5 | 13 | buildToolsVersion '23.0.1' |
6 | 14 | defaultConfig { |
... | ... | @@ -18,6 +26,10 @@ android { |
18 | 26 | // } |
19 | 27 | productFlavors { |
20 | 28 | } |
29 | + buildTypes { | |
30 | + debug { | |
31 | + } | |
32 | + } | |
21 | 33 | } |
22 | 34 | |
23 | 35 | dependencies { | ... | ... |
app/src/main/java/net/devfac/userstory/ActivityAbout.java
... | ... | @@ -49,6 +49,9 @@ public class ActivityAbout extends AppCompatActivity implements View.OnClickList |
49 | 49 | private ImageView mImageViewAboutCoffee2; |
50 | 50 | private ImageView mImageViewAboutCoffee3; |
51 | 51 | |
52 | + private ImageView mImageViewHide1; | |
53 | + private ImageView mImageViewHide2; | |
54 | + private ImageView mImageViewHide3; | |
52 | 55 | |
53 | 56 | private final ServiceConnection mIabServiceConnection = new ServiceConnection(){ |
54 | 57 | |
... | ... | @@ -84,6 +87,10 @@ public class ActivityAbout extends AppCompatActivity implements View.OnClickList |
84 | 87 | mImageViewAboutCoffee2.setOnClickListener(this); |
85 | 88 | mImageViewAboutCoffee3.setOnClickListener(this); |
86 | 89 | |
90 | + mImageViewHide1 = (ImageView)findViewById(R.id.image_view_about_hide1); | |
91 | + mImageViewHide2 = (ImageView)findViewById(R.id.image_view_about_hide2); | |
92 | + mImageViewHide3 = (ImageView)findViewById(R.id.image_view_about_hide3); | |
93 | + | |
87 | 94 | //PAYMENT_TARGET |
88 | 95 | mSkuList = new ArrayList<>(); |
89 | 96 | mSkuList.add(Constants.PAYMENT_SKU_COFFEE_1); |
... | ... | @@ -200,19 +207,32 @@ public class ActivityAbout extends AppCompatActivity implements View.OnClickList |
200 | 207 | Bundle ownedItems = mIabService.getPurchases(3, getPackageName(), "inapp", null); |
201 | 208 | |
202 | 209 | int response = ownedItems.getInt("RESPONSE_CODE"); |
210 | + Logger.i("ownedItem result : " + response); | |
203 | 211 | |
204 | 212 | if( response == IabHelper.BILLING_RESPONSE_RESULT_OK ){ |
205 | 213 | ArrayList purchasedDataList = ownedItems.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); |
214 | +// Logger.i("purchasedData size : " + purchasedDataList.size()); | |
215 | + | |
206 | 216 | String[] tokens = new String[purchasedDataList.size()]; |
207 | 217 | |
208 | 218 | for( int i=0 ; i < purchasedDataList.size() ; i++ ){ |
209 | 219 | String purchasedData = (String)purchasedDataList.get(i); |
210 | - | |
220 | + Logger.i("purchasedData : " + purchasedData); | |
211 | 221 | JSONObject object = new JSONObject(purchasedData); |
212 | 222 | |
213 | 223 | tokens[i] = object.getString("purchaseToken"); |
214 | - | |
215 | - mIabService.consumePurchase(3, getPackageName(), tokens[i]); | |
224 | + String productId = object.getString("productId"); | |
225 | + if( productId.equals(Constants.PAYMENT_SKU_COFFEE_1)){ | |
226 | + mImageViewHide1.setVisibility(View.GONE); | |
227 | + } | |
228 | + else if( productId.equals(Constants.PAYMENT_SKU_COFFEE_2)){ | |
229 | + mImageViewHide2.setVisibility(View.GONE); | |
230 | + } | |
231 | + else if( productId.equals(Constants.PAYMENT_SKU_COFFEE_3)){ | |
232 | + mImageViewHide3.setVisibility(View.GONE); | |
233 | + } | |
234 | + | |
235 | +// mIabService.consumePurchase(3, getPackageName(), tokens[i]); | |
216 | 236 | } |
217 | 237 | } |
218 | 238 | } catch (RemoteException e) { | ... | ... |