Commit 0c75c04f authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge pull request #364 from filipedelimabrito/ux

UX/UI Improvements/Adjustments
parents 8aad49c4 762c38c4
......@@ -95,7 +95,7 @@ dependencies {
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:design:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:support-annotations:$rootProject.ext.supportLibraryVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintLayoutVersion"
compile 'com.android.support:multidex:1.0.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
......
......@@ -21,6 +21,7 @@ ext {
targetSdkVersion = 26
buildToolsVersion = "26.0.0"
supportLibraryVersion = "25.4.0"
constraintLayoutVersion = "1.0.2"
kotlinVersion = "1.1.3"
}
......
......@@ -46,6 +46,7 @@ dependencies {
compile "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:support-v13:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:design:$rootProject.ext.supportLibraryVersion"
compile "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintLayoutVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
......
......@@ -14,8 +14,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import chat.rocket.android.widget.R;
......@@ -23,8 +23,8 @@ public class MessageFormLayout extends LinearLayout {
protected ViewGroup composer;
private View btnExtra;
private View btnSubmit;
private ImageButton attachButton;
private ImageButton sendButton;
private ExtraActionSelectionClickListener extraActionSelectionClickListener;
private SubmitTextListener submitTextListener;
......@@ -55,18 +55,18 @@ public class MessageFormLayout extends LinearLayout {
composer = (ViewGroup) LayoutInflater.from(getContext())
.inflate(R.layout.message_composer, this, false);
btnExtra = composer.findViewById(R.id.btn_extras);
attachButton = composer.findViewById(R.id.button_attach);
btnExtra.setOnClickListener(new OnClickListener() {
attachButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
onExtraActionSelectionClick();
}
});
btnSubmit = composer.findViewById(R.id.btn_submit);
sendButton = composer.findViewById(R.id.button_send);
btnSubmit.setOnClickListener(new OnClickListener() {
sendButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String messageText = getText();
......@@ -76,11 +76,11 @@ public class MessageFormLayout extends LinearLayout {
}
});
btnSubmit.setScaleX(0);
btnSubmit.setScaleY(0);
btnSubmit.setVisibility(GONE);
sendButton.setScaleX(0);
sendButton.setScaleY(0);
sendButton.setVisibility(GONE);
ImageKeyboardEditText editText = (ImageKeyboardEditText) composer.findViewById(R.id.editor);
ImageKeyboardEditText editText = composer.findViewById(R.id.editor);
editText.addTextChangedListener(new TextWatcher() {
@Override
......@@ -94,11 +94,11 @@ public class MessageFormLayout extends LinearLayout {
@Override
public void afterTextChanged(Editable s) {
if (TextUtils.getTrimmedLength(s) > 0) {
animateHide(btnExtra);
animateShow(btnSubmit);
animateHide(attachButton);
animateShow(sendButton);
} else {
animateShow(btnExtra);
animateHide(btnSubmit);
animateShow(attachButton);
animateHide(sendButton);
}
}
});
......@@ -164,7 +164,7 @@ public class MessageFormLayout extends LinearLayout {
public void setEnabled(boolean enabled) {
getEditor().setEnabled(enabled);
composer.findViewById(R.id.btn_submit).setEnabled(enabled);
composer.findViewById(R.id.button_send).setEnabled(enabled);
}
public void setEditTextCommitContentListener(
......
......@@ -5,5 +5,5 @@
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
android:pathData="M16.5,6v11.5c0,2.21 -1.79,4 -4,4s-4,-1.79 -4,-4V5c0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5v10.5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V6H10v9.5c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5V5c0,-2.21 -1.79,-4 -4,-4S7,2.79 7,5v12.5c0,3.04 2.46,5.5 5.5,5.5s5.5,-2.46 5.5,-5.5V6h-1.5z"/>
</vector>
......@@ -2,15 +2,13 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/darker_gray" />
<solid android:color="@color/color_shadow" />
</shape>
</item>
<item android:bottom="1dp">
<item android:top="1dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<chat.rocket.android.widget.DividerView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal">
<ImageView
android:id="@+id/emoji_keyboard_toggle"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="8dp" />
<chat.rocket.android.widget.message.ImageKeyboardEditText
android:id="@+id/editor"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:inputType="textCapSentences|textMultiLine"
android:background="@null"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:padding="0dp"
android:layout_weight="1"
android:textSize="14sp"
android:hint="@string/message_composer_message_hint"
android:minLines="1"
android:maxLines="4" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/btn_extras"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="8dp"
app:srcCompat="@drawable/ic_add_circle_outline_black_24dp" />
<ImageView
android:id="@+id/btn_submit"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="8dp"
app:srcCompat="@drawable/ic_send_black_24dp" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="48dp"
android:background="@drawable/top_shadow"
tools:context="chat.rocket.android.widget.message.MessageFormLayout">
<chat.rocket.android.widget.message.ImageKeyboardEditText
android:id="@+id/editor"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:inputType="textCapSentences|textMultiLine"
android:hint="@string/message_composer_message_hint"
android:textSize="14sp"
android:minLines="1"
android:maxLines="4"
android:background="@null"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/container"
app:layout_constraintBottom_toBottomOf="parent"/>
<android.support.constraint.ConstraintLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintTop_toTopOf="@+id/editor"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@+id/editor"
app:layout_constraintBottom_toBottomOf="@+id/editor">
<ImageButton
android:id="@+id/button_attach"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="@color/color_icon_composer"
app:srcCompat="@drawable/ic_attach_file_black_24dp"
android:background="?attr/selectableItemBackgroundBorderless"/>
<ImageButton
android:id="@+id/button_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:tint="@color/color_accent"
app:srcCompat="@drawable/ic_send_black_24dp"
android:background="?attr/selectableItemBackgroundBorderless"/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color_accent">#FF2D91FA</color>
<color name="color_shadow">#FFE6E6E7</color>
<color name="color_icon_composer">#FFA8A8A8</color>
</resources>
\ No newline at end of file
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