Skip to content

Commit ee9dbad

Browse files
guangyaoguangyao
authored andcommitted
2 parents ce02467 + b26f855 commit ee9dbad

File tree

9 files changed

+223
-38
lines changed

9 files changed

+223
-38
lines changed

android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ dependencies {
3333
compile 'com.facebook.react:react-native:+'
3434
compile 'com.google.code.gson:gson:2.3.1'
3535

36+
compile 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3'
37+
compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3'
38+
//compile 'com.dinuscxj:recyclerrefreshlayout:2.0.5'
3639
compile 'com.google.zxing:core:3.3.0'
3740
compile 'com.github.bumptech.glide:glide:3.7.0'
3841
testCompile 'junit:junit:4.12'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// ./gradlew clean build generateRelease
2+
apply plugin: 'maven'
3+
4+
def groupId = project.PUBLISH_GROUP_ID
5+
def artifactId = project.PUBLISH_ARTIFACT_ID
6+
def version = project.PUBLISH_VERSION
7+
8+
def localReleaseDest = "${buildDir}/release/${version}"
9+
10+
task androidJavadocs(type: Javadoc) {
11+
failOnError = false
12+
source = android.sourceSets.main.java.srcDirs
13+
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
14+
classpath += files(ext.androidJar)
15+
}
16+
17+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
18+
classifier = 'javadoc'
19+
from androidJavadocs.destinationDir
20+
}
21+
22+
task androidSourcesJar(type: Jar) {
23+
classifier = 'sources'
24+
from android.sourceSets.main.java.srcDirs
25+
}
26+
27+
uploadArchives {
28+
repositories.mavenDeployer {
29+
pom.groupId = groupId
30+
pom.artifactId = artifactId
31+
pom.version = version
32+
// Add other pom properties here if you want (developer details / licenses)
33+
repository(url: "file://${localReleaseDest}")
34+
}
35+
}
36+
37+
task zipRelease(type: Zip) {
38+
from localReleaseDest
39+
destinationDir buildDir
40+
archiveName "release-${version}.zip"
41+
}
42+
43+
task generateRelease {
44+
doLast {
45+
println "Release ${version} can be found at ${localReleaseDest}/"
46+
println "Release ${version} zipped can be found ${buildDir}/release-${version}.zip"
47+
}
48+
}
49+
50+
generateRelease.dependsOn(uploadArchives)
51+
generateRelease.dependsOn(zipRelease)
52+
53+
54+
artifacts {
55+
archives androidSourcesJar
56+
archives androidJavadocsJar
57+
}

android/chatinput/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ dependencies {
4444
testCompile 'junit:junit:4.12'
4545
}
4646

47-
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
47+
apply from: 'android-release-aar.gradle'
48+
//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// ./gradlew clean build generateRelease
2+
apply plugin: 'maven'
3+
4+
def groupId = project.PUBLISH_GROUP_ID
5+
def artifactId = project.PUBLISH_ARTIFACT_ID
6+
def version = project.PUBLISH_VERSION
7+
8+
def localReleaseDest = "${buildDir}/release/${version}"
9+
10+
task androidJavadocs(type: Javadoc) {
11+
failOnError = false
12+
source = android.sourceSets.main.java.srcDirs
13+
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
14+
classpath += files(ext.androidJar)
15+
}
16+
17+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
18+
classifier = 'javadoc'
19+
from androidJavadocs.destinationDir
20+
}
21+
22+
task androidSourcesJar(type: Jar) {
23+
classifier = 'sources'
24+
from android.sourceSets.main.java.srcDirs
25+
}
26+
27+
uploadArchives {
28+
repositories.mavenDeployer {
29+
pom.groupId = groupId
30+
pom.artifactId = artifactId
31+
pom.version = version
32+
// Add other pom properties here if you want (developer details / licenses)
33+
repository(url: "file://${localReleaseDest}")
34+
}
35+
}
36+
37+
task zipRelease(type: Zip) {
38+
from localReleaseDest
39+
destinationDir buildDir
40+
archiveName "release-${version}.zip"
41+
}
42+
43+
task generateRelease {
44+
doLast {
45+
println "Release ${version} can be found at ${localReleaseDest}/"
46+
println "Release ${version} zipped can be found ${buildDir}/release-${version}.zip"
47+
}
48+
}
49+
50+
generateRelease.dependsOn(uploadArchives)
51+
generateRelease.dependsOn(zipRelease)
52+
53+
54+
artifacts {
55+
archives androidSourcesJar
56+
archives androidJavadocsJar
57+
}

android/messagelist/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ dependencies {
3737
testCompile 'junit:junit:4.12'
3838
}
3939

40-
apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
40+
apply from: 'android-release-aar.gradle'
41+
//apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'

android/messagelist/src/main/java/cn/jiguang/imui/messages/viewholder/CardViewHolder.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import android.support.v7.widget.RecyclerView;
44
import android.text.TextUtils;
5+
import android.util.Log;
56
import android.view.View;
67
import android.widget.ImageView;
78
import android.widget.TextView;
89

10+
import cn.jiguang.imui.BuildConfig;
911
import cn.jiguang.imui.R;
1012
import cn.jiguang.imui.commons.models.ICard;
1113
import cn.jiguang.imui.commons.models.IMessage;
@@ -21,6 +23,7 @@ public class CardViewHolder<MESSAGE extends IMessage> extends AvatarViewHolder<M
2123
private TextView name;
2224
private TextView cardType;
2325
private TextView sessionId;
26+
private View layoutTop;
2427

2528
public CardViewHolder(RecyclerView.Adapter adapter, View itemView, boolean isSender) {
2629
super(adapter, itemView, isSender);
@@ -29,6 +32,7 @@ public CardViewHolder(RecyclerView.Adapter adapter, View itemView, boolean isSen
2932
name = (TextView) itemView.findViewById(R.id.card_name);
3033
cardType = (TextView) itemView.findViewById(R.id.card_type);
3134
sessionId = (TextView) itemView.findViewById(R.id.card_id);
35+
layoutTop = itemView.findViewById(R.id.layout_top);
3236
}
3337

3438
@Override
@@ -41,9 +45,29 @@ public void onBind(final MESSAGE message) {
4145
}
4246
name.setText(card.getName());
4347
cardType.setText(card.getCardType());
44-
sessionId.setText(card.getSessionId());
48+
// sessionId.setText(card.getSessionId());
4549
}
46-
50+
layoutTop.setOnClickListener(new View.OnClickListener() {
51+
@Override
52+
public void onClick(View v) {
53+
if (mMsgClickListener != null) {
54+
mMsgClickListener.onMessageClick(message);
55+
}
56+
}
57+
});
58+
layoutTop.setOnLongClickListener(new View.OnLongClickListener() {
59+
@Override
60+
public boolean onLongClick(View v) {
61+
if (mMsgLongClickListener != null) {
62+
mMsgLongClickListener.onMessageLongClick(message);
63+
} else {
64+
if (BuildConfig.DEBUG) {
65+
Log.w("MsgListAdapter", "Didn't set long click listener! Drop event.");
66+
}
67+
}
68+
return true;
69+
}
70+
});
4771
}
4872

4973
@Override

android/messagelist/src/main/res/layout/item_receive_card.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<LinearLayout
2626
android:layout_marginTop="@dimen/aurora_message_padding_top"
2727
android:id="@+id/item_layout"
28-
android:clickable="false"
2928
android:layout_marginLeft="@dimen/aurora_avatar_padding"
3029
android:layout_marginRight="@dimen/aurora_width_msg_avatar"
3130
android:layout_centerVertical="true"
@@ -52,19 +51,19 @@
5251
android:id="@+id/card_name"
5352
android:layout_toRightOf="@+id/card_icon"
5453
android:layout_marginTop="@dimen/red_packet_top"
54+
android:layout_centerVertical="true"
5555
android:textSize="@dimen/red_packet_comments_size"
56-
android:text="恭喜发财,大吉大利"
5756
android:lines="1"
5857
android:ellipsize="end"
5958
android:textColor="@color/black"
6059
android:layout_width="match_parent"
6160
android:layout_height="wrap_content" />
6261
<TextView
62+
android:visibility="gone"
6363
android:id="@+id/card_id"
6464
android:layout_marginTop="3dp"
6565
android:layout_toRightOf="@+id/card_icon"
6666
android:layout_below="@+id/card_name"
67-
android:text="领取红包"
6867
android:textColor="@color/black"
6968
android:textSize="@dimen/red_packet_text_size"
7069
android:layout_width="match_parent"

android/messagelist/src/main/res/layout/item_send_card.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
<LinearLayout
4242
android:id="@+id/item_layout"
43-
android:clickable="false"
4443
android:layout_marginRight="@dimen/aurora_avatar_padding"
4544
android:layout_centerVertical="true"
4645
android:layout_below="@id/aurora_tv_msgitem_display_name"
@@ -66,10 +65,10 @@
6665
android:id="@+id/card_name"
6766
android:layout_toRightOf="@+id/card_icon"
6867
android:layout_marginTop="@dimen/red_packet_top"
68+
android:layout_centerVertical="true"
6969
android:textSize="@dimen/red_packet_comments_size"
7070
android:lines="1"
7171
android:ellipsize="end"
72-
android:text="恭喜发财,大吉大利"
7372
android:textColor="@color/black"
7473
android:layout_width="match_parent"
7574
android:layout_height="wrap_content" />
@@ -78,8 +77,8 @@
7877
android:layout_marginTop="6dp"
7978
android:layout_toRightOf="@+id/card_icon"
8079
android:layout_below="@+id/card_name"
81-
android:text="领取红包"
8280
android:textColor="@color/black"
81+
android:visibility="gone"
8382
android:textSize="@dimen/red_packet_text_size"
8483
android:layout_width="match_parent"
8584
android:layout_height="wrap_content" />

0 commit comments

Comments
 (0)