Compare commits
5 Commits
features/S
...
89f8cbfcae
Author | SHA1 | Date | |
---|---|---|---|
89f8cbfcae | |||
4420af337d | |||
6b6543ca3f | |||
f554356af1 | |||
0fabbc73be |
@ -198,12 +198,11 @@ public abstract class AbstractSDParentActivity extends TabActivity {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getHistoryPositions(int sc_id, long timeGMTStart, long timeGMTStop)
|
public boolean getHistoryPositions(int sc_id, long timeGMTStart, long timeGMTStop) {
|
||||||
{
|
|
||||||
if(tcp == null)
|
if(tcp == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
String histSeqID = "1."+Integer.toString((int) (System.currentTimeMillis() / 1000L));
|
String histSeqID = "1."+ (int) (System.currentTimeMillis() / 1000L);
|
||||||
boolean res = tcp.Write(histSeqID,"#26#"+sc_id+"#"+timeGMTStart+"#"+timeGMTStop+"#");
|
boolean res = tcp.Write(histSeqID,"#26#"+sc_id+"#"+timeGMTStart+"#"+timeGMTStop+"#");
|
||||||
if(res)
|
if(res)
|
||||||
SM.Debug("Message [getHistoryPositions] sent to app server");
|
SM.Debug("Message [getHistoryPositions] sent to app server");
|
||||||
@ -213,8 +212,7 @@ public abstract class AbstractSDParentActivity extends TabActivity {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getRadiosList()
|
public boolean getRadiosList() {
|
||||||
{
|
|
||||||
if(tcp == null)
|
if(tcp == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import java.util.Calendar;
|
|||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -18,21 +19,23 @@ import com.safemobile.lib.Msg;
|
|||||||
import com.safemobile.lib.R;
|
import com.safemobile.lib.R;
|
||||||
import com.safemobile.lib.SM;
|
import com.safemobile.lib.SM;
|
||||||
|
|
||||||
public class ConversationGridViewAdapter extends BaseAdapter {
|
public class ConversationGridViewAdapter extends BaseAdapter
|
||||||
private final ArrayList<Msg> listMessages;
|
{
|
||||||
private final Activity activity;
|
private ArrayList<Msg> listMessages;
|
||||||
private final ArrayList<Boolean> dispatcherPositions;
|
private Activity activity;
|
||||||
private final ArrayList<Boolean> ackPositions;
|
//public String time;
|
||||||
private final Hashtable<Integer, View> hash = new Hashtable<>();
|
private ArrayList<Boolean> dispatcher_positions = new ArrayList<Boolean>();
|
||||||
|
private ArrayList<Boolean> ackPositions = new ArrayList<Boolean>();
|
||||||
|
private Hashtable<Integer, View> hash = new Hashtable<Integer, View>();
|
||||||
public ConversationGridViewAdapter(Activity activity, ArrayList<Msg> listMessages, ArrayList<Boolean> dispatcherPositions, ArrayList<Boolean> ackPositions) {
|
|
||||||
|
|
||||||
|
public ConversationGridViewAdapter(Activity activity, ArrayList<Msg> listMessages, Context context, long sc_id, int unit_type, ArrayList<Boolean> dispatcher_positions, ArrayList<Boolean> ackPositions) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.listMessages = listMessages;
|
this.listMessages = listMessages;
|
||||||
this.dispatcherPositions = dispatcherPositions;
|
this.dispatcher_positions = dispatcher_positions;
|
||||||
this.ackPositions = ackPositions;
|
this.ackPositions = ackPositions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return listMessages.size();
|
return listMessages.size();
|
||||||
@ -48,230 +51,149 @@ public class ConversationGridViewAdapter extends BaseAdapter {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ViewHolder {
|
public static class ViewHolder
|
||||||
private ImageView imgViewContact;
|
{
|
||||||
private TextView txtViewMsg;
|
public ImageView imgViewContact;
|
||||||
private TextView txtViewDateTime;
|
public TextView txtViewMsg;
|
||||||
private ImageView imgViewReceivedContact;
|
public TextView txtViewDateTime;
|
||||||
private TextView txtViewReceivedMsg;
|
public ImageView imgViewReceivedContact;
|
||||||
private TextView txtViewReceivedDateTime;
|
public TextView txtViewReceivedMsg;
|
||||||
private ImageView imageAck;
|
public TextView txtViewReceivedDateTime;
|
||||||
private TextView textViewNotACK;
|
public ImageView imageAck;
|
||||||
private LinearLayout layoutSend;
|
public TextView textViewNotACK;
|
||||||
private LinearLayout layoutReceived;
|
public LinearLayout layoutSend;
|
||||||
|
public LinearLayout layoutReceived;
|
||||||
public ImageView getImgViewContact() {
|
|
||||||
return imgViewContact;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImgViewContact(ImageView imgViewContact) {
|
|
||||||
this.imgViewContact = imgViewContact;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TextView getTxtViewMsg() {
|
|
||||||
return txtViewMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTxtViewMsg(TextView txtViewMsg) {
|
|
||||||
this.txtViewMsg = txtViewMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TextView getTxtViewDateTime() {
|
|
||||||
return txtViewDateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTxtViewDateTime(TextView txtViewDateTime) {
|
|
||||||
this.txtViewDateTime = txtViewDateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ImageView getImgViewReceivedContact() {
|
|
||||||
return imgViewReceivedContact;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImgViewReceivedContact(ImageView imgViewReceivedContact) {
|
|
||||||
this.imgViewReceivedContact = imgViewReceivedContact;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TextView getTxtViewReceivedMsg() {
|
|
||||||
return txtViewReceivedMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTxtViewReceivedMsg(TextView txtViewReceivedMsg) {
|
|
||||||
this.txtViewReceivedMsg = txtViewReceivedMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TextView getTxtViewReceivedDateTime() {
|
|
||||||
return txtViewReceivedDateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTxtViewReceivedDateTime(TextView txtViewReceivedDateTime) {
|
|
||||||
this.txtViewReceivedDateTime = txtViewReceivedDateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ImageView getImageAck() {
|
|
||||||
return imageAck;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImageAck(ImageView imageAck) {
|
|
||||||
this.imageAck = imageAck;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TextView getTextViewNotACK() {
|
|
||||||
return textViewNotACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTextViewNotACK(TextView textViewNotACK) {
|
|
||||||
this.textViewNotACK = textViewNotACK;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinearLayout getLayoutSend() {
|
|
||||||
return layoutSend;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLayoutSend(LinearLayout layoutSend) {
|
|
||||||
this.layoutSend = layoutSend;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LinearLayout getLayoutReceived() {
|
|
||||||
return layoutReceived;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLayoutReceived(LinearLayout layoutReceived) {
|
|
||||||
this.layoutReceived = layoutReceived;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
ViewHolder view;
|
ViewHolder view;
|
||||||
LayoutInflater inflater = activity.getLayoutInflater();
|
LayoutInflater inflator = activity.getLayoutInflater();
|
||||||
|
|
||||||
if (convertView == null) {
|
if(convertView==null)
|
||||||
|
{
|
||||||
view = new ViewHolder();
|
view = new ViewHolder();
|
||||||
convertView = inflater.inflate(R.layout.row_conversation, null);
|
convertView = inflator.inflate(R.layout.row_conversation, null);
|
||||||
|
|
||||||
view.setImgViewContact(convertView.findViewById(R.id.imageViewSenderIco));
|
view.imgViewContact = (ImageView) convertView.findViewById(R.id.imageViewSenderIco);
|
||||||
view.setTxtViewMsg(convertView.findViewById(R.id.textViewSendMsg));
|
view.txtViewMsg = (TextView) convertView.findViewById(R.id.textViewSendMsg);
|
||||||
view.setTxtViewDateTime(convertView.findViewById(R.id.textViewSendDate));
|
view.txtViewDateTime = (TextView) convertView.findViewById(R.id.textViewSendDate);
|
||||||
view.setImgViewReceivedContact(convertView.findViewById(R.id.imageViewReceivedIco));
|
view.imgViewReceivedContact = (ImageView) convertView.findViewById(R.id.imageViewReceivedIco);
|
||||||
view.setTxtViewReceivedMsg(convertView.findViewById(R.id.textViewReceivedMsg));
|
view.txtViewReceivedMsg = (TextView) convertView.findViewById(R.id.textViewReceivedMsg);
|
||||||
view.setTxtViewReceivedDateTime(convertView.findViewById(R.id.textViewReceivedDate));
|
view.txtViewReceivedDateTime = (TextView) convertView.findViewById(R.id.textViewReceivedDate);
|
||||||
view.setLayoutSend(convertView.findViewById(R.id.layoutSend));
|
view.layoutSend = (LinearLayout) convertView.findViewById(R.id.layoutSend);
|
||||||
view.setLayoutReceived(convertView.findViewById(R.id.layoutReceived));
|
view.layoutReceived = (LinearLayout) convertView.findViewById(R.id.layoutReceived);
|
||||||
view.setTextViewNotACK(convertView.findViewById(R.id.textViewNotACK));
|
view.textViewNotACK = (TextView) convertView.findViewById(R.id.textViewNotACKSendMsg);
|
||||||
view.setImageAck(convertView.findViewById(R.id.imageAck));
|
view.imageAck = (ImageView) convertView.findViewById(R.id.imageAck);
|
||||||
|
|
||||||
convertView.setTag(view);
|
convertView.setTag(view);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
view = (ViewHolder) convertView.getTag();
|
view = (ViewHolder) convertView.getTag();
|
||||||
}
|
}
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
hash.put(position, convertView);
|
hash.put(position, convertView);
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm MMM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm MMM-dd");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
calendar.set(Calendar.HOUR_OF_DAY,0);
|
||||||
calendar.set(Calendar.MINUTE, 0);
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
calendar.set(Calendar.SECOND, 0);
|
calendar.set(Calendar.SECOND, 0);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
if (listMessages.get(position).received.after(calendar.getTime()))
|
if(listMessages.get(position).received.after(calendar.getTime()))
|
||||||
sdf = new SimpleDateFormat("HH:mm:ss");
|
sdf = new SimpleDateFormat("HH:mm:ss");
|
||||||
else
|
else
|
||||||
sdf = new SimpleDateFormat("HH:mm MMM-dd");
|
sdf = new SimpleDateFormat("HH:mm MMM-dd");
|
||||||
|
|
||||||
|
|
||||||
view.getImgViewContact().setImageResource(R.drawable.peoplegreen_large);
|
//view.imgViewContact.setImageResource(getIcon(listMessages.get(position).from.user_type));
|
||||||
view.getTxtViewMsg().setText(listMessages.get(position).message);
|
view.imgViewContact.setImageResource(R.drawable.peoplegreen_large);
|
||||||
view.getTxtViewDateTime().setText(sdf.format(listMessages.get(position).received));
|
view.txtViewMsg.setText(listMessages.get(position).message);
|
||||||
view.getImgViewReceivedContact().setImageResource(listMessages.get(position).from.getLargeIcon());
|
view.txtViewDateTime.setText(sdf.format(listMessages.get(position).received));
|
||||||
view.getTxtViewReceivedMsg().setText(listMessages.get(position).message);
|
//view.imgViewReceivedContact.setImageResource(getIcon(listMessages.get(position).from.user_type));
|
||||||
view.getTxtViewReceivedDateTime().setText(sdf.format(listMessages.get(position).received));
|
view.imgViewReceivedContact.setImageResource(listMessages.get(position).from.getLargeIcon());
|
||||||
|
view.txtViewReceivedMsg.setText(listMessages.get(position).message);
|
||||||
if (!ackPositions.isEmpty())
|
view.txtViewReceivedDateTime.setText(sdf.format(listMessages.get(position).received));
|
||||||
switch (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0) {
|
|
||||||
case 0:
|
if(ackPositions.size() > 0)
|
||||||
// show not ack
|
switch(ackPositions.get(position) ? 1: 0) {
|
||||||
view.getTextViewNotACK().setVisibility(View.VISIBLE);
|
|
||||||
view.getImageAck().setVisibility(View.VISIBLE);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// show not ack
|
|
||||||
view.getTextViewNotACK().setVisibility(View.INVISIBLE);
|
|
||||||
view.getImageAck().setVisibility(View.INVISIBLE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new IllegalStateException("Unexpected value: " + (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (Boolean.TRUE.equals(dispatcherPositions.get(position)) ? 1 : 0) {
|
|
||||||
case 1:
|
|
||||||
view.getLayoutReceived().setVisibility(View.GONE);
|
|
||||||
view.getLayoutSend().setVisibility(View.VISIBLE);
|
|
||||||
break;
|
|
||||||
case 0:
|
case 0:
|
||||||
view.getLayoutReceived().setVisibility(View.VISIBLE);
|
// show not ack
|
||||||
view.getLayoutSend().setVisibility(View.GONE);
|
view.textViewNotACK.setVisibility(View.VISIBLE);
|
||||||
|
view.imageAck.setVisibility(View.VISIBLE);
|
||||||
break;
|
break;
|
||||||
default:
|
case 1:
|
||||||
throw new IllegalStateException("Unexpected value: " + (Boolean.TRUE.equals(dispatcherPositions.get(position)) ? 1 : 0));
|
// show not ack
|
||||||
}
|
view.textViewNotACK.setVisibility(View.INVISIBLE);
|
||||||
} catch (Exception ex) {
|
view.imageAck.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(dispatcher_positions.get(position) ? 1 : 0) {
|
||||||
|
case 1:
|
||||||
|
view.layoutReceived.setVisibility(View.GONE);
|
||||||
|
view.layoutSend.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
view.layoutReceived.setVisibility(View.VISIBLE);
|
||||||
|
view.layoutSend.setVisibility(View.GONE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
SM.Exception(ex.toString());
|
SM.Exception(ex.toString());
|
||||||
}
|
}
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setACK(String seqID) {
|
public void setACK(String seqID)
|
||||||
int position = -1;
|
{
|
||||||
int i = 0;
|
int position = -1, i=0;
|
||||||
|
|
||||||
for (Msg msg : listMessages) {
|
for(Msg msg: listMessages)
|
||||||
if (msg.seqID.equals(seqID))
|
{
|
||||||
|
if(msg.seqID.equals(seqID))
|
||||||
position = i;
|
position = i;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position > -1 && position < ackPositions.size()) {
|
if(position > -1 && position < ackPositions.size()) {
|
||||||
ackPositions.remove(position);
|
ackPositions.remove(position);
|
||||||
ackPositions.add(position, true);
|
ackPositions.add(position, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeView(String seqID) {
|
public void changeView(String seqID)
|
||||||
int position = -1;
|
{
|
||||||
int i = 0;
|
int position = -1, i=0;
|
||||||
|
|
||||||
for (Msg msg : listMessages) {
|
for(Msg msg: listMessages)
|
||||||
if (msg.seqID.equals(seqID))
|
{
|
||||||
|
if(msg.seqID.equals(seqID))
|
||||||
position = i;
|
position = i;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position != -1 && hash.size() > position) {
|
if(position != -1 && hash.size() > position)
|
||||||
|
{
|
||||||
SM.Debug("POSITON : " + position);
|
SM.Debug("POSITON : " + position);
|
||||||
View con = hash.get(position);
|
View con = hash.get(position);
|
||||||
ViewHolder view = null;
|
ViewHolder view = (ViewHolder) con.getTag();
|
||||||
if (con != null) {
|
|
||||||
view = (ViewHolder) con.getTag();
|
switch(ackPositions.get(position) ? 1 : 0)
|
||||||
}
|
{
|
||||||
|
|
||||||
switch (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0) {
|
|
||||||
case 1:
|
case 1:
|
||||||
if (view != null) {
|
view.imageAck.setVisibility(View.INVISIBLE);
|
||||||
view.getImageAck().setVisibility(View.INVISIBLE);
|
view.textViewNotACK.setVisibility(View.INVISIBLE);
|
||||||
view.getTextViewNotACK().setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
if (view != null) {
|
view.imageAck.setVisibility(View.VISIBLE);
|
||||||
view.getImageAck().setVisibility(View.VISIBLE);
|
view.textViewNotACK.setVisibility(View.VISIBLE);
|
||||||
view.getTextViewNotACK().setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
throw new IllegalStateException("Unexpected value: " + (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -17,16 +18,20 @@ import com.safemobile.lib.Msg;
|
|||||||
import com.safemobile.lib.R;
|
import com.safemobile.lib.R;
|
||||||
import com.safemobile.lib.SM;
|
import com.safemobile.lib.SM;
|
||||||
|
|
||||||
public class MessagesGridViewAdapter extends BaseAdapter {
|
public class MessagesGridViewAdapter extends BaseAdapter
|
||||||
private final ArrayList<Msg> listMessages;
|
{
|
||||||
private final Activity activity;
|
private ArrayList<Msg> listMessages;
|
||||||
|
private Activity activity;
|
||||||
public MessagesGridViewAdapter(Activity activity, ArrayList<Msg> listMessages) {
|
//public String time;
|
||||||
|
//private int[] colors = new int[] { Color.parseColor("#FFFFFF"), Color.parseColor("#D2E4FC") };
|
||||||
|
|
||||||
|
|
||||||
|
public MessagesGridViewAdapter(Activity activity, ArrayList<Msg> listMessages, Context context) {
|
||||||
super();
|
super();
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.listMessages = listMessages;
|
this.listMessages = listMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return listMessages.size();
|
return listMessages.size();
|
||||||
@ -42,58 +47,86 @@ public class MessagesGridViewAdapter extends BaseAdapter {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ViewHolder {
|
public static class ViewHolder
|
||||||
|
{
|
||||||
public ImageView imgViewContact;
|
public ImageView imgViewContact;
|
||||||
public TextView txtViewContact;
|
public TextView txtViewContact;
|
||||||
public TextView txtViewDateTime;
|
public TextView txtViewDateTime;
|
||||||
public TextView txtViewLastMsg;
|
public TextView txtViewLastMsg;
|
||||||
public LinearLayout layoutMessage;
|
public LinearLayout layoutMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
ViewHolder view;
|
ViewHolder view;
|
||||||
LayoutInflater inflator = activity.getLayoutInflater();
|
LayoutInflater inflator = activity.getLayoutInflater();
|
||||||
|
|
||||||
if (convertView == null) {
|
if(convertView==null)
|
||||||
|
{
|
||||||
view = new ViewHolder();
|
view = new ViewHolder();
|
||||||
convertView = inflator.inflate(R.layout.row_message, null);
|
convertView = inflator.inflate(R.layout.row_message, null);
|
||||||
|
|
||||||
view.imgViewContact = convertView.findViewById(R.id.imageViewContact);
|
view.imgViewContact = (ImageView) convertView.findViewById(R.id.imageViewContact);
|
||||||
view.txtViewContact = convertView.findViewById(R.id.textViewContact);
|
view.txtViewContact = (TextView) convertView.findViewById(R.id.textViewContact);
|
||||||
view.txtViewDateTime = convertView.findViewById(R.id.textViewLastDate);
|
view.txtViewDateTime = (TextView) convertView.findViewById(R.id.textViewLastDate);
|
||||||
view.txtViewLastMsg = convertView.findViewById(R.id.textViewLastMsg);
|
view.txtViewLastMsg = (TextView) convertView.findViewById(R.id.textViewLastMsg);
|
||||||
view.layoutMessage = convertView.findViewById(R.id.layoutMessage);
|
view.layoutMessage = (LinearLayout) convertView.findViewById(R.id.layoutMessage);
|
||||||
|
|
||||||
convertView.setTag(view);
|
convertView.setTag(view);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
view = (ViewHolder) convertView.getTag();
|
view = (ViewHolder) convertView.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
view.imgViewContact.setImageResource(listMessages.get(position).from.getLargeIcon());
|
view.imgViewContact.setImageResource(listMessages.get(position).from.getLargeIcon());
|
||||||
view.txtViewContact.setText(String.format("%s :", listMessages.get(position).from.name));
|
//view.imgViewContact.setImageResource(R.drawable.peopleblue);
|
||||||
if (listMessages.get(position).message.length() > 25)
|
view.txtViewContact.setText(listMessages.get(position).from.name+ " :");
|
||||||
view.txtViewLastMsg.setText(String.format("%s...", listMessages.get(position).message.substring(0, 25)));
|
if(listMessages.get(position).message.length() > 25)
|
||||||
|
view.txtViewLastMsg.setText(listMessages.get(position).message.substring(0, 25) + "...");
|
||||||
else
|
else
|
||||||
view.txtViewLastMsg.setText(listMessages.get(position).message);
|
view.txtViewLastMsg.setText(listMessages.get(position).message);
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
calendar.set(Calendar.HOUR_OF_DAY,0);
|
||||||
calendar.set(Calendar.MINUTE, 0);
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
calendar.set(Calendar.SECOND, 0);
|
calendar.set(Calendar.SECOND, 0);
|
||||||
calendar.set(Calendar.MILLISECOND, 0);
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
if (listMessages.get(position).received.after(calendar.getTime()))
|
if(listMessages.get(position).received.after(calendar.getTime()))
|
||||||
sdf = new SimpleDateFormat("HH:mm:ss");
|
sdf = new SimpleDateFormat("HH:mm:ss");
|
||||||
else
|
else
|
||||||
sdf = new SimpleDateFormat("MMM-dd HH:mm");
|
sdf = new SimpleDateFormat("MMM-dd HH:mm");
|
||||||
|
|
||||||
view.txtViewDateTime.setText(sdf.format(listMessages.get(position).received));
|
view.txtViewDateTime.setText(sdf.format(listMessages.get(position).received));
|
||||||
} catch (Exception ex) {
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
SM.Exception(ex.toString());
|
SM.Exception(ex.toString());
|
||||||
}
|
}
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIcon(int user_type, String username)
|
||||||
|
{
|
||||||
|
// if request was send by MessagesActivity -> Spinner
|
||||||
|
if(user_type == -1)
|
||||||
|
{
|
||||||
|
// get unit_type for selected username
|
||||||
|
for (Msg mes: listMessages)
|
||||||
|
{
|
||||||
|
// if user is selected
|
||||||
|
if(mes.from.name.equals(username))
|
||||||
|
{
|
||||||
|
user_type = (int) mes.from.driver_id; // save user_type
|
||||||
|
|
||||||
|
return mes.from.getLargeIcon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,215 @@
|
|||||||
|
package com.safemobile.adapters;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Hashtable;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.safemobile.lib.R;
|
||||||
|
import com.safemobile.lib.SM;
|
||||||
|
import com.safemobile.libpad.PadTextMessage;
|
||||||
|
|
||||||
|
public class PadConversationGridViewAdapter extends BaseAdapter
|
||||||
|
{
|
||||||
|
private ArrayList<PadTextMessage> listMessages;
|
||||||
|
private Activity activity;
|
||||||
|
//public String time;
|
||||||
|
private ArrayList<Boolean> outgoingPositions = new ArrayList<Boolean>();
|
||||||
|
private ArrayList<Boolean> ackPositions = new ArrayList<Boolean>();
|
||||||
|
private Hashtable<Integer, View> hash = new Hashtable<Integer, View>();
|
||||||
|
|
||||||
|
|
||||||
|
public PadConversationGridViewAdapter(Activity activity, ArrayList<PadTextMessage> listMessages, Context context, ArrayList<Boolean> outgoingPositions, ArrayList<Boolean> ackPositions) {
|
||||||
|
this.activity = activity;
|
||||||
|
this.listMessages = listMessages;
|
||||||
|
this.outgoingPositions = outgoingPositions;
|
||||||
|
this.ackPositions = ackPositions;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return listMessages.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PadTextMessage getItem(int position) {
|
||||||
|
return listMessages.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** return the list of messages in the adapter
|
||||||
|
* @return an ArrayList of PadTextMessages
|
||||||
|
*/
|
||||||
|
public ArrayList<PadTextMessage> getMessages() {
|
||||||
|
return listMessages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ViewHolder
|
||||||
|
{
|
||||||
|
public ImageView imgViewContact;
|
||||||
|
public TextView txtViewMsg;
|
||||||
|
public TextView txtViewDateTime;
|
||||||
|
public ImageView imgViewReceivedContact;
|
||||||
|
public TextView txtViewReceivedMsg;
|
||||||
|
public TextView txtViewReceivedDateTime;
|
||||||
|
public ImageView imageAck;
|
||||||
|
public TextView textViewNotACK;
|
||||||
|
public LinearLayout layoutSend;
|
||||||
|
public LinearLayout layoutReceived;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
ViewHolder view;
|
||||||
|
LayoutInflater inflator = activity.getLayoutInflater();
|
||||||
|
|
||||||
|
if(convertView==null)
|
||||||
|
{
|
||||||
|
view = new ViewHolder();
|
||||||
|
convertView = inflator.inflate(R.layout.row_conversation, null);
|
||||||
|
|
||||||
|
view.imgViewContact = (ImageView) convertView.findViewById(R.id.imageViewSenderIco);
|
||||||
|
view.txtViewMsg = (TextView) convertView.findViewById(R.id.textViewSendMsg);
|
||||||
|
view.txtViewDateTime = (TextView) convertView.findViewById(R.id.textViewSendDate);
|
||||||
|
view.imgViewReceivedContact = (ImageView) convertView.findViewById(R.id.imageViewReceivedIco);
|
||||||
|
view.txtViewReceivedMsg = (TextView) convertView.findViewById(R.id.textViewReceivedMsg);
|
||||||
|
view.txtViewReceivedDateTime = (TextView) convertView.findViewById(R.id.textViewReceivedDate);
|
||||||
|
view.layoutSend = (LinearLayout) convertView.findViewById(R.id.layoutSend);
|
||||||
|
view.layoutReceived = (LinearLayout) convertView.findViewById(R.id.layoutReceived);
|
||||||
|
view.textViewNotACK = (TextView) convertView.findViewById(R.id.textViewNotACKSendMsg);
|
||||||
|
view.imageAck = (ImageView) convertView.findViewById(R.id.imageAck);
|
||||||
|
|
||||||
|
convertView.setTag(view);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
view = (ViewHolder) convertView.getTag();
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
hash.put(position, convertView);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm MMM-dd", Locale.getDefault());
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(Calendar.HOUR_OF_DAY,0);
|
||||||
|
calendar.set(Calendar.MINUTE, 0);
|
||||||
|
calendar.set(Calendar.SECOND, 0);
|
||||||
|
calendar.set(Calendar.MILLISECOND, 0);
|
||||||
|
|
||||||
|
Date date = new Date(listMessages.get(position).timeGMT * 1000);
|
||||||
|
|
||||||
|
if(date.after(calendar.getTime()))
|
||||||
|
sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
||||||
|
else
|
||||||
|
sdf = new SimpleDateFormat("HH:mm MMM-dd", Locale.getDefault());
|
||||||
|
|
||||||
|
// set gmt time
|
||||||
|
//sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||||
|
|
||||||
|
//view.imgViewContact.setImageResource(getIcon(listMessages.get(position).from.user_type));
|
||||||
|
view.imgViewContact.setImageResource(R.drawable.peoplegreen_large);
|
||||||
|
view.txtViewMsg.setText(listMessages.get(position).message);
|
||||||
|
view.txtViewDateTime.setText(sdf.format(date));
|
||||||
|
//view.imgViewReceivedContact.setImageResource(getIcon(listMessages.get(position).from.user_type));
|
||||||
|
view.imgViewReceivedContact.setImageResource(R.drawable.peopleblue_large);
|
||||||
|
view.txtViewReceivedMsg.setText(listMessages.get(position).message);
|
||||||
|
|
||||||
|
view.txtViewReceivedDateTime.setText(sdf.format(date));
|
||||||
|
|
||||||
|
if(ackPositions.size() > 0)
|
||||||
|
switch(ackPositions.get(position) ? 1: 0) {
|
||||||
|
case 0:
|
||||||
|
// show not ack
|
||||||
|
view.textViewNotACK.setVisibility(View.VISIBLE);
|
||||||
|
view.imageAck.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// show not ack
|
||||||
|
view.textViewNotACK.setVisibility(View.INVISIBLE);
|
||||||
|
view.imageAck.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(outgoingPositions.get(position) ? 1 : 0) {
|
||||||
|
case 1:
|
||||||
|
view.layoutReceived.setVisibility(View.GONE);
|
||||||
|
view.layoutSend.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
view.layoutReceived.setVisibility(View.VISIBLE);
|
||||||
|
view.layoutSend.setVisibility(View.GONE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
SM.Exception(ex.toString());
|
||||||
|
}
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public void setACK(String seqID)
|
||||||
|
{
|
||||||
|
int position = -1, i=0;
|
||||||
|
|
||||||
|
for(Msg msg: listMessages)
|
||||||
|
{
|
||||||
|
if(msg.seqID.equals(seqID))
|
||||||
|
position = i;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
ackPositions.remove(position);
|
||||||
|
ackPositions.add(position, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void changeView(String seqID)
|
||||||
|
{
|
||||||
|
int position = -1, i=0;
|
||||||
|
|
||||||
|
for(Msg msg: listMessages)
|
||||||
|
{
|
||||||
|
if(msg.seqID.equals(seqID))
|
||||||
|
position = i;
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(position != -1 && hash.size() > position)
|
||||||
|
{
|
||||||
|
SM.Debug("POSITON : " + position);
|
||||||
|
View con = hash.get(position);
|
||||||
|
ViewHolder view = (ViewHolder) con.getTag();
|
||||||
|
|
||||||
|
switch(ackPositions.get(position) ? 1 : 0)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
view.imageAck.setVisibility(View.INVISIBLE);
|
||||||
|
view.textViewNotACK.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
view.imageAck.setVisibility(View.VISIBLE);
|
||||||
|
view.textViewNotACK.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
@ -1,14 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:orientation="vertical"
|
||||||
android:orientation="vertical"
|
android:background="#ffffff"
|
||||||
android:background="#ffffff"
|
android:paddingTop="5dp"
|
||||||
android:paddingTop="5dp"
|
android:paddingBottom="5dp">
|
||||||
android:paddingBottom="5dp">
|
<LinearLayout
|
||||||
<LinearLayout
|
android:id="@+id/layoutSend"
|
||||||
android:id="@+id/layoutSend"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:paddingRight="13dp"
|
android:paddingRight="13dp"
|
||||||
@ -20,151 +19,147 @@
|
|||||||
android:background="#ffffff"
|
android:background="#ffffff"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:layout_weight="0">
|
android:layout_weight="0">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageViewSenderIco"
|
android:id="@+id/imageViewSenderIco"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ambulance_large"
|
android:src="@drawable/ambulance_large"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:background="#ffffff"
|
android:background="#ffffff"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:layout_weight="0" />
|
android:layout_weight="0" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:background="@layout/row_conversation_style_send"
|
android:background="@layout/row_conversation_style_send"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_weight="1" >
|
android:layout_weight="1" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textViewSendMsg"
|
android:id="@+id/textViewSendMsg"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Medium Text"
|
android:text="Medium Text"
|
||||||
android:textColor="#000000"
|
android:textColor="#000000"
|
||||||
android:textSize="16dp" />
|
android:textSize="16dp" />
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageAck"
|
android:id="@+id/imageAckSendMsg"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
android:src="@drawable/exclamation_small"
|
android:src="@drawable/exclamation_small"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"/>
|
||||||
tools:ignore="DuplicateIds" />
|
<TextView
|
||||||
<TextView
|
android:id="@+id/textViewNotACKSendMsg"
|
||||||
android:id="@+id/textViewNotACK"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:text="@string/notAck"
|
||||||
android:text="@string/notAck"
|
android:textColor="#000000"
|
||||||
android:textColor="#000000"
|
android:textSize="13dp"
|
||||||
android:textSize="13dp"
|
android:layout_toRightOf="@+id/imageAck"
|
||||||
android:layout_toRightOf="@+id/imageAck"
|
android:visibility="invisible" />
|
||||||
android:visibility="invisible"
|
<TextView
|
||||||
tools:ignore="DuplicateIds" />
|
android:id="@+id/textViewSendDate"
|
||||||
<TextView
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/textViewSendDate"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_gravity="right"
|
||||||
android:layout_height="wrap_content"
|
android:text="Small Text"
|
||||||
android:layout_gravity="right"
|
android:textColor="#4c4c4c"
|
||||||
android:text="Small Text"
|
android:textSize="13dp"
|
||||||
android:textColor="#4c4c4c"
|
android:layout_alignParentRight="true"/>
|
||||||
android:textSize="13dp"
|
</RelativeLayout>
|
||||||
android:layout_alignParentRight="true"/>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:paddingLeft="13dp"
|
android:paddingLeft="13dp"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:id="@+id/layoutReceived">
|
android:id="@+id/layoutReceived">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:background="@layout/row_conversation_style_rec"
|
android:background="@layout/row_conversation_style_rec"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_weight="1" >
|
android:layout_weight="1" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textViewReceivedMsg"
|
android:id="@+id/textViewReceivedMsg"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Medium Text"
|
android:text="Medium Text"
|
||||||
android:textColor="#000000"
|
android:textColor="#000000"
|
||||||
android:textSize="16dp" />
|
android:textSize="16dp" />
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageAck"
|
android:id="@+id/imageAckReceiveMsg"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
android:src="@drawable/exclamation_small"
|
android:src="@drawable/exclamation_small"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"/>
|
||||||
tools:ignore="DuplicateIds" />
|
<TextView
|
||||||
<TextView
|
android:id="@+id/textViewNotACKReceiveMsg"
|
||||||
android:id="@+id/textViewNotACK"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:text="@string/notAck"
|
||||||
android:text="@string/notAck"
|
android:textColor="#000000"
|
||||||
android:textColor="#000000"
|
android:textSize="13dp"
|
||||||
android:textSize="13dp"
|
android:layout_toRightOf="@+id/imageAck"
|
||||||
android:layout_toRightOf="@+id/imageAck"
|
android:visibility="invisible"/>
|
||||||
android:visibility="invisible"
|
<TextView
|
||||||
tools:ignore="DuplicateIds" />
|
android:id="@+id/textViewReceivedDate"
|
||||||
<TextView
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/textViewReceivedDate"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_gravity="right"
|
||||||
android:layout_height="wrap_content"
|
android:text="Small Text"
|
||||||
android:layout_gravity="right"
|
android:textColor="#4c4c4c"
|
||||||
android:text="Small Text"
|
android:textSize="13dp"
|
||||||
android:textColor="#4c4c4c"
|
android:layout_alignParentRight="true"/>
|
||||||
android:textSize="13dp"
|
</RelativeLayout>
|
||||||
android:layout_alignParentRight="true"/>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
<LinearLayout
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:background="#ffffff"
|
android:background="#ffffff"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_weight="0">
|
android:layout_weight="0">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageViewReceivedIco"
|
android:id="@+id/imageViewReceivedIco"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:src="@drawable/error"
|
android:src="@drawable/error"
|
||||||
android:background="#ffffff"
|
android:background="#ffffff"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -1,17 +1,30 @@
|
|||||||
package com.safemobile.dispatch;
|
package com.safemobile.dispatch;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.util.Log;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
import com.google.android.gms.maps.GoogleMap;
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
|
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||||
import com.google.android.gms.maps.SupportMapFragment;
|
import com.google.android.gms.maps.SupportMapFragment;
|
||||||
|
import com.google.android.gms.maps.model.BitmapDescriptor;
|
||||||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||||||
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
|
import com.google.android.gms.maps.model.MarkerOptions;
|
||||||
|
import com.google.android.gms.maps.model.Polyline;
|
||||||
|
import com.google.android.gms.maps.model.PolylineOptions;
|
||||||
import com.safemobile.lib.AppParams;
|
import com.safemobile.lib.AppParams;
|
||||||
|
import com.safemobile.lib.HistPos;
|
||||||
|
import com.safemobile.lib.OperationCodes;
|
||||||
import com.safemobile.lib.SM;
|
import com.safemobile.lib.SM;
|
||||||
import com.safemobile.lib.Vehicle;
|
import com.safemobile.lib.Vehicle;
|
||||||
|
|
||||||
@ -21,7 +34,7 @@ import java.util.Calendar;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class HistoryActivity extends AppCompatActivity {
|
public class HistoryActivity extends AppCompatActivity implements OnMapReadyCallback {
|
||||||
|
|
||||||
public Bundle savedInstanceState;
|
public Bundle savedInstanceState;
|
||||||
private TabLayoutActivity parentTab;
|
private TabLayoutActivity parentTab;
|
||||||
@ -29,6 +42,9 @@ public class HistoryActivity extends AppCompatActivity {
|
|||||||
private Spinner spinnerVehicle;
|
private Spinner spinnerVehicle;
|
||||||
private ImageView changeMapType, checkTraffic, slideLayoutImage;
|
private ImageView changeMapType, checkTraffic, slideLayoutImage;
|
||||||
private LinearLayout layoutTraffic, slidelayout, layoutVehicles;
|
private LinearLayout layoutTraffic, slidelayout, layoutVehicles;
|
||||||
|
private Button displayButton;
|
||||||
|
private Date startDate, endDate;
|
||||||
|
private final Handler myHandler = new Handler();
|
||||||
|
|
||||||
private ArrayList<Vehicle> allVehicle = new ArrayList<>();
|
private ArrayList<Vehicle> allVehicle = new ArrayList<>();
|
||||||
private ArrayList<String> allVehicleNames = new ArrayList<>();
|
private ArrayList<String> allVehicleNames = new ArrayList<>();
|
||||||
@ -47,9 +63,9 @@ public class HistoryActivity extends AppCompatActivity {
|
|||||||
Locale locale = new Locale(AppParams.LANGUAGETMP);
|
Locale locale = new Locale(AppParams.LANGUAGETMP);
|
||||||
Locale.setDefault(locale);
|
Locale.setDefault(locale);
|
||||||
|
|
||||||
googleMap = parentTab.liveActivity.getMap();
|
|
||||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.map);
|
.findFragmentById(R.id.map);
|
||||||
|
mapFragment.getMapAsync(this);
|
||||||
|
|
||||||
spinnerVehicle = findViewById(R.id.spinnerVehicle);
|
spinnerVehicle = findViewById(R.id.spinnerVehicle);
|
||||||
getVehicles();
|
getVehicles();
|
||||||
@ -65,6 +81,23 @@ public class HistoryActivity extends AppCompatActivity {
|
|||||||
slidelayout = findViewById(R.id.slidelayout);
|
slidelayout = findViewById(R.id.slidelayout);
|
||||||
slideLayoutImage = findViewById(R.id.slideLayoutImage);
|
slideLayoutImage = findViewById(R.id.slideLayoutImage);
|
||||||
layoutVehicles = findViewById(R.id.layoutBig);
|
layoutVehicles = findViewById(R.id.layoutBig);
|
||||||
|
displayButton = findViewById(R.id.buttonDisplay);
|
||||||
|
displayButton.setOnClickListener(view -> {
|
||||||
|
googleMap.clear();
|
||||||
|
if (!AppParams.DEMO) {
|
||||||
|
parentTab.dropAllData =false;
|
||||||
|
parentTab.firstHistData = true;
|
||||||
|
parentTab.HistMsgList.clear();
|
||||||
|
parentTab.HistPosList.clear();
|
||||||
|
|
||||||
|
// request history
|
||||||
|
parentTab.executeNetworkStuff(new String[] {OperationCodes.GetHistoryPositions + "", allVehicle.get(spinnerVehicle.getSelectedItemPosition()).sc_id + "",
|
||||||
|
(startDate.getTime()/ 1000L) + "", (endDate.getTime()/ 1000L) + ""});
|
||||||
|
} else {
|
||||||
|
parentTab.demoPositionsList();
|
||||||
|
displayHistory(parentTab.demoPositions);
|
||||||
|
}
|
||||||
|
});
|
||||||
// slidelayout.setOnTouchListener((v, event) -> {
|
// slidelayout.setOnTouchListener((v, event) -> {
|
||||||
// if (showVehicle) {
|
// if (showVehicle) {
|
||||||
// layoutVehicles.setVisibility(View.GONE);
|
// layoutVehicles.setVisibility(View.GONE);
|
||||||
@ -81,11 +114,29 @@ public class HistoryActivity extends AppCompatActivity {
|
|||||||
setDate();
|
setDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void displayHistory(ArrayList<HistPos> positions) {
|
||||||
|
LatLng latLng = null;
|
||||||
|
PolylineOptions polylineOptions = new PolylineOptions();
|
||||||
|
BitmapDescriptor markerIcon = BitmapDescriptorFactory.fromResource(R.drawable.bus);
|
||||||
|
for (HistPos pos : positions) {
|
||||||
|
latLng = new LatLng(pos.lat, pos.lng);
|
||||||
|
polylineOptions.add(latLng);
|
||||||
|
|
||||||
|
googleMap.addMarker(new MarkerOptions()
|
||||||
|
.position(latLng)
|
||||||
|
.icon(markerIcon));
|
||||||
|
}
|
||||||
|
|
||||||
|
Polyline polyline1 = googleMap.addPolyline(polylineOptions);
|
||||||
|
if (latLng != null)
|
||||||
|
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14));
|
||||||
|
}
|
||||||
|
|
||||||
private void setDate() {
|
private void setDate() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
Date endDate = calendar.getTime();
|
endDate = calendar.getTime();
|
||||||
calendar.add(Calendar.DATE, -1);
|
calendar.add(Calendar.DATE, -1);
|
||||||
Date startDate = calendar.getTime();
|
startDate = calendar.getTime();
|
||||||
|
|
||||||
LinearLayout layoutStartPicker = findViewById(R.id.layoutStartPicker);
|
LinearLayout layoutStartPicker = findViewById(R.id.layoutStartPicker);
|
||||||
TextView textViewDate = findViewById(R.id.textViewStartDate);
|
TextView textViewDate = findViewById(R.id.textViewStartDate);
|
||||||
@ -144,7 +195,16 @@ public class HistoryActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Runnable UpdateMapResults = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
Log.v("updateMap", parentTab.HistPosList.toString());
|
||||||
|
SM.Debug("Do the Display");
|
||||||
|
displayHistory(parentTab.HistPosList);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public void UpdateMap() {
|
public void UpdateMap() {
|
||||||
|
myHandler.post(UpdateMapResults);
|
||||||
SM.Debug("Do the updateMAP post");
|
SM.Debug("Do the updateMAP post");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,4 +219,12 @@ public class HistoryActivity extends AppCompatActivity {
|
|||||||
public void UpdateNrPos(int size) {
|
public void UpdateNrPos(int size) {
|
||||||
SM.Debug("Do Cancelwindow");
|
SM.Debug("Do Cancelwindow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMapReady(@NonNull GoogleMap googleMap) {
|
||||||
|
this.googleMap = googleMap;
|
||||||
|
|
||||||
|
parentTab.demoPositionsList();
|
||||||
|
displayButton.performClick();
|
||||||
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,244 +1,243 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent" android:weightSum="1"
|
android:layout_height="fill_parent" android:weightSum="1"
|
||||||
android:id="@+id/layoutMain"
|
android:id="@+id/layoutMain"
|
||||||
style="?bg">
|
style="?bg">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="left"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
style="?header"
|
||||||
|
android:id="@+id/layoutHeader">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/imageViewMsg"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:gravity="left"
|
android:layout_height="fill_parent"
|
||||||
android:layout_weight="0"
|
android:src="@drawable/message"
|
||||||
android:orientation="horizontal"
|
android:paddingLeft="0dp"
|
||||||
style="?header"
|
android:layout_margin="3dp"
|
||||||
android:id="@+id/layoutHeader">
|
android:layout_weight="0" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/textMessaging"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:paddingTop="7dp"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_weight="0"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageViewMsg"
|
android:id="@+id/imageViewSeparator"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:src="@drawable/message"
|
android:layout_gravity="center_vertical"
|
||||||
android:paddingLeft="0dp"
|
android:src="@drawable/separator_white"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="2dp"
|
||||||
android:layout_weight="0" />
|
android:layout_weight="0"
|
||||||
<TextView
|
android:visibility="invisible"
|
||||||
android:id="@+id/textView1"
|
android:focusable="false" />
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/textMessaging"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingTop="7dp"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:layout_weight="0"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageViewSeparator"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:src="@drawable/separator_white"
|
|
||||||
android:layout_margin="2dp"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageViewDown"
|
|
||||||
android:layout_width="20dp"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginBottom="2dp"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:focusable="false"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:src="@drawable/arrow_menu_down" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/imageButtonAdd2"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:paddingLeft="2dp"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:background="@drawable/addmessage_selector"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textViewNew"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="New"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingTop="7dp"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/imageButtonAdd"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:paddingLeft="2dp"
|
|
||||||
android:background="@drawable/addmessage_selector"/>
|
|
||||||
|
|
||||||
<!-- android:background="@drawable/addmessage_selector" -->
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="left"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
style="?header"
|
|
||||||
android:id="@+id/layoutHeaderConversation">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_vertical">
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/imageButtonBack"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:paddingLeft="2dp"
|
|
||||||
android:background="@drawable/messageback_selector"/>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingBottom="2dp"
|
|
||||||
android:paddingRight="15dp"
|
|
||||||
android:paddingTop="3dp" >
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="0">
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageViewSelectedContact"
|
android:id="@+id/imageViewDown"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="20dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="fill_parent"
|
||||||
android:src="@drawable/ambulance_large"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_margin="3dp" />
|
android:layout_marginBottom="2dp"
|
||||||
</LinearLayout>
|
android:layout_marginTop="2dp"
|
||||||
<TextView
|
android:focusable="false"
|
||||||
android:id="@+id/textViewSelectedContact"
|
android:visibility="invisible"
|
||||||
android:layout_width="wrap_content"
|
android:src="@drawable/arrow_menu_down" />
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:text="Large Text"
|
<ImageButton
|
||||||
android:gravity="center_vertical"
|
android:id="@+id/imageButtonAdd2"
|
||||||
android:paddingLeft="3dp"
|
android:layout_width="fill_parent"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"/>
|
android:layout_weight="1"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:background="@drawable/addmessage_selector"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewNew"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="New"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:paddingTop="7dp"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/imageButtonAdd"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:background="@drawable/addmessage_selector"/>
|
||||||
|
|
||||||
|
<!-- android:background="@drawable/addmessage_selector" -->
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="left"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
style="?header"
|
||||||
|
android:id="@+id/layoutHeaderConversation">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_gravity="center_vertical">
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/imageButtonBack"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:background="@drawable/messageback_selector"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:paddingTop="3dp" >
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="0">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageViewSelectedContact"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ambulance_large"
|
||||||
|
android:layout_margin="3dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewSelectedContact"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:text="Large Text"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="3dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_weight="0"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- android:background="@drawable/addmessage_selector" -->
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/layoutConversations"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
</LinearLayout>
|
<GridView
|
||||||
|
android:id="@+id/gridView1"
|
||||||
<!-- android:background="@drawable/addmessage_selector" -->
|
android:layout_width="fill_parent"
|
||||||
</LinearLayout>
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#999999"
|
||||||
<LinearLayout
|
android:drawSelectorOnTop="false"
|
||||||
android:layout_width="fill_parent"
|
android:horizontalSpacing="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:numColumns="1"
|
||||||
android:id="@+id/layoutConversations"
|
android:verticalSpacing="1dp" >
|
||||||
android:layout_weight="1"
|
</GridView>
|
||||||
android:orientation="vertical">
|
</LinearLayout>
|
||||||
|
|
||||||
<GridView
|
<LinearLayout
|
||||||
android:id="@+id/gridView1"
|
android:id="@+id/layoutSendMsg"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="#999999"
|
android:gravity="left"
|
||||||
android:drawSelectorOnTop="false"
|
android:layout_weight="0"
|
||||||
android:horizontalSpacing="0dp"
|
android:orientation="horizontal"
|
||||||
android:numColumns="1"
|
style="?header">
|
||||||
android:verticalSpacing="1dp" >
|
<LinearLayout
|
||||||
</GridView>
|
android:layout_weight="0"
|
||||||
</LinearLayout>
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent">
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:id="@+id/layoutSendMsg"
|
android:id="@+id/textViewSendMsg"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="left"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0"
|
android:text="@string/message"
|
||||||
android:orientation="horizontal"
|
android:layout_marginLeft="5dp"
|
||||||
style="?header">
|
android:layout_marginRight="5dp"
|
||||||
<LinearLayout
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:layout_weight="0"
|
/>
|
||||||
android:layout_width="wrap_content"
|
</LinearLayout>
|
||||||
android:layout_height="fill_parent">
|
<LinearLayout
|
||||||
<TextView
|
android:layout_weight="1"
|
||||||
android:id="@+id/textView1"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_gravity="center_vertical"
|
android:paddingTop="4dp">
|
||||||
android:text="@string/message"
|
<EditText
|
||||||
android:layout_marginLeft="5dp"
|
android:id="@+id/editTextMsg"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_width="fill_parent"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:layout_height="wrap_content"
|
||||||
/>
|
android:layout_gravity="center_vertical"
|
||||||
</LinearLayout>
|
android:gravity="center_vertical"
|
||||||
<LinearLayout
|
android:inputType="text" >
|
||||||
android:layout_weight="1"
|
</EditText>
|
||||||
android:layout_width="fill_parent"
|
</LinearLayout>
|
||||||
android:layout_height="wrap_content"
|
<LinearLayout
|
||||||
android:gravity="center_vertical"
|
android:layout_weight="0"
|
||||||
android:paddingTop="4dp">
|
android:layout_width="wrap_content"
|
||||||
<EditText
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/editTextMsg"
|
android:gravity="center_vertical"
|
||||||
android:layout_width="fill_parent"
|
android:paddingTop="4dp">
|
||||||
android:layout_height="wrap_content"
|
<ImageView
|
||||||
android:layout_gravity="center_vertical"
|
android:id="@+id/imageBarcode"
|
||||||
android:gravity="center_vertical"
|
android:layout_width="wrap_content"
|
||||||
android:inputType="text"
|
android:layout_height="35dp"
|
||||||
android:autofillHints="">
|
android:src="@drawable/barcode"
|
||||||
</EditText>
|
android:paddingTop="2dp"
|
||||||
</LinearLayout>
|
android:layout_margin="3dp" />
|
||||||
<LinearLayout
|
</LinearLayout>
|
||||||
android:layout_weight="0"
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/imageButtonSend"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="4dp">
|
android:layout_weight="0"
|
||||||
<ImageView
|
android:text="@string/send"
|
||||||
android:id="@+id/imageBarcode"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_gravity="center"
|
||||||
android:layout_height="35dp"
|
android:paddingLeft="6dp"
|
||||||
android:src="@drawable/barcode"
|
android:textColor="#000000"
|
||||||
android:paddingTop="2dp"
|
style="?login"
|
||||||
android:layout_margin="3dp" />
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<Button
|
|
||||||
android:id="@+id/imageButtonSend"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:text="@string/send"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:textColor="#000000"
|
|
||||||
style="?login"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -284,14 +284,15 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:id="@+id/map"
|
android:id="@+id/map"
|
||||||
android:layout_toRightOf="@id/slidelayout"
|
android:layout_toRightOf="@id/slidelayout"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
tools:context=".HistoryActivity"
|
||||||
android:name="com.google.android.gms.maps.SupportMapFragment" />
|
android:name="com.google.android.gms.maps.SupportMapFragment" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/changeMapType"
|
android:id="@+id/changeMapType"
|
||||||
|
@ -1,241 +1,240 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent" android:weightSum="1"
|
android:layout_height="fill_parent" android:weightSum="1"
|
||||||
android:id="@+id/layoutMain"
|
android:id="@+id/layoutMain"
|
||||||
style="?bg">
|
style="?bg">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="left"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
style="?header"
|
||||||
|
android:id="@+id/layoutHeader">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:layout_width="fill_parent"
|
android:id="@+id/imageViewMsg"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:gravity="left"
|
android:layout_height="fill_parent"
|
||||||
android:layout_weight="0"
|
android:src="@drawable/message"
|
||||||
android:orientation="horizontal"
|
android:paddingLeft="5dp"
|
||||||
style="?header"
|
android:layout_margin="3dp"
|
||||||
android:id="@+id/layoutHeader">
|
android:layout_weight="0" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/textMessaging"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:paddingTop="7dp"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_weight="0"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageViewMsg"
|
android:id="@+id/imageViewSeparator"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:src="@drawable/message"
|
android:layout_gravity="center_vertical"
|
||||||
android:paddingLeft="5dp"
|
android:src="@drawable/separator_white"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="2dp"
|
||||||
android:layout_weight="0" />
|
android:layout_weight="0"
|
||||||
<TextView
|
android:visibility="invisible"
|
||||||
android:id="@+id/textView1"
|
android:focusable="false" />
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/textMessaging"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingTop="7dp"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:layout_weight="0"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageViewSeparator"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:src="@drawable/separator_white"
|
|
||||||
android:layout_margin="2dp"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageViewDown"
|
|
||||||
android:layout_width="20dp"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginBottom="2dp"
|
|
||||||
android:layout_marginTop="2dp"
|
|
||||||
android:focusable="false"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:src="@drawable/arrow_menu_down" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/imageButtonAdd2"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:paddingLeft="2dp"
|
|
||||||
android:visibility="invisible"
|
|
||||||
android:background="@drawable/addmessage_selector"/>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/imageButtonAdd"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:paddingLeft="2dp"
|
|
||||||
android:background="@drawable/addmessage_selector"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textViewNew"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="New"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingTop="7dp"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
<!-- android:background="@drawable/addmessage_selector" -->
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="left"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
style="?header"
|
|
||||||
android:id="@+id/layoutHeaderConversation">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_vertical">
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/imageButtonBack"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:paddingLeft="2dp"
|
|
||||||
android:background="@drawable/messageback_selector"/>
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingBottom="0dp"
|
|
||||||
android:paddingRight="15dp"
|
|
||||||
android:paddingTop="0dp" >
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_weight="0">
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageViewSelectedContact"
|
android:id="@+id/imageViewDown"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="20dp"
|
||||||
android:layout_height="35dp"
|
android:layout_height="fill_parent"
|
||||||
android:src="@drawable/ambulance_large"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_margin="3dp" />
|
android:layout_marginBottom="2dp"
|
||||||
</LinearLayout>
|
android:layout_marginTop="2dp"
|
||||||
<TextView
|
android:focusable="false"
|
||||||
android:id="@+id/textViewSelectedContact"
|
android:visibility="invisible"
|
||||||
android:layout_width="wrap_content"
|
android:src="@drawable/arrow_menu_down" />
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:text="Large Text"
|
<ImageButton
|
||||||
android:gravity="center_vertical"
|
android:id="@+id/imageButtonAdd2"
|
||||||
android:paddingLeft="3dp"
|
android:layout_width="fill_parent"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0"/>
|
android:layout_weight="1"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:background="@drawable/addmessage_selector"/>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/imageButtonAdd"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:background="@drawable/addmessage_selector"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewNew"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="New"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:paddingTop="7dp"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
<!-- android:background="@drawable/addmessage_selector" -->
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="left"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
style="?header"
|
||||||
|
android:id="@+id/layoutHeaderConversation">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_gravity="center_vertical">
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/imageButtonBack"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:paddingLeft="2dp"
|
||||||
|
android:background="@drawable/messageback_selector"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingBottom="0dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:paddingTop="0dp" >
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="0">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageViewSelectedContact"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:src="@drawable/ambulance_large"
|
||||||
|
android:layout_margin="3dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textViewSelectedContact"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:text="Large Text"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="3dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:layout_weight="0"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- android:background="@drawable/addmessage_selector" -->
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/layoutConversations"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
</LinearLayout>
|
<GridView
|
||||||
|
android:id="@+id/gridView1"
|
||||||
<!-- android:background="@drawable/addmessage_selector" -->
|
android:layout_width="fill_parent"
|
||||||
</LinearLayout>
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#999999"
|
||||||
<LinearLayout
|
android:drawSelectorOnTop="false"
|
||||||
android:layout_width="fill_parent"
|
android:horizontalSpacing="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:numColumns="1"
|
||||||
android:id="@+id/layoutConversations"
|
android:verticalSpacing="1dp" >
|
||||||
android:layout_weight="1"
|
</GridView>
|
||||||
android:orientation="vertical">
|
</LinearLayout>
|
||||||
|
|
||||||
<GridView
|
<LinearLayout
|
||||||
android:id="@+id/gridView1"
|
android:id="@+id/layoutSendMsg"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="#999999"
|
android:gravity="left"
|
||||||
android:drawSelectorOnTop="false"
|
android:layout_weight="0"
|
||||||
android:horizontalSpacing="0dp"
|
android:orientation="horizontal"
|
||||||
android:numColumns="1"
|
style="?header">
|
||||||
android:verticalSpacing="1dp" >
|
<LinearLayout
|
||||||
</GridView>
|
android:layout_weight="0"
|
||||||
</LinearLayout>
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="fill_parent">
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:id="@+id/layoutSendMsg"
|
android:id="@+id/textViewSendMsg"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="left"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_weight="0"
|
android:text="@string/message"
|
||||||
android:orientation="horizontal"
|
android:layout_marginLeft="5dp"
|
||||||
style="?header">
|
android:layout_marginRight="5dp"
|
||||||
<LinearLayout
|
android:textSize="18dp"
|
||||||
android:layout_weight="0"
|
/>
|
||||||
android:layout_width="wrap_content"
|
</LinearLayout>
|
||||||
android:layout_height="fill_parent">
|
<LinearLayout
|
||||||
<TextView
|
android:layout_weight="1"
|
||||||
android:id="@+id/textView1"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical"
|
||||||
android:layout_gravity="center_vertical"
|
android:paddingTop="4dp">
|
||||||
android:text="@string/message"
|
<EditText
|
||||||
android:layout_marginLeft="5dp"
|
android:id="@+id/editTextMsg"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_width="fill_parent"
|
||||||
android:textSize="18dp"
|
android:layout_height="wrap_content"
|
||||||
/>
|
android:layout_gravity="center_vertical"
|
||||||
</LinearLayout>
|
android:gravity="center_vertical"
|
||||||
<LinearLayout
|
android:inputType="text"
|
||||||
android:layout_weight="1"
|
android:maxLength="255" >
|
||||||
android:layout_width="fill_parent"
|
</EditText>
|
||||||
android:layout_height="wrap_content"
|
</LinearLayout>
|
||||||
android:gravity="center_vertical"
|
<LinearLayout
|
||||||
android:paddingTop="4dp">
|
android:layout_weight="0"
|
||||||
<EditText
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/editTextMsg"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:gravity="center_vertical"
|
||||||
android:layout_height="wrap_content"
|
android:paddingTop="4dp">
|
||||||
android:layout_gravity="center_vertical"
|
<ImageView
|
||||||
android:gravity="center_vertical"
|
android:id="@+id/imageBarcode"
|
||||||
android:inputType="text"
|
android:layout_width="wrap_content"
|
||||||
android:maxLength="255"
|
android:layout_height="35dp"
|
||||||
android:autofillHints="">
|
android:src="@drawable/barcode"
|
||||||
</EditText>
|
android:layout_margin="3dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<LinearLayout
|
<Button
|
||||||
android:layout_weight="0"
|
android:id="@+id/imageButtonSend"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:layout_weight="0"
|
||||||
android:paddingTop="4dp">
|
android:text="@string/send"
|
||||||
<ImageView
|
android:layout_marginRight="5dp"
|
||||||
android:id="@+id/imageBarcode"
|
android:layout_gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:paddingLeft="6dp"
|
||||||
android:layout_height="35dp"
|
android:textColor="#000000"
|
||||||
android:src="@drawable/barcode"
|
style="?login"/>
|
||||||
android:layout_margin="3dp" />
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
<Button
|
|
||||||
android:id="@+id/imageButtonSend"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="0"
|
|
||||||
android:text="@string/send"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:textColor="#000000"
|
|
||||||
style="?login"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Reference in New Issue
Block a user