merge with develop

This commit is contained in:
CiufudeanDani 2022-03-22 15:18:25 +02:00
commit 6a235d1d3f
10 changed files with 1600 additions and 1956 deletions

View File

@ -155,12 +155,12 @@ public abstract class AbstractSDParentActivity extends TabActivity {
}
public boolean sendAlarmAcknowledge(int alarm_id, int type)
public boolean sendAlarmAcknowledge(int alarm_id, int type, String unitName)
{
if(tcp == null)
return false;
boolean res = tcp.Write("0.0", "#28#" + alarm_id + "#" + type + "#");
boolean res = tcp.Write("0.0", "#28#" + alarm_id + "#" + type + "#" + AppParams.USERID + "#" + unitName + "#");
if(res)
SM.Debug("Message [sendAlarmAcknowledge] sent to app server alarm_id:" + alarm_id + " type:" + type);
else

View File

@ -6,7 +6,6 @@ import java.util.Calendar;
import java.util.Hashtable;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -19,23 +18,21 @@ import com.safemobile.lib.Msg;
import com.safemobile.lib.R;
import com.safemobile.lib.SM;
public class ConversationGridViewAdapter extends BaseAdapter
{
private ArrayList<Msg> listMessages;
private Activity activity;
//public String time;
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, Context context, long sc_id, int unit_type, ArrayList<Boolean> dispatcher_positions, ArrayList<Boolean> ackPositions) {
public class ConversationGridViewAdapter extends BaseAdapter {
private final ArrayList<Msg> listMessages;
private final Activity activity;
private final ArrayList<Boolean> dispatcherPositions;
private final ArrayList<Boolean> ackPositions;
private final Hashtable<Integer, View> hash = new Hashtable<>();
public ConversationGridViewAdapter(Activity activity, ArrayList<Msg> listMessages, ArrayList<Boolean> dispatcherPositions, ArrayList<Boolean> ackPositions) {
this.activity = activity;
this.listMessages = listMessages;
this.dispatcher_positions = dispatcher_positions;
this.ackPositions = ackPositions;
this.dispatcherPositions = dispatcherPositions;
this.ackPositions = ackPositions;
}
@Override
public int getCount() {
return listMessages.size();
@ -51,149 +48,230 @@ public class ConversationGridViewAdapter extends BaseAdapter
return 0;
}
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;
public static class ViewHolder {
private ImageView imgViewContact;
private TextView txtViewMsg;
private TextView txtViewDateTime;
private ImageView imgViewReceivedContact;
private TextView txtViewReceivedMsg;
private TextView txtViewReceivedDateTime;
private ImageView imageAck;
private TextView textViewNotACK;
private LinearLayout layoutSend;
private 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
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder view;
LayoutInflater inflator = activity.getLayoutInflater();
if(convertView==null)
{
LayoutInflater inflater = 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 = inflater.inflate(R.layout.row_conversation, null);
view.setImgViewContact(convertView.findViewById(R.id.imageViewSenderIco));
view.setTxtViewMsg(convertView.findViewById(R.id.textViewSendMsg));
view.setTxtViewDateTime(convertView.findViewById(R.id.textViewSendDate));
view.setImgViewReceivedContact(convertView.findViewById(R.id.imageViewReceivedIco));
view.setTxtViewReceivedMsg(convertView.findViewById(R.id.textViewReceivedMsg));
view.setTxtViewReceivedDateTime(convertView.findViewById(R.id.textViewReceivedDate));
view.setLayoutSend(convertView.findViewById(R.id.layoutSend));
view.setLayoutReceived(convertView.findViewById(R.id.layoutReceived));
view.setTextViewNotACK(convertView.findViewById(R.id.textViewNotACK));
view.setImageAck(convertView.findViewById(R.id.imageAck));
convertView.setTag(view);
}
else
{
} else {
view = (ViewHolder) convertView.getTag();
}
try
{
try {
hash.put(position, convertView);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm MMM-dd");
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.SECOND, 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");
else
sdf = new SimpleDateFormat("HH:mm MMM-dd");
//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(listMessages.get(position).received));
//view.imgViewReceivedContact.setImageResource(getIcon(listMessages.get(position).from.user_type));
view.imgViewReceivedContact.setImageResource(listMessages.get(position).from.getLargeIcon());
view.txtViewReceivedMsg.setText(listMessages.get(position).message);
view.txtViewReceivedDateTime.setText(sdf.format(listMessages.get(position).received));
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);
view.getImgViewContact().setImageResource(R.drawable.peoplegreen_large);
view.getTxtViewMsg().setText(listMessages.get(position).message);
view.getTxtViewDateTime().setText(sdf.format(listMessages.get(position).received));
view.getImgViewReceivedContact().setImageResource(listMessages.get(position).from.getLargeIcon());
view.getTxtViewReceivedMsg().setText(listMessages.get(position).message);
view.getTxtViewReceivedDateTime().setText(sdf.format(listMessages.get(position).received));
if (!ackPositions.isEmpty())
switch (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0) {
case 0:
// show not ack
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(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)
{
switch (Boolean.TRUE.equals(dispatcherPositions.get(position)) ? 1 : 0) {
case 1:
view.getLayoutReceived().setVisibility(View.GONE);
view.getLayoutSend().setVisibility(View.VISIBLE);
break;
case 0:
view.getLayoutReceived().setVisibility(View.VISIBLE);
view.getLayoutSend().setVisibility(View.GONE);
break;
default:
throw new IllegalStateException("Unexpected value: " + (Boolean.TRUE.equals(dispatcherPositions.get(position)) ? 1 : 0));
}
} 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))
public void setACK(String seqID) {
int position = -1;
int i = 0;
for (Msg msg : listMessages) {
if (msg.seqID.equals(seqID))
position = i;
i++;
}
if(position > -1 && position < ackPositions.size()) {
if (position > -1 && position < ackPositions.size()) {
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))
public void changeView(String seqID) {
int position = -1;
int i = 0;
for (Msg msg : listMessages) {
if (msg.seqID.equals(seqID))
position = i;
i++;
}
if(position != -1 && hash.size() > position)
{
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)
{
ViewHolder view = null;
if (con != null) {
view = (ViewHolder) con.getTag();
}
switch (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0) {
case 1:
view.imageAck.setVisibility(View.INVISIBLE);
view.textViewNotACK.setVisibility(View.INVISIBLE);
if (view != null) {
view.getImageAck().setVisibility(View.INVISIBLE);
view.getTextViewNotACK().setVisibility(View.INVISIBLE);
}
break;
case 0:
view.imageAck.setVisibility(View.VISIBLE);
view.textViewNotACK.setVisibility(View.VISIBLE);
if (view != null) {
view.getImageAck().setVisibility(View.VISIBLE);
view.getTextViewNotACK().setVisibility(View.VISIBLE);
}
break;
default:
throw new IllegalStateException("Unexpected value: " + (Boolean.TRUE.equals(ackPositions.get(position)) ? 1 : 0));
}
}
}

View File

@ -5,7 +5,6 @@ import java.util.ArrayList;
import java.util.Calendar;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -18,20 +17,16 @@ import com.safemobile.lib.Msg;
import com.safemobile.lib.R;
import com.safemobile.lib.SM;
public class MessagesGridViewAdapter extends BaseAdapter
{
private ArrayList<Msg> listMessages;
private Activity activity;
//public String time;
//private int[] colors = new int[] { Color.parseColor("#FFFFFF"), Color.parseColor("#D2E4FC") };
public MessagesGridViewAdapter(Activity activity, ArrayList<Msg> listMessages, Context context) {
public class MessagesGridViewAdapter extends BaseAdapter {
private final ArrayList<Msg> listMessages;
private final Activity activity;
public MessagesGridViewAdapter(Activity activity, ArrayList<Msg> listMessages) {
super();
this.activity = activity;
this.listMessages = listMessages;
}
@Override
public int getCount() {
return listMessages.size();
@ -47,86 +42,58 @@ public class MessagesGridViewAdapter extends BaseAdapter
return 0;
}
public static class ViewHolder
{
public static class ViewHolder {
public ImageView imgViewContact;
public TextView txtViewContact;
public TextView txtViewDateTime;
public TextView txtViewLastMsg;
public LinearLayout layoutMessage;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder view;
LayoutInflater inflator = activity.getLayoutInflater();
if(convertView==null)
{
if (convertView == null) {
view = new ViewHolder();
convertView = inflator.inflate(R.layout.row_message, null);
view.imgViewContact = (ImageView) convertView.findViewById(R.id.imageViewContact);
view.txtViewContact = (TextView) convertView.findViewById(R.id.textViewContact);
view.txtViewDateTime = (TextView) convertView.findViewById(R.id.textViewLastDate);
view.txtViewLastMsg = (TextView) convertView.findViewById(R.id.textViewLastMsg);
view.layoutMessage = (LinearLayout) convertView.findViewById(R.id.layoutMessage);
view.imgViewContact = convertView.findViewById(R.id.imageViewContact);
view.txtViewContact = convertView.findViewById(R.id.textViewContact);
view.txtViewDateTime = convertView.findViewById(R.id.textViewLastDate);
view.txtViewLastMsg = convertView.findViewById(R.id.textViewLastMsg);
view.layoutMessage = convertView.findViewById(R.id.layoutMessage);
convertView.setTag(view);
}
else
{
} else {
view = (ViewHolder) convertView.getTag();
}
try
{
try {
view.imgViewContact.setImageResource(listMessages.get(position).from.getLargeIcon());
//view.imgViewContact.setImageResource(R.drawable.peopleblue);
view.txtViewContact.setText(listMessages.get(position).from.name+ " :");
if(listMessages.get(position).message.length() > 25)
view.txtViewLastMsg.setText(listMessages.get(position).message.substring(0, 25) + "...");
view.txtViewContact.setText(String.format("%s :", listMessages.get(position).from.name));
if (listMessages.get(position).message.length() > 25)
view.txtViewLastMsg.setText(String.format("%s...", listMessages.get(position).message.substring(0, 25)));
else
view.txtViewLastMsg.setText(listMessages.get(position).message);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
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.SECOND, 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");
else
sdf = new SimpleDateFormat("MMM-dd HH:mm");
view.txtViewDateTime.setText(sdf.format(listMessages.get(position).received));
}
catch(Exception ex)
{
} catch (Exception ex) {
SM.Exception(ex.toString());
}
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;
}
}

View File

@ -1,215 +0,0 @@
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;
}
}
}
*/
}

View File

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#ffffff"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<LinearLayout
android:id="@+id/layoutSend"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#ffffff"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<LinearLayout
android:id="@+id/layoutSend"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingRight="13dp"
@ -19,147 +20,151 @@
android:background="#ffffff"
android:layout_marginLeft="5dp"
android:layout_weight="0">
<ImageView
android:id="@+id/imageViewSenderIco"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ambulance_large"
android:adjustViewBounds="true"
android:scaleType="center"
android:background="#ffffff"
android:layout_margin="3dp"
android:layout_gravity="top"
android:layout_weight="0" />
<ImageView
android:id="@+id/imageViewSenderIco"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ambulance_large"
android:adjustViewBounds="true"
android:scaleType="center"
android:background="#ffffff"
android:layout_margin="3dp"
android:layout_gravity="top"
android:layout_weight="0" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:padding="5dp"
android:layout_gravity="center_vertical"
android:background="@layout/row_conversation_style_send"
android:orientation="vertical"
android:layout_weight="1" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:padding="5dp"
android:layout_gravity="center_vertical"
android:background="@layout/row_conversation_style_send"
android:orientation="vertical"
android:layout_weight="1" >
<TextView
android:id="@+id/textViewSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textColor="#000000"
android:textSize="16dp" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageAckSendMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="center"
android:paddingTop="2dp"
android:src="@drawable/exclamation_small"
android:layout_weight="0"
android:visibility="invisible"/>
<TextView
android:id="@+id/textViewNotACKSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notAck"
android:textColor="#000000"
android:textSize="13dp"
android:layout_toRightOf="@+id/imageAck"
android:visibility="invisible" />
<TextView
android:id="@+id/textViewSendDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Small Text"
android:textColor="#4c4c4c"
android:textSize="13dp"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/textViewSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textColor="#000000"
android:textSize="16dp" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageAck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="center"
android:paddingTop="2dp"
android:src="@drawable/exclamation_small"
android:layout_weight="0"
android:visibility="invisible"
tools:ignore="DuplicateIds" />
<TextView
android:id="@+id/textViewNotACK"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notAck"
android:textColor="#000000"
android:textSize="13dp"
android:layout_toRightOf="@+id/imageAck"
android:visibility="invisible"
tools:ignore="DuplicateIds" />
<TextView
android:id="@+id/textViewSendDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Small Text"
android:textColor="#4c4c4c"
android:textSize="13dp"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingLeft="13dp"
android:layout_weight="0"
android:orientation="horizontal"
android:id="@+id/layoutReceived">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:padding="5dp"
android:layout_gravity="center_vertical"
android:background="@layout/row_conversation_style_rec"
android:orientation="vertical"
android:layout_weight="1" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:padding="5dp"
android:layout_gravity="center_vertical"
android:background="@layout/row_conversation_style_rec"
android:orientation="vertical"
android:layout_weight="1" >
<TextView
android:id="@+id/textViewReceivedMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textColor="#000000"
android:textSize="16dp" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageAckReceiveMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="center"
android:paddingTop="2dp"
android:src="@drawable/exclamation_small"
android:layout_weight="0"
android:visibility="invisible"/>
<TextView
android:id="@+id/textViewNotACKReceiveMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notAck"
android:textColor="#000000"
android:textSize="13dp"
android:layout_toRightOf="@+id/imageAck"
android:visibility="invisible"/>
<TextView
android:id="@+id/textViewReceivedDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Small Text"
android:textColor="#4c4c4c"
android:textSize="13dp"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
<TextView
android:id="@+id/textViewReceivedMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textColor="#000000"
android:textSize="16dp" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageAck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="center"
android:paddingTop="2dp"
android:src="@drawable/exclamation_small"
android:layout_weight="0"
android:visibility="invisible"
tools:ignore="DuplicateIds" />
<TextView
android:id="@+id/textViewNotACK"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/notAck"
android:textColor="#000000"
android:textSize="13dp"
android:layout_toRightOf="@+id/imageAck"
android:visibility="invisible"
tools:ignore="DuplicateIds" />
<TextView
android:id="@+id/textViewReceivedDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Small Text"
android:textColor="#4c4c4c"
android:textSize="13dp"
android:layout_alignParentRight="true"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="#ffffff"
android:layout_marginRight="5dp"
android:layout_weight="0">
<ImageView
android:id="@+id/imageViewReceivedIco"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="center"
android:src="@drawable/error"
android:background="#ffffff"
android:layout_margin="3dp"
android:layout_weight="0"
android:layout_gravity="top"
/>
</LinearLayout>
<ImageView
android:id="@+id/imageViewReceivedIco"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="center"
android:src="@drawable/error"
android:background="#ffffff"
android:layout_margin="3dp"
android:layout_weight="0"
android:layout_gravity="top"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -3,7 +3,6 @@ package com.safemobile.dispatch;
import java.util.ArrayList;
import java.util.Locale;
/** fix import*/
import com.safemobile.adapters.AlertGridViewAdapter;
import com.safemobile.adapters.AlertGridViewAdapter.ViewHolder;
@ -15,11 +14,11 @@ import com.safemobile.lib.SM;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.AdapterView;
import android.widget.TextView;
@ -28,232 +27,213 @@ import android.widget.GridView;
public class AlarmActivity extends Activity {
private Context context;
public TabLayoutActivity parentTab;
public ArrayList<Alarm> allAlarms = new ArrayList<Alarm>();
private ArrayList<Boolean> acknowledged = new ArrayList<Boolean>();
private TabLayoutActivity parentTab;
private ArrayList<Alarm> allAlarms = new ArrayList<>();
private ArrayList<Boolean> acknowledged = new ArrayList<>();
private AlertGridViewAdapter adapter;
/* Visual resources */
private GridView gridView;
public View convertViewAlarm;
private int ack_position;
public Bundle savedInstanceState;
// Need handler for callbacks to the UI thread
private final Handler myHandler = new Handler();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.savedInstanceState = savedInstanceState;
// get parentTab
parentTab = (TabLayoutActivity)getParent();
Locale locale = new Locale(AppParams.LANGUAGETMP);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
context = this;
setContentView(R.layout.tabalarm);
private View convertViewAlarm;
gridView = (GridView) findViewById(R.id.gridViewAlarms);
adapter = new AlertGridViewAdapter(this, allAlarms, context, acknowledged);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(onItemClickListener);
// change tab header fontface
TextView textView1 = (TextView) findViewById(R.id.textView1);
textView1.setTypeface(Typeface.createFromAsset(getAssets(), "Sketch_Block.ttf"));
textView1.setTextSize(24);
parentTab.alarmActivity = this;
}
@Override
public void onBackPressed()
{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(getString(R.string.exit))
.setCancelable(false)
.setNeutralButton(getString(R.string.logout), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
parentTab.whenBackPressed(AppParams.ActivityResult.logout);
}
})
.setPositiveButton(getString(R.string.ext), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
parentTab.whenBackPressed(AppParams.ActivityResult.exit);
}
})
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
@Override
public void onPause()
{
super.onPause();
SM.Debug("onPause");
}
@Override
public void onResume()
{
super.onResume();
if(!AppParams.DEMO)
GetAlarms();
else if (AppParams.DEMO)
{
for(int i=allAlarms.size()-1; i>=0; i--)
{
Alarm alarm = allAlarms.get(i);
if(alarm.ack==1)
allAlarms.remove(i);
}
acknowledged = new ArrayList<Boolean>();
for(int i=0;i<allAlarms.size();i++)
acknowledged.add(false);
updateResultsInUi("alarm");
}
SM.Debug("onResume");
}
private OnItemClickListener onItemClickListener = new OnItemClickListener() {
private int ackPosition;
private Bundle savedInstanceState;
// Need handler for callbacks to the UI thread
private final Handler myHandler = new Handler(Looper.getMainLooper());
private static final String ALARM = "alarm";
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setSavedInstanceState(savedInstanceState);
// get parentTab
setParentTab((TabLayoutActivity) getParent());
Locale locale = new Locale(AppParams.LANGUAGETMP);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());
context = this;
setContentView(R.layout.tabalarm);
gridView = findViewById(R.id.gridViewAlarms);
adapter = new AlertGridViewAdapter(this, getAllAlarms(), context, acknowledged);
gridView.setAdapter(adapter);
gridView.setOnItemClickListener(onItemClickListener);
// change tab header fontFace
TextView textView1 = findViewById(R.id.textView1);
textView1.setTypeface(Typeface.createFromAsset(getAssets(), "Sketch_Block.ttf"));
textView1.setTextSize(24);
getParentTab().alarmActivity = this;
}
@Override
public void onBackPressed() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(getString(R.string.exit))
.setCancelable(false)
.setNeutralButton(getString(R.string.logout), (dialog, id) -> getParentTab().whenBackPressed(AppParams.ActivityResult.logout))
.setPositiveButton(getString(R.string.ext), (dialog, id) -> getParentTab().whenBackPressed(AppParams.ActivityResult.exit))
.setNegativeButton(getString(R.string.cancel), (dialog, id) -> dialog.cancel());
AlertDialog alert = builder.create();
alert.show();
}
@Override
public void onPause() {
super.onPause();
SM.Debug("onPause");
}
@Override
public void onResume() {
super.onResume();
if (!AppParams.DEMO)
getAlarms();
else {
for (int i = getAllAlarms().size() - 1; i >= 0; i--) {
Alarm alarm = getAllAlarms().get(i);
if (alarm.ack == 1)
getAllAlarms().remove(i);
}
acknowledged = new ArrayList<>();
for (int i = 0; i < getAllAlarms().size(); i++)
acknowledged.add(false);
updateResultsInUi(ALARM);
}
SM.Debug("onResume");
}
private final OnItemClickListener onItemClickListener = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
long arg3) {
SM.Debug(" ### CLICK Alarm : " + position);
convertViewAlarm = arg1;
setConvertViewAlarm(arg1);
// save position
ack_position = position;
//Toast.makeText(context, "SETACK " + idx, 1000).show();
if(!AppParams.DEMO)
setACK(allAlarms.get(position).idx,allAlarms.get(position).type);
else
{
allAlarms.get(position).ack = 1;
ackPosition = position;
if (!AppParams.DEMO)
setACK(getAllAlarms().get(position).idx, getAllAlarms().get(position).type, getAllAlarms().get(position).unitName);
else {
getAllAlarms().get(position).ack = 1;
updateResultsInUi("else");
}
}
// send ACK to AppServer
private void setACK(int idx, int type, String unitName) {
getParentTab().executeNetworkStuff(new String[]{OperationCodes.SendAlarmAcknoledge + "", idx + "", type + "", unitName});
}
};
// Update Alarms received from AppServer
public void UpdateAlarms(ArrayList<Alarm> list)
{
SM.Debug("## UpdateAlarms: " + list.size());
allAlarms = list;
acknowledged = new ArrayList<Boolean>();
// Update Alarms received from AppServer
public void updateAlarms(ArrayList<Alarm> list) {
SM.Debug("## updateAlarms: " + list.size());
setAllAlarms(list);
acknowledged = new ArrayList<>();
// set acknowledged based on alarm.ack value
for(Alarm alarm: allAlarms)
{
acknowledged.add((alarm.ack == 1)? true: false);
SM.Debug("ALARM", "SC_ID> " + alarm.sc_id + " | "
+ (parentTab.getVehHashByScId().get(alarm.sc_id) == null ? "null" : parentTab.getVehHashByScId().get(alarm.sc_id).name ));
if (parentTab.getVehHashByScId().get(alarm.sc_id)!=null)
alarm.unitName = parentTab.getVehHashByScId().get(alarm.sc_id).name;
/*Enumeration<Long> keylist = parentTab.SuperVehHash.keys();
while(keylist.hasMoreElements())
{
SuperVehicle tmp = (SuperVehicle)((parentTab.SuperVehHash.get((long)keylist.nextElement())));
if (tmp.sc_id==alarm.sc_id)
{
alarm.unitName = tmp.name;
break;
}
}*/
}
myHandler.post(UpdateResultsRUN);
}
// Create runnable for posting
final Runnable UpdateResultsRUN = new Runnable() {
public void run() {
updateResultsInUi("alarm");
}
};
private void updateResultsInUi(String param)
{
if(param.equals("alarm"))
{
// set adapter
adapter = new AlertGridViewAdapter(this, allAlarms, context, acknowledged);
gridView.setAdapter(adapter);
}
else
{
adapter.changeACK(ack_position);
SM.Debug("Set ACK: " + ack_position + " | " + (acknowledged.get(ack_position) ? "true": "false"));
for (Alarm alarm : getAllAlarms()) {
acknowledged.add(alarm.ack == 1);
SM.Debug("ALARM", "SC_ID> " + alarm.sc_id + " | "
+ (getParentTab().getVehHashByScId().get(alarm.sc_id) == null ? "null" : getParentTab().getVehHashByScId().get(alarm.sc_id).name));
ViewHolder viewAlarm = new ViewHolder();
viewAlarm = (ViewHolder) convertViewAlarm.getTag();
switch(acknowledged.get(ack_position) ? 1 : 0)
{
if (getParentTab().getVehHashByScId().get(alarm.sc_id) != null)
alarm.unitName = getParentTab().getVehHashByScId().get(alarm.sc_id).name;
}
myHandler.post(updateResultsRUN);
}
// Create runnable for posting
final Runnable updateResultsRUN = () -> updateResultsInUi(ALARM);
private void updateResultsInUi(String param) {
if (param.equals(ALARM)) {
// set adapter
adapter = new AlertGridViewAdapter(this, getAllAlarms(), context, acknowledged);
gridView.setAdapter(adapter);
} else {
adapter.changeACK(ackPosition);
SM.Debug("Set ACK: " + ackPosition + " | " + (Boolean.TRUE.equals(acknowledged.get(ackPosition)) ? "true" : "false"));
ViewHolder viewAlarm;
viewAlarm = (ViewHolder) getConvertViewAlarm().getTag();
switch (Boolean.TRUE.equals(acknowledged.get(ackPosition)) ? 1 : 0) {
case 1:
viewAlarm.imageViewAlert.setImageResource(R.drawable.alert_off);
//view.imgViewIcon.setImageDrawable(adapter.convertToGrayscale(activity.getResources().getDrawable(liveVehicle.get(position).getSmallIcon())));
break;
case 0:
//view.imgViewAlarm.setImageResource(R.drawable.siren);
//view.imgViewIcon.setImageResource(liveVehicle.get(position).getSmallIcon());
viewAlarm.imageViewAlert.setImageResource(R.drawable.siren);
break;
default:
throw new IllegalStateException("Unexpected value: " + (Boolean.TRUE.equals(acknowledged.get(ackPosition)) ? 1 : 0));
}
}
}
// update ACK received from AppServer
public void UpdateACK()
{
myHandler.post(UpdateAckRUN);
public void updateACK() {
myHandler.post(updateAckRUN);
}
// Create runnable for posting
final Runnable UpdateAckRUN = new Runnable() {
public void run() {
SM.Debug(" UpdateACK: ");
updateResultsInUi("adapter");
}
};
// send to AppServer
private void GetAlarms()
{
parentTab.executeNetworkStuff(new String[]{OperationCodes.GetAlarms +"", AppParams.USERID + ""});
//parentTab.getAlarms(AppParams.USERID);
// Create runnable for posting
final Runnable updateAckRUN = () -> {
SM.Debug(" updateACK: ");
updateResultsInUi("adapter");
};
// send to AppServer
private void getAlarms() {
getParentTab().executeNetworkStuff(new String[]{OperationCodes.GetAlarms + "", AppParams.USERID + ""});
}
public TabLayoutActivity getParentTab() {
return parentTab;
}
public void setParentTab(TabLayoutActivity parentTab) {
this.parentTab = parentTab;
}
public ArrayList<Alarm> getAllAlarms() {
return allAlarms;
}
public void setAllAlarms(ArrayList<Alarm> allAlarms) {
this.allAlarms = allAlarms;
}
public View getConvertViewAlarm() {
return convertViewAlarm;
}
public void setConvertViewAlarm(View convertViewAlarm) {
this.convertViewAlarm = convertViewAlarm;
}
public Bundle getSavedInstanceState() {
return savedInstanceState;
}
public void setSavedInstanceState(Bundle savedInstanceState) {
this.savedInstanceState = savedInstanceState;
}
// send ACK to AppServer
private void setACK(int idx, int type)
{
parentTab.executeNetworkStuff(new String[]{OperationCodes.SendAlarmAcknoledge +"", idx + "", type + ""});
//parentTab.sendAlarmAcknowledge(idx, type);
}
}

View File

@ -405,7 +405,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
tabHost.setCurrentTabByTag("Text");
AppParams.crtTab = AppParams.Tabs.message;
if (AppParams.DEMO && messageActivity.allVehicle.size()== 0) {
if (AppParams.DEMO && messageActivity.getAllVehicle().size()== 0) {
// select button
buttonText.setSelected(true);
// deselect other buttons
@ -419,9 +419,9 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
tabHost.setCurrentTabByTag("Text");
AppParams.crtTab = AppParams.Tabs.message;
if (AppParams.DEMO && messageActivity.allVehicle.size()== 0) {
messageActivity.UpdateVehs(getAllVehicle());
messageActivity.UpdateSMS(listSMS);
if (AppParams.DEMO && messageActivity.getAllVehicle().size()== 0) {
messageActivity.updateVehicles(getAllVehicle());
messageActivity.updateSMS(listSMS);
}
}
}
@ -535,7 +535,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
AppParams.crtTab = AppParams.Tabs.alarms;
if(AppParams.DEMO && alarmActivity!=null && alarmActivity.allAlarms != null && alarmActivity.allAlarms.size() ==0 )
if(AppParams.DEMO && alarmActivity!=null && alarmActivity.getAllAlarms() != null && alarmActivity.getAllAlarms().size() ==0 )
{
ArrayList<Alarm> listAlarms = new ArrayList<Alarm>();
Alarm alarm = new Alarm();
@ -578,7 +578,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
alarm.typestr = "Emergency";
listAlarms.add(alarm);
alarmActivity.UpdateAlarms(listAlarms);
alarmActivity.updateAlarms(listAlarms);
}
}
@ -674,8 +674,8 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
//list for SMS
if(currentActivity instanceof MessagesActivity)
{
// run update showSMS4unit(int sc_id) form MessageActivity
((MessagesActivity)currentActivity).showSMS4unit(getVehicle4Imei(imei).sc_id);
// run update showSMS4unit(int scId) form MessageActivity
((MessagesActivity)currentActivity).showSMS4unit(getVehicle4Imei(imei).scId);
}
*/
}
@ -814,9 +814,9 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
tabHost.setCurrentTabByTag("Text");
AppParams.crtTab = AppParams.Tabs.message;
messageActivity.sc_id = getVehicle4Imei(getImei()).sc_id;
messageActivity.setScId(getVehicle4Imei(getImei()).sc_id);
messageActivity.LASTMESSAGES = false;
messageActivity.GetLastSMS();
messageActivity.getLastSMS();
// disable notification
if(mNotificationManager!=null)
@ -1010,11 +1010,11 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
if(radioActivity!=null)
radioActivity.onCreate(radioActivity.savedInstanceState);
if(messageActivity!=null)
messageActivity.onCreate(messageActivity.savedInstanceState);
messageActivity.onCreate(messageActivity.getSavedInstanceState());
if(recordingsActivity!=null)
recordingsActivity.onCreate(recordingsActivity.savedInstanceState);
if(alarmActivity!=null)
alarmActivity.onCreate(alarmActivity.savedInstanceState);
alarmActivity.onCreate(alarmActivity.getSavedInstanceState());
}
@ -1310,9 +1310,9 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
//list for SMS
if(AppParams.crtTab == AppParams.Tabs.message)
{
//SM.Debug("currentActivity instanceof MessagesActivity - NewSMS");
//SM.Debug("currentActivity instanceof MessagesActivity - newSMS");
if(messageActivity != null)
messageActivity.UpdateSMS(sms.smsList);
messageActivity.updateSMS(sms.smsList);
}
}
catch(Exception ex)
@ -1361,7 +1361,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
{
SM.Debug("currentActivity instanceof MessagesActivity");
if(messageActivity != null)
messageActivity.UpdateVehs(vMSG.vehList);
messageActivity.updateVehicles(vMSG.vehList);
}
setAllVehicle(vMSG.vehList);
}
@ -1378,7 +1378,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
{
//SM.Debug("currentActivity instanceof MessagesActivity");
if(messageActivity != null)
messageActivity.UpdateSMS(sms.smsList);
messageActivity.updateSMS(sms.smsList);
}
}
catch (Exception ex)
@ -1399,7 +1399,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
{
SM.Debug("currentActivity instanceof AlarmActivity");
if(alarmActivity != null)
alarmActivity.UpdateAlarms(Alarms.alarmList);
alarmActivity.updateAlarms(Alarms.alarmList);
}
}
@ -1413,7 +1413,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
if (Integer.parseInt(tempArr[0])==1 && AppParams.crtTab == AppParams.Tabs.alarms)
{
if(alarmActivity != null)
alarmActivity.UpdateACK();
alarmActivity.updateACK();
}
}
@ -1424,7 +1424,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
SM.Debug("Got smsComfirm msg.data:" + msg.data);
if (messageActivity != null)
messageActivity.ConfirmSMS(sms.data, msg.seqID);
messageActivity.confirmSMS(sms.data, msg.seqID);
}
@Override
@ -1457,8 +1457,8 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
});
//list for SMS
if(AppParams.crtTab == AppParams.Tabs.message && messageActivity!= null) {
SM.Debug("currentActivity instanceof MessagesActivity - NewSMS | " + tempArr[0] + " | " + tempArr[1]);
messageActivity.NewSMS(tempArr[0], tempArr[1], time);
SM.Debug("currentActivity instanceof MessagesActivity - newSMS | " + tempArr[0] + " | " + tempArr[1]);
messageActivity.newSMS(tempArr[0], tempArr[1], time);
}
}
@ -2129,7 +2129,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
return (z1 > z0) ? (17-z1) : (17-z0);
}
//callType:
//101 -allcall init
//111 -allcall stop
@ -2157,7 +2157,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
protected class ConnectTask extends AsyncTask<String, Void, TCPhandler> {
@Override
protected TCPhandler doInBackground(String... params) {
switch(Integer.parseInt(params[0])) {
case OperationCodes.TCP_CONNECTION_REQ:
@ -2212,7 +2212,7 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
break;
case OperationCodes.SendAlarmAcknoledge:
sendAlarmAcknowledge(Integer.parseInt(params[1]), Integer.parseInt(params[2]));
sendAlarmAcknowledge(Integer.parseInt(params[1]), Integer.parseInt(params[2]), params[3]);
break;
case OperationCodes.GetHistoryPositions:
@ -2223,7 +2223,6 @@ public class TabLayoutActivity extends AbstractSDParentActivity{
}
}
@Override
public void executeNetworkStuff(String [] params) {
new ConnectTask().execute(params);

View File

@ -1,243 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:weightSum="1"
android:id="@+id/layoutMain"
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">
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:weightSum="1"
android:id="@+id/layoutMain"
style="?bg">
<ImageView
android:id="@+id/imageViewMsg"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/message"
android:paddingLeft="0dp"
android:layout_margin="3dp"
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"/>
<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">
<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/imageViewMsg"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/message"
android:paddingLeft="0dp"
android:layout_margin="3dp"
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
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
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
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">
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"/>
<GridView
android:id="@+id/gridView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#999999"
android:drawSelectorOnTop="false"
android:horizontalSpacing="0dp"
android:numColumns="1"
android:verticalSpacing="1dp" >
</GridView>
</LinearLayout>
<LinearLayout
android:id="@+id/layoutSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_weight="0"
android:orientation="horizontal"
style="?header">
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textViewSendMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/message"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textAppearance="?android:attr/textAppearanceLarge"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<EditText
android:id="@+id/editTextMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:inputType="text" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<ImageView
android:id="@+id/imageBarcode"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:src="@drawable/barcode"
android:paddingTop="2dp"
android:layout_margin="3dp" />
</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>
<!-- 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">
<GridView
android:id="@+id/gridView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#999999"
android:drawSelectorOnTop="false"
android:horizontalSpacing="0dp"
android:numColumns="1"
android:verticalSpacing="1dp" >
</GridView>
</LinearLayout>
<LinearLayout
android:id="@+id/layoutSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_weight="0"
android:orientation="horizontal"
style="?header">
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/message"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textAppearance="?android:attr/textAppearanceLarge"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<EditText
android:id="@+id/editTextMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:inputType="text"
android:autofillHints="">
</EditText>
</LinearLayout>
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<ImageView
android:id="@+id/imageBarcode"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:src="@drawable/barcode"
android:paddingTop="2dp"
android:layout_margin="3dp" />
</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>

View File

@ -1,240 +1,241 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:weightSum="1"
android:id="@+id/layoutMain"
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">
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:weightSum="1"
android:id="@+id/layoutMain"
style="?bg">
<ImageView
android:id="@+id/imageViewMsg"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/message"
android:paddingLeft="5dp"
android:layout_margin="3dp"
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"/>
<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">
<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/imageViewMsg"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:src="@drawable/message"
android:paddingLeft="5dp"
android:layout_margin="3dp"
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
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
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
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">
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"/>
<GridView
android:id="@+id/gridView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#999999"
android:drawSelectorOnTop="false"
android:horizontalSpacing="0dp"
android:numColumns="1"
android:verticalSpacing="1dp" >
</GridView>
</LinearLayout>
<LinearLayout
android:id="@+id/layoutSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_weight="0"
android:orientation="horizontal"
style="?header">
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textViewSendMsg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/message"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textSize="18dp"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<EditText
android:id="@+id/editTextMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:inputType="text"
android:maxLength="255" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<ImageView
android:id="@+id/imageBarcode"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:src="@drawable/barcode"
android:layout_margin="3dp" />
</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>
<!-- 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">
<GridView
android:id="@+id/gridView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#999999"
android:drawSelectorOnTop="false"
android:horizontalSpacing="0dp"
android:numColumns="1"
android:verticalSpacing="1dp" >
</GridView>
</LinearLayout>
<LinearLayout
android:id="@+id/layoutSendMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_weight="0"
android:orientation="horizontal"
style="?header">
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/message"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textSize="18dp"
/>
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<EditText
android:id="@+id/editTextMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:inputType="text"
android:maxLength="255"
android:autofillHints="">
</EditText>
</LinearLayout>
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<ImageView
android:id="@+id/imageBarcode"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:src="@drawable/barcode"
android:layout_margin="3dp" />
</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>