Commit 9f7fa554 authored by Grigory Fedorov's avatar Grigory Fedorov

chat_viewer_item layout refactored, chat_page removed, button replaced with image button and icon.

parent 48a33eee
......@@ -14,8 +14,6 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
......@@ -36,7 +34,6 @@ public class ChatViewerFragment extends Fragment {
public static final String ARGUMENT_ACCOUNT = "ARGUMENT_ACCOUNT";
public static final String ARGUMENT_USER = "ARGUMENT_USER";
private TextView pageView;
private EditText inputView;
private ListView listView;
private ChatMessageAdapter chatMessageAdapter;
......@@ -69,27 +66,6 @@ public class ChatViewerFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
/*
Animation used to hide pages.
*/
Animation pagesHideAnimation = AnimationUtils.loadAnimation(getActivity(), R.anim.chat_page_out);
pagesHideAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
pageView.setVisibility(View.GONE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
View view = inflater.inflate(R.layout.chat_viewer_item, container, false);
chatMessageAdapter = new ChatMessageAdapter(getActivity());
......@@ -98,7 +74,6 @@ public class ChatViewerFragment extends Fragment {
listView = (ListView) view.findViewById(android.R.id.list);
listView.setAdapter(chatMessageAdapter);
pageView = (TextView) view.findViewById(R.id.chat_page);
inputView = (EditText) view.findViewById(R.id.chat_input);
view.findViewById(R.id.chat_send).setOnClickListener(
......
......@@ -12,66 +12,53 @@
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<LinearLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="4dip"
>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="4dip"
android:layout_height="wrap_content"
android:stackFromBottom="true"
android:transcriptMode="normal"
android:smoothScrollbar="false"
android:divider="@null"
android:dividerHeight="0dp"
android:layout_above="@+id/chat_input"
/>
<TextView
android:id="@+id/chat_page"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dip"
android:textSize="12sp"
android:gravity="center"
android:visibility="gone"
android:background="?android:attr/colorBackground"
android:text="@string/chat_page"
/>
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dip">
<EditText
android:id="@+id/chat_input"
android:layout_weight="1"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:imeOptions="actionSend|flagNoEnterAction"
android:cursorVisible="true"
android:hint="@string/chat_input_hint"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="5"
android:scrollbars="vertical"
android:fadingEdge="vertical"
android:focusable="true"
android:descendantFocusability="beforeDescendants"
/>
<Button
android:text="@string/chat_send"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/chat_send"
android:layout_toStartOf="@+id/chat_send" />
<ImageButton
android:id="@+id/chat_send"
android:layout_width="wrap_content"
android:layout_height="match_parent"
/>
</LinearLayout>
</LinearLayout>
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_send_white_24dp"
android:contentDescription="@string/chat_send" />
</RelativeLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment