Skip to content

Commit 17a8dfa

Browse files
committed
fix record && text color
1 parent 55c10c8 commit 17a8dfa

File tree

5 files changed

+59
-41
lines changed

5 files changed

+59
-41
lines changed

android/chatinput/src/main/java/cn/jiguang/imui/chatinput/ChatInputView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ private void init(Context context, AttributeSet attrs) {
164164
mChatInput.setTextColor(mStyle.getInputTextColor());
165165
mChatInput.setHintTextColor(mStyle.getInputHintColor());
166166
mChatInput.setBackgroundResource(mStyle.getInputEditTextBg());
167-
mInputMarginLeft.getLayoutParams().width = mStyle.getInputMarginLeft();
168-
mInputMarginRight.getLayoutParams().width = mStyle.getInputMarginRight();
167+
// mInputMarginLeft.getLayoutParams().width = mStyle.getInputMarginLeft();
168+
// mInputMarginRight.getLayoutParams().width = mStyle.getInputMarginRight();
169169
mVoiceBtn.setImageResource(mStyle.getVoiceBtnIcon());
170170
mVoiceBtn.setBackground(mStyle.getVoiceBtnBg());
171171
mEmojiBtn.setBackground(mStyle.getPhotoBtnBg());

android/chatinput/src/main/res/layout/view_chatinput.xml

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,52 @@
55
android:background="@color/aurora_bg_input_default"
66
android:orientation="vertical">
77

8+
<View
9+
android:layout_width="match_parent"
10+
android:layout_height="1px"
11+
android:background="@color/line_bg" />
12+
813
<LinearLayout
914
android:id="@+id/aurora_ll_input_container"
1015
android:layout_width="match_parent"
1116
android:layout_height="48dp"
12-
android:layout_marginBottom="8dp"
13-
android:layout_marginTop="8dp"
17+
android:layout_marginBottom="2dp"
18+
android:layout_marginTop="2dp"
1419
android:orientation="horizontal">
1520

1621
<android.support.v4.widget.Space
1722
android:id="@+id/aurora_input_margin_left"
18-
android:layout_width="0dp"
23+
android:layout_width="@dimen/imui_chat_space"
1924
android:layout_height="match_parent" />
2025

2126
<FrameLayout
2227
android:id="@+id/imui_layout_voice"
23-
android:layout_width="48dp"
24-
android:layout_height="48dp">
28+
android:layout_width="wrap_content"
29+
android:layout_height="match_parent">
2530

2631
<ImageButton
2732
android:id="@+id/imui_item_voice"
2833
style="@style/ChatInputIcon"
29-
android:scaleType="fitCenter"
3034
android:layout_gravity="center"
3135
android:background="@android:color/transparent"
3236
android:clickable="false"
37+
android:scaleType="fitCenter"
3338
android:src="@drawable/nim_message_button_bottom_audio_selector" />
3439
</FrameLayout>
35-
40+
<android.support.v4.widget.Space
41+
android:layout_width="@dimen/imui_chat_space"
42+
android:layout_height="match_parent" />
3643
<FrameLayout
3744
android:layout_width="0dp"
3845
android:layout_height="match_parent"
39-
android:layout_weight="1">
46+
android:layout_weight="1"
47+
android:paddingBottom="5dp"
48+
android:paddingTop="5dp">
4049

4150
<EditText
4251
android:id="@+id/imui_chat_input"
52+
android:layout_height="@dimen/imui_chat_width"
4353
android:layout_width="match_parent"
44-
android:layout_height="match_parent"
4554
android:background="@drawable/aurora_edittext_bg"
4655
android:cursorVisible="true"
4756
android:inputType="textMultiLine"
@@ -52,48 +61,51 @@
5261
android:textSize="18sp" />
5362

5463
<Button
55-
android:background="@drawable/voice_bg"
5664
android:id="@+id/imui_chat_voice"
5765
android:layout_width="match_parent"
58-
android:layout_height="match_parent"
66+
style="?android:attr/borderlessButtonStyle"
67+
android:layout_height="@dimen/imui_chat_width"
68+
android:background="@drawable/voice_bg"
5969
android:text="按住 说话"
60-
android:visibility="visible" />
70+
android:visibility="invisible" />
6171
</FrameLayout>
62-
72+
<android.support.v4.widget.Space
73+
android:layout_width="@dimen/imui_chat_space"
74+
android:layout_height="match_parent" />
6375
<FrameLayout
6476
android:id="@+id/imui_layout_emoji"
65-
android:layout_width="48dp"
66-
android:layout_height="48dp">
77+
android:layout_width="wrap_content"
78+
android:layout_height="match_parent">
6779

6880
<ImageButton
6981
android:id="@+id/imui_item_emoji"
7082
style="@style/ChatInputIcon"
71-
android:scaleType="fitCenter"
7283
android:layout_gravity="center"
7384
android:background="@android:color/transparent"
7485
android:clickable="false"
86+
android:scaleType="fitCenter"
7587
android:src="@drawable/nim_message_button_bottom_emoji_selector" />
7688
</FrameLayout>
77-
89+
<android.support.v4.widget.Space
90+
android:layout_width="@dimen/imui_chat_space"
91+
android:layout_height="match_parent" />
7892
<RelativeLayout
79-
android:layout_width="48dp"
93+
android:layout_width="wrap_content"
8094
android:layout_height="match_parent">
8195

8296
<FrameLayout
8397
android:id="@+id/imui_layout_send"
84-
android:layout_width="48dp"
98+
android:layout_width="wrap_content"
8599
android:layout_height="match_parent"
86100
android:visibility="invisible">
87101

88102
<ImageButton
89103
android:id="@+id/imui_item_send"
90-
android:layout_width="32dp"
91-
android:layout_height="32dp"
92-
android:clickable="false"
104+
style="@style/ChatInputIcon"
93105
android:layout_gravity="center"
94106
android:adjustViewBounds="true"
95107
android:background="@drawable/aurora_menuitem_send"
96-
android:scaleType="fitCenter" />
108+
android:clickable="false" />
97109

98110
<TextView
99111
android:id="@+id/imui_receive_count"
@@ -106,36 +118,40 @@
106118
android:elevation="4dp"
107119
android:ems="1"
108120
android:gravity="center"
109-
android:visibility="gone"
110121
android:maxLines="1"
111122
android:textColor="@android:color/black"
112123
android:textSize="12sp"
124+
android:visibility="gone"
113125
tools:text="11" />
114126
</FrameLayout>
115127

116128
<FrameLayout
117129
android:id="@+id/imui_layout_action"
118-
android:layout_width="48dp"
130+
android:layout_width="wrap_content"
119131
android:layout_height="match_parent">
120132

121133
<ImageButton
122134
android:id="@+id/imui_item_action"
123-
android:layout_width="32dp"
124-
android:layout_height="32dp"
135+
style="@style/ChatInputIcon"
125136
android:layout_gravity="center"
126-
android:clickable="false"
127137
android:adjustViewBounds="true"
128138
android:background="@drawable/nim_message_button_bottom_add_selector"
129-
android:scaleType="fitCenter" />
139+
android:clickable="false" />
130140
</FrameLayout>
131141
</RelativeLayout>
132142

133143
<android.support.v4.widget.Space
134144
android:id="@+id/aurora_input_margin_right"
135-
android:layout_width="0dp"
145+
android:layout_width="@dimen/imui_chat_space"
136146
android:layout_height="match_parent" />
137147
</LinearLayout>
138148

149+
<View
150+
android:visibility="gone"
151+
android:layout_width="match_parent"
152+
android:layout_height="1px"
153+
android:background="@color/line_bg" />
154+
139155
<cn.jiguang.imui.chatinput.record.ActionLayout
140156
android:id="@+id/aurora_fl_menu_container"
141157
android:layout_width="match_parent"
@@ -146,7 +162,7 @@
146162
<dowin.com.emoji.emoji.EmoticonPickerView
147163
android:id="@+id/emoticon_picker_view"
148164
android:layout_width="match_parent"
149-
android:layout_height="match_parent"/>
165+
android:layout_height="match_parent" />
150166

151167
<LinearLayout
152168
android:id="@+id/aurora_view_action_layout"

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cn.jiguang.imui.messages.viewholder;
22

3+
import android.graphics.Color;
34
import android.support.v7.widget.RecyclerView;
45
import android.text.method.LinkMovementMethod;
56
import android.text.style.ImageSpan;
@@ -70,11 +71,8 @@ public boolean onLongClick(View view) {
7071
@Override
7172
public void applyStyle(MessageListStyle style) {
7273
mMsgTv.setMaxWidth((int) (style.getWindowWidth() * style.getBubbleMaxWidth()));
73-
if (mIsSender) {
74-
mMsgTv.setLinkTextColor(style.getReceiveBubbleTextColor());
75-
} else {
76-
mMsgTv.setLinkTextColor(style.getSendBubbleTextColor());
77-
}
74+
mMsgTv.setTextSize(17);
75+
mMsgTv.setLinkTextColor(Color.rgb(173,0,151));
7876

7977
}
8078

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cn.jiguang.imui.messages.viewholder;
22

3+
import android.graphics.Color;
34
import android.graphics.drawable.AnimationDrawable;
45
import android.media.AudioManager;
56
import android.media.MediaPlayer;
@@ -222,6 +223,8 @@ public void applyStyle(MessageListStyle style) {
222223
layoutParams.width = style.getAvatarWidth();
223224
layoutParams.height = style.getAvatarHeight();
224225
mAvatarIv.setLayoutParams(layoutParams);
226+
227+
mLengthTv.setTextColor(Color.rgb(157,157,158));
225228
}
226229

227230

android/src/main/java/cn/jiguang/imui/messagelist/TimerTipView.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ void init(Context context) {
6565

6666
public void updateStatus(int level,int status,String time){
6767

68-
if (status == 0) {
69-
imageView.getDrawable().setLevel(3700 + 6300 * level / 100);
70-
}
68+
7169
if (timerStatus == 0 && !TextUtils.isEmpty(time)) {
7270
timerTipText.setText(String.format(LAST_TIME, time));
7371
}
7472
updateTextStatus(status);
7573
updateImageStatus(status);
74+
if (status == 0) {
75+
imageView.getDrawable().setLevel(3700 + 6300 * level / 100);
76+
}
7677
}
7778

7879
void updateImageStatus(int status) {

0 commit comments

Comments
 (0)