Skip to content

Commit a0a2e87

Browse files
author
mcsong
committed
update to 1.0.6
1 parent b919d50 commit a0a2e87

File tree

9 files changed

+154
-25
lines changed

9 files changed

+154
-25
lines changed

AppStoreLibrary.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<content url="file://$MODULE_DIR$">
1414
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
1515
</content>
16-
<orderEntry type="inheritedJdk" />
16+
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
1717
<orderEntry type="sourceFolder" forTests="false" />
1818
</component>
1919
</module>

Demo/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 24
5-
buildToolsVersion "24.0.1"
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.3"
66

77
defaultConfig {
88
applicationId "net.sjava.appstore.demo"
@@ -26,5 +26,5 @@ android {
2626
dependencies {
2727
compile fileTree(dir: 'libs', include: ['*.jar'])
2828
compile project(':Library')
29-
compile 'com.android.support:appcompat-v7:24.2.0'
29+
compile 'com.android.support:appcompat-v7:25.4.0'
3030
}

Demo/src/main/java/net/sjava/appstore/demo/MainActivity.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ private void initPlayAppStore() {
4141
Button btn03 = (Button)findViewById(R.id.play_button_03);
4242
Button btn04 = (Button)findViewById(R.id.play_button_04);
4343

44+
Button btn05 = (Button)findViewById(R.id.play_button_05);
45+
Button btn06 = (Button)findViewById(R.id.play_button_06);
46+
4447
btn01.setOnClickListener(new View.OnClickListener() {
4548
@Override
4649
public void onClick(View v) {
@@ -72,6 +75,37 @@ public void onClick(View v) {
7275
appStore.searchApp(ctx, "gmail");
7376
}
7477
});
78+
79+
btn05.setOnClickListener(new View.OnClickListener() {
80+
@Override
81+
public void onClick(View v) {
82+
appStore = PlayAppStore.newInstance();
83+
((PlayAppStore)appStore).openDeveloperPage(ctx, "developerId");
84+
85+
}
86+
});
87+
88+
btn06.setOnClickListener(new View.OnClickListener() {
89+
@Override
90+
public void onClick(View v) {
91+
appStore = PlayAppStore.newInstance();
92+
//Staff Picks (Featured)
93+
/*
94+
Collection collection_name
95+
Staff Picks (Featured) featured
96+
Top Paid topselling_paid
97+
Top Free topselling_free
98+
Top New Free topselling_new_free
99+
Top New Paid topselling_new_paid
100+
Top Grossing topgrossing
101+
Trending movers_shakers
102+
*/
103+
//((PlayAppStore)appStore).openCollectionApps(ctx, "featured");
104+
((PlayAppStore)appStore).openCollectionApps(ctx, "topgrossing");
105+
106+
}
107+
});
108+
75109
}
76110

77111
private void initAmazonAppStore() {

Demo/src/main/res/layout/activity_main.xml

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,71 @@
2525
<LinearLayout
2626
android:orientation="horizontal"
2727
android:layout_width="match_parent"
28-
android:layout_height="wrap_content">
28+
android:layout_height="wrap_content"
29+
android:weightSum="10.0">
30+
2931
<Button
3032
android:layout_width="wrap_content"
3133
android:layout_height="wrap_content"
3234
android:text="@string/lbl_check_app_installed"
3335
android:id="@+id/play_button_01"
36+
android:layout_weight="2.5"
37+
android:ellipsize="middle"
3438
style="@style/Base.TextAppearance.AppCompat.Small"/>
3539

3640
<Button
3741
android:layout_width="wrap_content"
3842
android:layout_height="wrap_content"
3943
android:text="@string/lbl_open_app"
44+
android:layout_weight="2.5"
4045
android:id="@+id/play_button_02"
41-
46+
android:ellipsize="middle"
4247
style="@style/Base.TextAppearance.AppCompat.Small"/>
4348

4449
<Button
4550
android:layout_width="wrap_content"
4651
android:layout_height="wrap_content"
4752
android:text="@string/lbl_open_publisher_apps"
53+
android:layout_weight="2.5"
4854
android:id="@+id/play_button_03"
55+
android:ellipsize="middle"
4956
style="@style/Base.TextAppearance.AppCompat.Small"/>
5057

5158
<Button
5259
android:layout_width="wrap_content"
5360
android:layout_height="wrap_content"
5461
android:text="@string/lbl_search_app"
62+
android:layout_weight="2.5"
5563
android:id="@+id/play_button_04"
64+
android:ellipsize="middle"
5665
style="@style/Base.TextAppearance.AppCompat.Small"/>
5766

5867
</LinearLayout>
5968

69+
<LinearLayout
70+
android:orientation="horizontal"
71+
android:layout_width="match_parent"
72+
android:layout_height="wrap_content"
73+
android:weightSum="10.0">
74+
<Button
75+
android:layout_width="wrap_content"
76+
android:layout_height="wrap_content"
77+
android:text="@string/lbl_developer_page"
78+
android:id="@+id/play_button_05"
79+
android:layout_weight="2.5"
80+
android:ellipsize="middle"
81+
style="@style/Base.TextAppearance.AppCompat.Small"/>
82+
83+
<Button
84+
android:layout_width="wrap_content"
85+
android:layout_height="wrap_content"
86+
android:text="@string/lbl_open_collection"
87+
android:layout_weight="2.5"
88+
android:id="@+id/play_button_06"
89+
android:ellipsize="middle"
90+
style="@style/Base.TextAppearance.AppCompat.Small"/>
91+
</LinearLayout>
92+
6093
<TextView
6194
android:layout_width="wrap_content"
6295
android:layout_height="wrap_content"
@@ -67,32 +100,41 @@
67100
<LinearLayout
68101
android:orientation="horizontal"
69102
android:layout_width="match_parent"
70-
android:layout_height="wrap_content">
103+
android:layout_height="wrap_content"
104+
android:weightSum="10.0">
71105
<Button
72106
android:layout_width="wrap_content"
73107
android:layout_height="wrap_content"
74108
android:text="@string/lbl_check_app_installed"
109+
android:layout_weight="2.5"
110+
android:ellipsize="middle"
75111
android:id="@+id/amazon_button_01"
76112
style="@style/Base.TextAppearance.AppCompat.Small"/>
77113

78114
<Button
79115
android:layout_width="wrap_content"
80116
android:layout_height="wrap_content"
81117
android:text="@string/lbl_open_app"
118+
android:layout_weight="2.5"
119+
android:ellipsize="middle"
82120
android:id="@+id/amazon_button_02"
83121
style="@style/Base.TextAppearance.AppCompat.Small"/>
84122

85123
<Button
86124
android:layout_width="wrap_content"
87125
android:layout_height="wrap_content"
88126
android:text="@string/lbl_open_publisher_apps"
127+
android:layout_weight="2.5"
128+
android:ellipsize="middle"
89129
android:id="@+id/amazon_button_03"
90130
style="@style/Base.TextAppearance.AppCompat.Small"/>
91131

92132
<Button
93133
android:layout_width="wrap_content"
94134
android:layout_height="wrap_content"
95135
android:text="@string/lbl_search_app"
136+
android:layout_weight="2.5"
137+
android:ellipsize="middle"
96138
android:id="@+id/amazon_button_04"
97139
style="@style/Base.TextAppearance.AppCompat.Small"/>
98140

@@ -102,37 +144,45 @@
102144
android:layout_width="wrap_content"
103145
android:layout_height="wrap_content"
104146
android:layout_margin="4dp"
105-
android:text="TStore"
106-
/>
147+
android:text="TStore" />
107148
<LinearLayout
108149
android:orientation="horizontal"
109150
android:layout_width="match_parent"
110-
android:layout_height="wrap_content">
151+
android:layout_height="wrap_content"
152+
android:weightSum="10.0">
111153
<Button
112154
android:layout_width="wrap_content"
113155
android:layout_height="wrap_content"
114156
android:text="@string/lbl_check_app_installed"
157+
android:layout_weight="2.5"
158+
android:ellipsize="middle"
115159
android:id="@+id/tstore_button_01"
116160
style="@style/Base.TextAppearance.AppCompat.Small"/>
117161

118162
<Button
119163
android:layout_width="wrap_content"
120164
android:layout_height="wrap_content"
121165
android:text="@string/lbl_open_app"
166+
android:layout_weight="2.5"
167+
android:ellipsize="middle"
122168
android:id="@+id/tstore_button_02"
123169
style="@style/Base.TextAppearance.AppCompat.Small"/>
124170

125171
<Button
126172
android:layout_width="wrap_content"
127173
android:layout_height="wrap_content"
128174
android:text="@string/lbl_open_publisher_apps"
175+
android:layout_weight="2.5"
176+
android:ellipsize="middle"
129177
android:id="@+id/tstore_button_03"
130178
style="@style/Base.TextAppearance.AppCompat.Small"/>
131179

132180
<Button
133181
android:layout_width="wrap_content"
134182
android:layout_height="wrap_content"
135183
android:text="@string/lbl_search_app"
184+
android:layout_weight="2.5"
185+
android:ellipsize="middle"
136186
android:id="@+id/tstore_button_04"
137187
style="@style/Base.TextAppearance.AppCompat.Small"/>
138188

@@ -147,32 +197,41 @@
147197
<LinearLayout
148198
android:orientation="horizontal"
149199
android:layout_width="match_parent"
150-
android:layout_height="wrap_content">
200+
android:layout_height="wrap_content"
201+
android:weightSum="10.0">
151202
<Button
152203
android:layout_width="wrap_content"
153204
android:layout_height="wrap_content"
154205
android:text="@string/lbl_check_app_installed"
206+
android:layout_weight="2.5"
207+
android:ellipsize="middle"
155208
android:id="@+id/naver_button_01"
156209
style="@style/Base.TextAppearance.AppCompat.Small"/>
157210

158211
<Button
159212
android:layout_width="wrap_content"
160213
android:layout_height="wrap_content"
161214
android:text="@string/lbl_open_app"
215+
android:layout_weight="2.5"
216+
android:ellipsize="middle"
162217
android:id="@+id/naver_button_02"
163218
style="@style/Base.TextAppearance.AppCompat.Small"/>
164219

165220
<Button
166221
android:layout_width="wrap_content"
167222
android:layout_height="wrap_content"
168223
android:text="@string/lbl_open_publisher_apps"
224+
android:layout_weight="2.5"
225+
android:ellipsize="middle"
169226
android:id="@+id/naver_button_03"
170227
style="@style/Base.TextAppearance.AppCompat.Small"/>
171228

172229
<Button
173230
android:layout_width="wrap_content"
174231
android:layout_height="wrap_content"
175232
android:text="@string/lbl_search_app"
233+
android:layout_weight="2.5"
234+
android:ellipsize="middle"
176235
android:id="@+id/naver_button_04"
177236
style="@style/Base.TextAppearance.AppCompat.Small"/>
178237

Demo/src/main/res/values/strings.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
<string name="hello_world">Hello world!</string>
55
<string name="action_settings">Settings</string>
66

7-
<string name="lbl_check_app_installed">설치 확인</string>
8-
<string name="lbl_open_app">앱 열기</string>
9-
<string name="lbl_open_publisher_apps">개발사 앱 열기</string>
10-
<string name="lbl_search_app">앱 검색</string>
7+
<string name="lbl_check_app_installed">is App installed</string>
8+
9+
<string name="lbl_open_app">Open app</string>
10+
<string name="lbl_open_publisher_apps">Open publisher</string>
11+
<string name="lbl_search_app">search App</string>
12+
13+
<string name="lbl_developer_page">Open developer page</string>
14+
<string name="lbl_open_collection">Open collection</string>
1115

1216
</resources>

Library/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ publish {
55
userOrg = 'mcsong'
66
groupId = 'net.sjava'
77
artifactId = 'appstore'
8-
publishVersion = '1.0.5'
8+
publishVersion = '1.0.6'
99
desc = 'Android AppStore Library'
1010
website = 'https://github.com/mcsong/AppStoreLibrary'
1111
issueTracker = "${website}/issues"
@@ -17,20 +17,20 @@ buildscript {
1717
jcenter()
1818
}
1919
dependencies {
20-
classpath 'com.novoda:bintray-release:0.3.4'
20+
classpath 'com.novoda:bintray-release:0.5.0'
2121
}
2222
}
2323

2424
android {
25-
compileSdkVersion 24
26-
buildToolsVersion "24.0.1"
25+
compileSdkVersion 25
26+
buildToolsVersion "25.0.3"
2727

2828

2929
defaultConfig {
3030
minSdkVersion 9
31-
targetSdkVersion 24
31+
targetSdkVersion 25
3232
versionCode 1
33-
versionName "1.0.5"
33+
versionName "1.0.6"
3434
}
3535

3636
buildTypes {
@@ -62,5 +62,4 @@ android {
6262

6363
dependencies {
6464
compile fileTree(dir: 'libs', include: ['*.jar'])
65-
compile 'com.android.support:appcompat-v7:24.2.0'
6665
}

Library/src/main/java/net/sjava/appstore/PlayAppStore.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
public class PlayAppStore extends AppStore implements PublisherAppOpenable {
1616
private static final String APP_URL = "http://play.google.com/store/apps/deails?id=";
1717
private static final String APP_SEARCH_URL = "http://play.google.com/store/search?q=";
18+
private static final String APP_DEVELOPER_PAGE = "http://play.google.com/store/dev?id=";
19+
private static final String APP_COLLECTION_URL = "http://play.google.com/store/apps/collection/";
1820

1921
public static PlayAppStore newInstance() {
2022
return new PlayAppStore();
@@ -71,4 +73,34 @@ public void openPublisherApps(Context ctx, String key) {
7173
ctx.startActivity(intent);
7274
}
7375

76+
public void openDeveloperPage(Context ctx, String developerId) {
77+
if(isInstalled(ctx)) {
78+
try {
79+
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://dev?id=" + developerId));
80+
ctx.startActivity(intent);
81+
return;
82+
} catch (ActivityNotFoundException e) {
83+
// ignore
84+
}
85+
}
86+
87+
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_DEVELOPER_PAGE + developerId));
88+
ctx.startActivity(intent);
89+
}
90+
91+
public void openCollectionApps(Context ctx, String collectonName) {
92+
if(isInstalled(ctx)) {
93+
try {
94+
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://apps/collection/" + collectonName));
95+
ctx.startActivity(intent);
96+
return;
97+
} catch (ActivityNotFoundException e) {
98+
// ignore
99+
}
100+
}
101+
102+
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(APP_COLLECTION_URL + collectonName));
103+
ctx.startActivity(intent);
104+
}
105+
74106
}

0 commit comments

Comments
 (0)