Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bingoogolapple committed Jun 6, 2015
2 parents 87293eb + f8274da commit 24659e0
Show file tree
Hide file tree
Showing 31 changed files with 176 additions and 69 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Change Log
==========

Version 1.0.1 *(2014-6-6)*
----------------------------

- 结束上拉加载更多从以前的endRefreshing()改为endLoadingMore()
- 刷新和加载更多过程中,内容控件可接收触摸事件

Version 1.0.0 *(2014-5-28)*
----------------------------

Initial release.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:running:BGARefreshLayout-Android v1.0.0:running:
:running:BGARefreshLayout-Android v1.0.1:running:
============
>关于我<br/>
>微博:<a href="http://weibo.com/bingoogol" target="_blank">bingoogolapple</a>&nbsp;&nbsp;&nbsp;&nbsp;主页:<a href="http://www.bingoogolapple.cn" target="_blank">bingoogolapple.cn</a>&nbsp;&nbsp;&nbsp;&nbsp;邮箱:<a href="mailto:[email protected]" target="_blank">[email protected]</a>
Expand Down Expand Up @@ -44,7 +44,7 @@ dependencies {
compile 'com.android.support:recyclerview-v7:22.1.1'
// 记得添加nineoldandroids
compile 'com.nineoldandroids:library:2.4.0'
compile 'cn.bingoogolapple:bga-refreshlayout:1.0.0@aar'
compile 'cn.bingoogolapple:bga-refreshlayout:1.0.1@aar'
}
```

Expand Down Expand Up @@ -120,7 +120,7 @@ public class ModuleNameActivity extends AppCompatActivity implements BGARefreshL
// 在这里加载更多数据,或者更具产品需求实现上拉刷新也可以

// 加载完毕后在UI线程结束加载更多
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
}

}
Expand Down
6 changes: 3 additions & 3 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ dependencies {
compile 'com.android.support:recyclerview-v7:22.1.1'
// 记得添加nineoldandroids
compile 'com.nineoldandroids:library:2.4.0'
compile 'cn.bingoogolapple:bga-refreshlayout:1.0.0@aar'
// compile project(':library')
// compile 'cn.bingoogolapple:bga-refreshlayout:1.0.1@aar'
compile project(':library')


compile 'cn.bingoogolapple:bga-banner:1.0.0@aar'
compile 'cn.bingoogolapple:bga-adapter:1.0.1@aar'
compile 'cn.bingoogolapple:bga-adapter:1.0.2@aar'
compile 'cn.bingoogolapple:bga-swipeitemlayout:1.0.0@aar'
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void onBGARefreshLayoutBeginRefreshing() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -106,7 +106,7 @@ public void onBGARefreshLayoutBeginLoadingMore() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -115,7 +115,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
mAdapter.addDatas(DataEngine.loadMoreData());
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
public class MainActivity extends AppCompatActivity {
private static final String TAG = MainActivity.class.getSimpleName();
public static final int LOADING_DURATION = 3000;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void onBGARefreshLayoutBeginRefreshing() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -114,7 +114,7 @@ public void onBGARefreshLayoutBeginLoadingMore() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -123,7 +123,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
mAdapter.addDatas(DataEngine.loadMoreData());
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onBGARefreshLayoutBeginRefreshing() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -116,7 +116,7 @@ public void onBGARefreshLayoutBeginLoadingMore() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -125,7 +125,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
mAdapter.addDatas(DataEngine.loadMoreData());
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void onBGARefreshLayoutBeginRefreshing() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -75,7 +75,7 @@ public void onBGARefreshLayoutBeginLoadingMore() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -84,7 +84,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
Log.i(TAG, "上拉加载更多完成");
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import cn.bingoogolapple.refreshlayout.BGARefreshLayout;
import cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder;
import cn.bingoogolapple.refreshlayout.demo.R;
import cn.bingoogolapple.refreshlayout.demo.dialog.LoadingDialog;
import cn.bingoogolapple.refreshlayout.demo.engine.DataEngine;

/**
Expand All @@ -23,11 +24,14 @@ public class ScrollViewDemoActivity extends AppCompatActivity implements BGARefr
private static final String TAG = ScrollViewDemoActivity.class.getSimpleName();
private BGARefreshLayout mRefreshLayout;
private TextView mClickableLabelTv;
private LoadingDialog mLoadingDialog;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scrollview);
mLoadingDialog = new LoadingDialog(this);
mLoadingDialog.setMsg("正在加载中...");

initRefreshLayout();

Expand All @@ -54,10 +58,15 @@ private void initRefreshLayout() {
public void onBGARefreshLayoutBeginRefreshing() {
new AsyncTask<Void, Void, Void>() {

@Override
protected void onPreExecute() {
mLoadingDialog.show();
}

@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -66,6 +75,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mLoadingDialog.dismiss();
mRefreshLayout.endRefreshing();
mClickableLabelTv.setText("加载最新数据完成");
}
Expand All @@ -76,10 +86,15 @@ protected void onPostExecute(Void aVoid) {
public void onBGARefreshLayoutBeginLoadingMore() {
new AsyncTask<Void, Void, Void>() {

@Override
protected void onPreExecute() {
mLoadingDialog.show();
}

@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -88,7 +103,8 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mLoadingDialog.dismiss();
mRefreshLayout.endLoadingMore();
Log.i(TAG, "上拉加载更多完成");
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onBGARefreshLayoutBeginRefreshing() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -111,7 +111,7 @@ public void onBGARefreshLayoutBeginLoadingMore() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -120,7 +120,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
mAdapter.addDatas(DataEngine.loadMoreData());
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class SwipeRecyclerViewDemoActivity extends AppCompatActivity implements
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recyclerview);

initRefreshLayout();
initRecyclerView();
}
Expand Down Expand Up @@ -74,7 +73,7 @@ public void onBGARefreshLayoutBeginRefreshing() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -97,7 +96,7 @@ public void onBGARefreshLayoutBeginLoadingMore() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(2000);
Thread.sleep(MainActivity.LOADING_DURATION);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand All @@ -106,7 +105,7 @@ protected Void doInBackground(Void... params) {

@Override
protected void onPostExecute(Void aVoid) {
mRefreshLayout.endRefreshing();
mRefreshLayout.endLoadingMore();
mAdapter.addDatas(DataEngine.loadMoreData());
}
}.execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package cn.bingoogolapple.refreshlayout.demo.dialog;import android.app.Dialog;import android.content.Context;import android.graphics.drawable.AnimationDrawable;import android.widget.ImageView;import android.widget.TextView;import cn.bingoogolapple.refreshlayout.demo.R;public class LoadingDialog extends Dialog { private ImageView mProgressIv; private TextView mMsgTv; private String mMsg; private AnimationDrawable mAd; public LoadingDialog(Context context) { super(context, R.style.DialogTheme); setContentView(R.layout.dialog_loading); setCancelable(false); mProgressIv = (ImageView) findViewById(R.id.iv_loading_progress); mMsgTv = (TextView) findViewById(R.id.tv_loading_msg); mAd = (AnimationDrawable) mProgressIv.getDrawable(); } /** * 设置加载数据时的提示消息 * * @param msg */ public void setMsg(String msg) { mMsg = msg; } public void setMsg(int msgResId) { mMsg = getContext().getString(msgResId); } @Override public void show() { mMsgTv.setText(mMsg); if (!isShowing()) { super.show(); mAd.start(); } } @Override public void dismiss() { super.dismiss(); if (mAd.isRunning()) { mAd.stop(); } }}
Expand Down
42 changes: 42 additions & 0 deletions demo/src/main/res/anim/loding.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false" >

<item
android:drawable="@mipmap/loading_01"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_02"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_03"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_04"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_05"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_06"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_07"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_08"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_09"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_10"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_11"
android:duration="100"/>
<item
android:drawable="@mipmap/loading_12"
android:duration="100"/>

</animation-list>
23 changes: 23 additions & 0 deletions demo/src/main/res/layout/dialog_loading.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="260dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">

<ImageView
android:id="@+id/iv_loading_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:src="@anim/loding" />

<TextView
android:id="@+id/tv_loading_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正在加载数据..."
android:textColor="@android:color/white"
android:textSize="20sp" />

</LinearLayout>
Binary file added demo/src/main/res/mipmap-hdpi/loading_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/src/main/res/mipmap-hdpi/loading_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions demo/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
</style>

<style name="DialogTheme" parent="@android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowIsTranslucent">true</item>
<!-- 全透明 -->
<!-- <item name="android:backgroundDimEnabled">false</item> -->
</style>

</resources>
Loading

0 comments on commit 24659e0

Please sign in to comment.