Permalink
Browse files

V 1.0.3

  • Loading branch information...
1 parent aea6ecf commit 106c515f1663883d3d8adc547d7630acad519d6b @gongwen committed Dec 21, 2016
View
@@ -8,7 +8,7 @@
### 使用
#### Gradle:
-compile 'com.gongwen:marqueelibrary:1.0.2'
+compile 'com.gongwen:marqueelibrary:1.0.3'
#### 属性
View
@@ -26,6 +26,6 @@ dependencies {
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
- //compile project(':marqueelibrary')
- compile 'com.gongwen:marqueelibrary:1.0.2'
+ compile project(':marqueelibrary')
+// compile 'com.gongwen:marqueelibrary:1.0.2'
}
@@ -26,15 +26,15 @@ protected void onCreate(Bundle savedInstanceState) {
MarqueeView marqueeView5 = (MarqueeView) findViewById(R.id.marqueeView5);
MarqueeFactory<TextView, String> marqueeFactory1 = new NoticeMF(this);
+ marqueeView1.setMarqueeFactory(marqueeFactory1);
+ marqueeView1.startFlipping();
marqueeFactory1.setOnItemClickListener(new MarqueeFactory.OnItemClickListener<TextView, String>() {
@Override
public void onItemClickListener(MarqueeFactory.ViewHolder<TextView, String> holder) {
Toast.makeText(MainActivity.this, holder.data, Toast.LENGTH_SHORT).show();
}
});
marqueeFactory1.setData(datas);
- marqueeView1.setMarqueeFactory(marqueeFactory1);
- marqueeView1.startFlipping();
MarqueeFactory<TextView, String> marqueeFactory2 = new NoticeMF(this);
marqueeFactory2.setOnItemClickListener(new MarqueeFactory.OnItemClickListener<TextView, String>() {
@@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 24
- versionCode 102
- versionName "1.0.2"
+ versionCode 103
+ versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -35,7 +35,7 @@ publish {
userOrg = 'gongwen92' //bintray注册的用户名
groupId = 'com.gongwen' //compile引用时的第1部分groupId
artifactId = 'marqueelibrary' //compile引用时的第2部分项目名
- publishVersion = '1.0.2' //compile引用时的第3部分版本号
+ publishVersion = '1.0.3' //compile引用时的第3部分版本号
desc = 'This is the marqueeview library'
website = 'https://github.com/gongwen/MarqueeViewDemo'
}
@@ -17,6 +17,7 @@
protected List<T> mViews;
protected List<E> datas;
private boolean isOnItemClickRegistered;
+ private MarqueeView mMarqueeView;
public MarqueeFactory(Context mContext) {
this.mContext = mContext;
@@ -36,6 +37,9 @@ public void setData(List<E> datas) {
mViews.add(mView);
}
registerOnItemClick();
+ if (mMarqueeView != null) {
+ mMarqueeView.setMarqueeFactory(this);
+ }
}
public void setOnItemClickListener(OnItemClickListener<T, E> mOnItemClickListener) {
@@ -79,4 +83,8 @@ public ViewHolder(V mView, P data, int position) {
this.position = position;
}
}
+
+ public void setAttachedToMarqueeView(MarqueeView marqueeView) {
+ this.mMarqueeView = marqueeView;
+ }
}
@@ -49,6 +49,7 @@ private void init(AttributeSet attrs) {
}
public void setMarqueeFactory(MarqueeFactory factory) {
+ factory.setAttachedToMarqueeView(this);
removeAllViews();
List<View> mViews = factory.getMarqueeViews();
if (mViews != null) {

0 comments on commit 106c515

Please sign in to comment.