Improved interface for fast new chat field
This commit is contained in:
parent
c8fe3f1d98
commit
1358258d72
3 changed files with 39 additions and 7 deletions
BIN
res/drawable-hdpi/chat_fast_address_background.png
Normal file
BIN
res/drawable-hdpi/chat_fast_address_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
|
@ -55,14 +55,36 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:contentDescription="@string/content_description_cancel"
|
||||||
|
android:id="@+id/clearFastChatField"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/list_delete"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/newFastChat"
|
android:id="@+id/newFastChat"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/new_fast_chat"
|
android:hint="@string/new_fast_chat"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
|
android:background="@drawable/chat_fast_address_background"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_toLeftOf="@id/clearFastChatField"
|
||||||
|
android:paddingRight="5dp"
|
||||||
android:inputType="textEmailAddress"/>
|
android:inputType="textEmailAddress"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/chatList"
|
android:id="@+id/chatList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
||||||
private List<String> mConversations, mDrafts;
|
private List<String> mConversations, mDrafts;
|
||||||
private ListView chatList;
|
private ListView chatList;
|
||||||
private TextView edit, ok, newDiscussion;
|
private TextView edit, ok, newDiscussion;
|
||||||
|
private ImageView clearFastChat;
|
||||||
private EditText fastNewChat;
|
private EditText fastNewChat;
|
||||||
private boolean isEditMode = false;
|
private boolean isEditMode = false;
|
||||||
|
|
||||||
|
@ -63,12 +64,18 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
||||||
|
|
||||||
edit = (TextView) view.findViewById(R.id.edit);
|
edit = (TextView) view.findViewById(R.id.edit);
|
||||||
edit.setOnClickListener(this);
|
edit.setOnClickListener(this);
|
||||||
|
|
||||||
newDiscussion = (TextView) view.findViewById(R.id.newDiscussion);
|
newDiscussion = (TextView) view.findViewById(R.id.newDiscussion);
|
||||||
newDiscussion.setOnClickListener(this);
|
newDiscussion.setOnClickListener(this);
|
||||||
|
|
||||||
ok = (TextView) view.findViewById(R.id.ok);
|
ok = (TextView) view.findViewById(R.id.ok);
|
||||||
ok.setOnClickListener(this);
|
ok.setOnClickListener(this);
|
||||||
|
|
||||||
|
clearFastChat = (ImageView) view.findViewById(R.id.clearFastChatField);
|
||||||
|
clearFastChat.setOnClickListener(this);
|
||||||
|
|
||||||
fastNewChat = (EditText) view.findViewById(R.id.newFastChat);
|
fastNewChat = (EditText) view.findViewById(R.id.newFastChat);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +119,10 @@ public class ChatListFragment extends Fragment implements OnClickListener, OnIte
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
|
|
||||||
if (id == R.id.ok) {
|
if (id == R.id.clearFastChatField) {
|
||||||
|
fastNewChat.setText("");
|
||||||
|
}
|
||||||
|
else if (id == R.id.ok) {
|
||||||
edit.setVisibility(View.VISIBLE);
|
edit.setVisibility(View.VISIBLE);
|
||||||
ok.setVisibility(View.GONE);
|
ok.setVisibility(View.GONE);
|
||||||
isEditMode = false;
|
isEditMode = false;
|
||||||
|
|
Loading…
Reference in a new issue