Skip to content

Commit fe4ecf1

Browse files
committed
Merge branch 'release/1.4.0'
2 parents 3559150 + b0f9140 commit fe4ecf1

37 files changed

+1379
-56
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ Change Log
22
==========
33

44

5-
Version 1.3.2 *(In development)*
5+
Version 1.4.0 *(2013-12-04)*
66
--------------------------------
7-
* ...
7+
* Implemented `ProgressListFragment` & `SherlockProgressListFragment`.
8+
* Rename `GridFragment` to `ProgressGridFragment`.
9+
* Rename `SherlockGridFragment` to `SherlockProgressGridFragment`.
810

911

1012
Version 1.3.1 *(2013-10-28)*

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ Android-ProgressFragment library is now pushed to Maven Central as a AAR, so you
8181
ProgressFragment:
8282
``` xml
8383
dependencies {
84-
compile 'com.github.johnkil.android-progressfragment:progressfragment:1.3.1'
84+
compile 'com.github.johnkil.android-progressfragment:progressfragment:1.4.0'
8585
}
8686
```
8787

8888
SherlockProgressFragment:
8989
``` xml
9090
dependencies {
91-
compile 'com.android.support:support-v4:18.0.0'
92-
compile('com.github.johnkil.android-progressfragment:sherlockprogressfragment:1.3.1') {
91+
compile 'com.android.support:support-v4:19.0.0'
92+
compile('com.github.johnkil.android-progressfragment:sherlockprogressfragment:1.4.0') {
9393
exclude module: 'support-v4'
9494
}
9595
}

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ allprojects {
2121
}
2222
}
2323

24-
// apply plugin: 'android-reporting'
24+
apply plugin: 'android-reporting'

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.3.1-SNAPSHOT
2-
VERSION_CODE=5
1+
VERSION_NAME=1.4.0-SNAPSHOT
2+
VERSION_CODE=6
33
GROUP=com.github.johnkil.android-progressfragment
44

55
POM_DESCRIPTION=Implementation of the fragment with the ability to display indeterminate progress indicator when you are waiting for the initial data

progressfragment-sample/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.devspark.progressfragment.sample"
4-
android:versionCode="5"
5-
android:versionName="1.3.1">
4+
android:versionCode="6"
5+
android:versionName="1.4.0">
66

77
<uses-sdk
88
android:minSdkVersion="4"
9-
android:targetSdkVersion="17"/>
9+
android:targetSdkVersion="19"/>
1010

1111
<application
1212
android:allowBackup="true"

progressfragment-sample/build.gradle

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ dependencies {
55
}
66

77
android {
8-
compileSdkVersion 18
9-
buildToolsVersion '18.1.0'
8+
compileSdkVersion 19
9+
buildToolsVersion '19.0.0'
10+
11+
defaultConfig {
12+
minSdkVersion 4
13+
targetSdkVersion 19
14+
}
1015

1116
sourceSets {
1217
main {

progressfragment-sample/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1212

1313
# Project target.
14-
target=android-17
14+
target=android-19
1515
android.library.reference.1=../progressfragment
1616

progressfragment-sample/res/values/strings.xml

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@
2929
</string>
3030
<string name="empty">No Data</string>
3131
<string name="loading">Loading&#8230;</string>
32+
33+
<string-array name="sweets">
34+
<item>Apple Pie</item>
35+
<item>Banana Bread</item>
36+
<item>Cupcake</item>
37+
<item>Donut</item>
38+
<item>Eclair</item>
39+
<item>Froyo</item>
40+
<item>Gingerbread</item>
41+
<item>Honeycomb</item>
42+
<item>Ice Cream Sandwich</item>
43+
<item>Jelly Bean</item>
44+
<item>KitKat</item>
45+
</string-array>
3246

3347

3448
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* Copyright (C) 2013 Evgeny Shishkin
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.devspark.progressfragment.sample;
18+
19+
import android.os.Bundle;
20+
import android.os.Handler;
21+
import android.view.Menu;
22+
import android.view.MenuInflater;
23+
import android.view.MenuItem;
24+
import android.view.View;
25+
import android.widget.ArrayAdapter;
26+
27+
import com.devspark.progressfragment.ProgressGridFragment;
28+
29+
/**
30+
* Sample implementation of {@link com.devspark.progressfragment.ProgressGridFragment}.
31+
*
32+
* @author Evgeny Shishkin
33+
*/
34+
public class DefaultProgressGridFragment extends ProgressGridFragment {
35+
private Handler mHandler;
36+
private Runnable mShowContentRunnable = new Runnable() {
37+
38+
@Override
39+
public void run() {
40+
setGridAdapter(new ArrayAdapter<String>(getActivity(),
41+
android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.sweets)));
42+
setGridShown(true);
43+
}
44+
45+
};
46+
47+
public static DefaultProgressGridFragment newInstance() {
48+
DefaultProgressGridFragment fragment = new DefaultProgressGridFragment();
49+
return fragment;
50+
}
51+
52+
@Override
53+
public void onCreate(Bundle savedInstanceState) {
54+
super.onCreate(savedInstanceState);
55+
setHasOptionsMenu(true);
56+
}
57+
58+
@Override
59+
public void onViewCreated(View view, Bundle savedInstanceState) {
60+
super.onViewCreated(view, savedInstanceState);
61+
getGridView().setNumColumns(2);
62+
}
63+
64+
@Override
65+
public void onActivityCreated(Bundle savedInstanceState) {
66+
super.onActivityCreated(savedInstanceState);
67+
// Setup text for empty content
68+
setEmptyText(R.string.empty);
69+
obtainData();
70+
}
71+
72+
@Override
73+
public void onDestroyView() {
74+
super.onDestroyView();
75+
mHandler.removeCallbacks(mShowContentRunnable);
76+
}
77+
78+
@Override
79+
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
80+
inflater.inflate(R.menu.refresh, menu);
81+
}
82+
83+
@Override
84+
public boolean onOptionsItemSelected(MenuItem item) {
85+
switch (item.getItemId()) {
86+
case R.id.menu_refresh:
87+
obtainData();
88+
return true;
89+
default:
90+
return super.onOptionsItemSelected(item);
91+
}
92+
}
93+
94+
private void obtainData() {
95+
// Show indeterminate progress
96+
setGridShown(false);
97+
98+
mHandler = new Handler();
99+
mHandler.postDelayed(mShowContentRunnable, 3000);
100+
}
101+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright (C) 2013 Evgeny Shishkin
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.devspark.progressfragment.sample;
18+
19+
import android.os.Bundle;
20+
import android.os.Handler;
21+
import android.view.Menu;
22+
import android.view.MenuInflater;
23+
import android.view.MenuItem;
24+
import android.widget.ArrayAdapter;
25+
26+
import com.devspark.progressfragment.ProgressListFragment;
27+
28+
/**
29+
* Sample implementation of {@link com.devspark.progressfragment.ProgressListFragment}.
30+
*
31+
* @author Evgeny Shishkin
32+
*/
33+
public class DefaultProgressListFragment extends ProgressListFragment {
34+
private Handler mHandler;
35+
private Runnable mShowContentRunnable = new Runnable() {
36+
37+
@Override
38+
public void run() {
39+
setListAdapter(new ArrayAdapter<String>(getActivity(),
40+
android.R.layout.simple_list_item_1, getResources().getStringArray(R.array.sweets)));
41+
setListShown(true);
42+
}
43+
44+
};
45+
46+
public static DefaultProgressListFragment newInstance() {
47+
DefaultProgressListFragment fragment = new DefaultProgressListFragment();
48+
return fragment;
49+
}
50+
51+
@Override
52+
public void onCreate(Bundle savedInstanceState) {
53+
super.onCreate(savedInstanceState);
54+
setHasOptionsMenu(true);
55+
}
56+
57+
@Override
58+
public void onActivityCreated(Bundle savedInstanceState) {
59+
super.onActivityCreated(savedInstanceState);
60+
// Setup text for empty content
61+
setEmptyText(R.string.empty);
62+
obtainData();
63+
}
64+
65+
@Override
66+
public void onDestroyView() {
67+
super.onDestroyView();
68+
mHandler.removeCallbacks(mShowContentRunnable);
69+
}
70+
71+
@Override
72+
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
73+
inflater.inflate(R.menu.refresh, menu);
74+
}
75+
76+
@Override
77+
public boolean onOptionsItemSelected(MenuItem item) {
78+
switch (item.getItemId()) {
79+
case R.id.menu_refresh:
80+
obtainData();
81+
return true;
82+
default:
83+
return super.onOptionsItemSelected(item);
84+
}
85+
}
86+
87+
private void obtainData() {
88+
// Show indeterminate progress
89+
setListShown(false);
90+
91+
mHandler = new Handler();
92+
mHandler.postDelayed(mShowContentRunnable, 3000);
93+
}
94+
}

progressfragment-sample/src/com/devspark/progressfragment/sample/MainActivity.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
public class MainActivity extends ListActivity {
3030

31-
private String[] examples = new String[]{"Default", "Empty content", "Custom layout"};
31+
private String[] examples = new String[]{"Default", "Empty content", "Custom layout", "List", "Grid"};
3232

3333
@Override
3434
protected void onCreate(Bundle savedInstanceState) {
@@ -51,6 +51,12 @@ protected void onListItemClick(ListView l, View v, int position, long id) {
5151
case 2:
5252
intent.putExtra(ProgressActivity.EXTRA_FRAGMENT, ProgressActivity.FRAGMENT_CUSTOM_LAYOUT);
5353
break;
54+
case 3:
55+
intent.putExtra(ProgressActivity.EXTRA_FRAGMENT, ProgressActivity.FRAGMENT_LIST);
56+
break;
57+
case 4:
58+
intent.putExtra(ProgressActivity.EXTRA_FRAGMENT, ProgressActivity.FRAGMENT_GRID);
59+
break;
5460
default:
5561
break;
5662
}

progressfragment-sample/src/com/devspark/progressfragment/sample/ProgressActivity.java

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class ProgressActivity extends FragmentActivity {
3333
public static final int FRAGMENT_DEFAULT = 0;
3434
public static final int FRAGMENT_EMPTY_CONTENT = 1;
3535
public static final int FRAGMENT_CUSTOM_LAYOUT = 2;
36+
public static final int FRAGMENT_LIST = 3;
37+
public static final int FRAGMENT_GRID = 4;
3638

3739
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
3840
@Override
@@ -57,6 +59,12 @@ protected void onCreate(Bundle savedInstanceState) {
5759
case FRAGMENT_CUSTOM_LAYOUT:
5860
fragment = CustomLayoutProgressFragment.newInstance();
5961
break;
62+
case FRAGMENT_LIST:
63+
fragment = DefaultProgressListFragment.newInstance();
64+
break;
65+
case FRAGMENT_GRID:
66+
fragment = DefaultProgressGridFragment.newInstance();
67+
break;
6068
default:
6169
fragment = DefaultProgressFragment.newInstance();
6270
break;

progressfragment/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.devspark.progressfragment"
4-
android:versionCode="5"
5-
android:versionName="1.3.1">
4+
android:versionCode="6"
5+
android:versionName="1.4.0">
66

77
<uses-sdk
88
android:minSdkVersion="4"
9-
android:targetSdkVersion="17"/>
9+
android:targetSdkVersion="19"/>
1010

1111
<application/>
1212

progressfragment/build.gradle

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
apply plugin: 'android-library'
22

33
dependencies {
4-
compile 'com.android.support:support-v4:18.0.0'
4+
compile 'com.android.support:support-v4:19.0.0'
55
}
66

77
android {
8-
compileSdkVersion 18
9-
buildToolsVersion '18.1.0'
8+
compileSdkVersion 19
9+
buildToolsVersion '19.0.0'
10+
11+
defaultConfig {
12+
minSdkVersion 4
13+
targetSdkVersion 19
14+
}
1015

1116
sourceSets {
1217
main {

progressfragment/project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
android.library=true
1414
# Project target.
15-
target=android-17
15+
target=android-19

0 commit comments

Comments
 (0)