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; ...@@ -14,8 +14,6 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView; import android.widget.AdapterView;
...@@ -36,7 +34,6 @@ public class ChatViewerFragment extends Fragment { ...@@ -36,7 +34,6 @@ public class ChatViewerFragment extends Fragment {
public static final String ARGUMENT_ACCOUNT = "ARGUMENT_ACCOUNT"; public static final String ARGUMENT_ACCOUNT = "ARGUMENT_ACCOUNT";
public static final String ARGUMENT_USER = "ARGUMENT_USER"; public static final String ARGUMENT_USER = "ARGUMENT_USER";
private TextView pageView;
private EditText inputView; private EditText inputView;
private ListView listView; private ListView listView;
private ChatMessageAdapter chatMessageAdapter; private ChatMessageAdapter chatMessageAdapter;
...@@ -69,27 +66,6 @@ public class ChatViewerFragment extends Fragment { ...@@ -69,27 +66,6 @@ public class ChatViewerFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, 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); View view = inflater.inflate(R.layout.chat_viewer_item, container, false);
chatMessageAdapter = new ChatMessageAdapter(getActivity()); chatMessageAdapter = new ChatMessageAdapter(getActivity());
...@@ -98,7 +74,6 @@ public class ChatViewerFragment extends Fragment { ...@@ -98,7 +74,6 @@ public class ChatViewerFragment extends Fragment {
listView = (ListView) view.findViewById(android.R.id.list); listView = (ListView) view.findViewById(android.R.id.list);
listView.setAdapter(chatMessageAdapter); listView.setAdapter(chatMessageAdapter);
pageView = (TextView) view.findViewById(R.id.chat_page);
inputView = (EditText) view.findViewById(R.id.chat_input); inputView = (EditText) view.findViewById(R.id.chat_input);
view.findViewById(R.id.chat_send).setOnClickListener( view.findViewById(R.id.chat_send).setOnClickListener(
......
...@@ -12,66 +12,53 @@ ...@@ -12,66 +12,53 @@
You should have received a copy of the GNU General Public License, You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/. along with this program. If not, see http://www.gnu.org/licenses/.
--> -->
<LinearLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="4dip"
> >
<RelativeLayout <ListView
android:id="@android:id/list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
> android:stackFromBottom="true"
<ListView android:transcriptMode="normal"
android:id="@android:id/list" android:smoothScrollbar="false"
android:layout_width="match_parent" android:divider="@null"
android:layout_height="match_parent" android:dividerHeight="0dp"
android:layout_weight="1" android:layout_above="@+id/chat_input"
android:padding="4dip" />
android:stackFromBottom="true"
android:transcriptMode="normal" <EditText
android:smoothScrollbar="false" android:id="@+id/chat_input"
android:divider="@null" android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:dividerHeight="0dp" android:cursorVisible="true"
/> android:hint="@string/chat_input_hint"
<TextView android:layout_width="0dp"
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:layout_height="wrap_content"
android:paddingTop="4dip"> android:maxLines="5"
<EditText android:scrollbars="vertical"
android:id="@+id/chat_input" android:fadingEdge="vertical"
android:layout_weight="1" android:focusable="true"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine" android:descendantFocusability="beforeDescendants"
android:imeOptions="actionSend|flagNoEnterAction"
android:cursorVisible="true" android:layout_alignParentLeft="true"
android:hint="@string/chat_input_hint" android:layout_alignParentStart="true"
android:layout_width="wrap_content" android:layout_alignParentBottom="true"
android:layout_height="match_parent" android:layout_toLeftOf="@+id/chat_send"
android:maxLines="5" android:layout_toStartOf="@+id/chat_send" />
android:scrollbars="vertical"
android:fadingEdge="vertical" <ImageButton
android:focusable="true" android:id="@+id/chat_send"
android:descendantFocusability="beforeDescendants" android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
<Button android:layout_alignParentBottom="true"
android:text="@string/chat_send" android:layout_alignParentRight="true"
android:id="@+id/chat_send" android:layout_alignParentEnd="true"
android:layout_width="wrap_content" android:src="@drawable/ic_send_white_24dp"
android:layout_height="match_parent" android:contentDescription="@string/chat_send" />
/>
</LinearLayout> </RelativeLayout>
</LinearLayout>
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