Added text to chat fragment
This commit is contained in:
parent
eb11ea38fb
commit
faae53581a
9 changed files with 76 additions and 24 deletions
|
@ -4,5 +4,7 @@
|
||||||
android:color="@color/text_over" />
|
android:color="@color/text_over" />
|
||||||
<item android:state_selected="true"
|
<item android:state_selected="true"
|
||||||
android:color="@color/text_selected" />
|
android:color="@color/text_selected" />
|
||||||
|
<item android:state_enabled="false"
|
||||||
|
android:color="@color/text_disabled" />
|
||||||
<item android:color="@color/text_default" />
|
<item android:color="@color/text_default" />
|
||||||
</selector>
|
</selector>
|
|
@ -56,26 +56,28 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:background="@drawable/chat_field_background">
|
android:background="@drawable/chat_field_background">
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/sendPicture"
|
android:id="@+id/sendPicture"
|
||||||
|
android:text="@string/button_send_picture"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@drawable/text_color"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:adjustViewBounds="true"
|
android:drawableTop="@drawable/chat_send_picture"
|
||||||
android:contentDescription="@string/content_description_send_message"
|
android:paddingLeft="9dp" />
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:src="@drawable/chat_send_picture" />
|
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:contentDescription="@string/content_description_send_message"
|
|
||||||
android:id="@+id/sendMessage"
|
android:id="@+id/sendMessage"
|
||||||
|
android:text="@string/button_send_message"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@drawable/text_color"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:adjustViewBounds="true"
|
android:drawableTop="@drawable/chat_send_message"
|
||||||
android:src="@drawable/chat_send_message"
|
|
||||||
android:paddingRight="15dp" />
|
android:paddingRight="15dp" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
@ -108,14 +110,32 @@
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:layout_alignParentRight="true" />
|
android:layout_alignParentRight="true" />
|
||||||
|
|
||||||
<ProgressBar
|
<LinearLayout
|
||||||
android:id="@+id/progressbar"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="15dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/cancelUpload"
|
||||||
android:layout_toLeftOf="@id/cancelUpload"
|
android:layout_toLeftOf="@id/cancelUpload"
|
||||||
android:layout_centerVertical="true"
|
android:paddingBottom="20dp"
|
||||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
android:orientation="vertical"
|
||||||
android:paddingTop="2dp" />
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/uploading_image"
|
||||||
|
android:textColor="@android:color/black"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="15dp"
|
||||||
|
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:paddingRight="2dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
android:textColor="@color/text_button"
|
android:textColor="@color/text_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:layout_weight="1"/>
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
@ -49,7 +48,6 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:layout_weight="1"/>
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
|
|
@ -290,6 +290,10 @@
|
||||||
<string name="button_micro">Micro</string>
|
<string name="button_micro">Micro</string>
|
||||||
<string name="button_speaker">Haut parleur</string>
|
<string name="button_speaker">Haut parleur</string>
|
||||||
<string name="button_options">Options</string>
|
<string name="button_options">Options</string>
|
||||||
|
|
||||||
|
<string name="button_send_message">Envoyer</string>
|
||||||
|
<string name="button_send_picture">Img</string>
|
||||||
|
<string name="uploading_image">Envoi en cours…</string>
|
||||||
|
|
||||||
<string name="share_picture_size_small">Petite</string>
|
<string name="share_picture_size_small">Petite</string>
|
||||||
<string name="share_picture_size_medium">Moyenne</string>
|
<string name="share_picture_size_medium">Moyenne</string>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<color name="text_selected">#ffcf4c29</color>
|
<color name="text_selected">#ffcf4c29</color>
|
||||||
<color name="text_over">#ffb9c4cb</color>
|
<color name="text_over">#ffb9c4cb</color>
|
||||||
<color name="text_default">#ff5b656f</color>
|
<color name="text_default">#ff5b656f</color>
|
||||||
|
<color name="text_disabled">#ffa6b3bf</color>
|
||||||
<color name="text_header">#ff7e8e9e</color>
|
<color name="text_header">#ff7e8e9e</color>
|
||||||
|
|
||||||
<color name="text_switch_selected">#ffffff</color>
|
<color name="text_switch_selected">#ffffff</color>
|
||||||
|
|
|
@ -341,6 +341,10 @@
|
||||||
<string name="button_micro">Micro</string>
|
<string name="button_micro">Micro</string>
|
||||||
<string name="button_speaker">Speaker</string>
|
<string name="button_speaker">Speaker</string>
|
||||||
<string name="button_options">Options</string>
|
<string name="button_options">Options</string>
|
||||||
|
|
||||||
|
<string name="button_send_message">Send</string>
|
||||||
|
<string name="button_send_picture">Pic</string>
|
||||||
|
<string name="uploading_image">Uploading…</string>
|
||||||
|
|
||||||
<string name="share_picture_size_small">Small</string>
|
<string name="share_picture_size_small">Small</string>
|
||||||
<string name="share_picture_size_medium">Medium</string>
|
<string name="share_picture_size_medium">Medium</string>
|
||||||
|
|
|
@ -58,6 +58,8 @@ import android.os.Parcelable;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -94,8 +96,8 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
private View view;
|
private View view;
|
||||||
private String sipUri;
|
private String sipUri;
|
||||||
private EditText message;
|
private EditText message;
|
||||||
private ImageView sendImage, cancelUpload;
|
private ImageView cancelUpload;
|
||||||
private TextView contactName;
|
private TextView sendImage, sendMessage, contactName;
|
||||||
private AvatarWithShadow contactPicture;
|
private AvatarWithShadow contactPicture;
|
||||||
private RelativeLayout messagesLayout, uploadLayout, textLayout;
|
private RelativeLayout messagesLayout, uploadLayout, textLayout;
|
||||||
private ScrollView messagesScrollView;
|
private ScrollView messagesScrollView;
|
||||||
|
@ -124,7 +126,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
contactName = (TextView) view.findViewById(R.id.contactName);
|
contactName = (TextView) view.findViewById(R.id.contactName);
|
||||||
contactPicture = (AvatarWithShadow) view.findViewById(R.id.contactPicture);
|
contactPicture = (AvatarWithShadow) view.findViewById(R.id.contactPicture);
|
||||||
|
|
||||||
ImageView sendMessage = (ImageView) view.findViewById(R.id.sendMessage);
|
sendMessage = (TextView) view.findViewById(R.id.sendMessage);
|
||||||
sendMessage.setOnClickListener(this);
|
sendMessage.setOnClickListener(this);
|
||||||
message = (EditText) view.findViewById(R.id.message);
|
message = (EditText) view.findViewById(R.id.message);
|
||||||
|
|
||||||
|
@ -135,7 +137,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
messagesScrollView = (ScrollView) view.findViewById(R.id.chatScrollView);
|
messagesScrollView = (ScrollView) view.findViewById(R.id.chatScrollView);
|
||||||
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
|
progressBar = (ProgressBar) view.findViewById(R.id.progressbar);
|
||||||
|
|
||||||
sendImage = (ImageView) view.findViewById(R.id.sendPicture);
|
sendImage = (TextView) view.findViewById(R.id.sendPicture);
|
||||||
registerForContextMenu(sendImage);
|
registerForContextMenu(sendImage);
|
||||||
sendImage.setOnClickListener(new OnClickListener() {
|
sendImage.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -165,6 +167,25 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
|
||||||
uploadServerUri = getActivity().getResources().getString(R.string.upload_url);
|
uploadServerUri = getActivity().getResources().getString(R.string.upload_url);
|
||||||
addVirtualKeyboardVisiblityListener();
|
addVirtualKeyboardVisiblityListener();
|
||||||
|
|
||||||
|
message.addTextChangedListener(new TextWatcher() {
|
||||||
|
public void afterTextChanged(Editable arg0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
|
||||||
|
{
|
||||||
|
if (message.getText().toString().equals("")) {
|
||||||
|
sendMessage.setEnabled(false);
|
||||||
|
} else {
|
||||||
|
sendMessage.setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCall.State;
|
import org.linphone.core.LinphoneCall.State;
|
||||||
import org.linphone.core.LinphoneCallParams;
|
import org.linphone.core.LinphoneCallParams;
|
||||||
import org.linphone.core.LinphoneCallStats;
|
import org.linphone.core.LinphoneCallStats;
|
||||||
import org.linphone.core.LinphoneCallStats.MediaType;
|
|
||||||
import org.linphone.core.LinphoneChatMessage;
|
import org.linphone.core.LinphoneChatMessage;
|
||||||
import org.linphone.core.LinphoneChatRoom;
|
import org.linphone.core.LinphoneChatRoom;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
|
|
|
@ -164,9 +164,12 @@ public class PreferencesFragment extends PreferencesListFragment implements EcCa
|
||||||
|
|
||||||
addEchoPrefsListener();
|
addEchoPrefsListener();
|
||||||
|
|
||||||
if (Hacks.needSoftvolume()) checkAndDisableCheckbox(R.string.pref_audio_hacks_use_galaxys_hack_key);
|
if (Hacks.needSoftvolume()) {
|
||||||
|
Log.w("Using Audio Hack");
|
||||||
|
checkAndDisableCheckbox(R.string.pref_audio_hacks_use_galaxys_hack_key);
|
||||||
|
}
|
||||||
|
|
||||||
if (!LinphoneManager.getLc().isTunnelAvailable()){
|
if (!LinphoneManager.getLc().isTunnelAvailable()) {
|
||||||
hidePreferenceCategory(R.string.pref_tunnel_key);
|
hidePreferenceCategory(R.string.pref_tunnel_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue