Fix UI in History call log
This commit is contained in:
parent
f9a716add1
commit
160b0c3b8b
2 changed files with 80 additions and 65 deletions
|
@ -33,44 +33,6 @@
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/avatar_layout"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/contact_picture"
|
|
||||||
android:src="@drawable/avatar"
|
|
||||||
android:contentDescription="@string/content_description_contact_picture"
|
|
||||||
android:layout_width="35dp"
|
|
||||||
android:layout_height="35dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/mask"
|
|
||||||
android:src="@drawable/avatar_mask"
|
|
||||||
android:layout_width="35dp"
|
|
||||||
android:layout_height="35dp"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/icon"
|
|
||||||
android:src="@drawable/call_status_incoming"
|
|
||||||
android:contentDescription="@string/content_description_call_direction"
|
|
||||||
android:padding="7dp"
|
|
||||||
android:layout_toRightOf="@id/avatar_layout"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/detail"
|
android:id="@+id/detail"
|
||||||
android:src="@drawable/list_detail"
|
android:src="@drawable/list_detail"
|
||||||
|
@ -93,18 +55,63 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:padding="5dp" />
|
android:padding="5dp" />
|
||||||
|
|
||||||
<TextView
|
<RelativeLayout
|
||||||
android:id="@+id/sip_uri"
|
android:id="@+id/history_click"
|
||||||
style="@style/font6"
|
android:layout_width="match_parent"
|
||||||
android:lines="1"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_toRightOf="@id/icon"
|
|
||||||
android:layout_toLeftOf="@id/detail"
|
android:layout_toLeftOf="@id/detail"
|
||||||
android:layout_marginLeft="10dp" />
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/avatar_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/contact_picture"
|
||||||
|
android:src="@drawable/avatar"
|
||||||
|
android:contentDescription="@string/content_description_contact_picture"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_marginLeft="5dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/mask"
|
||||||
|
android:src="@drawable/avatar_mask"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_marginLeft="5dp"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/icon"
|
||||||
|
android:src="@drawable/call_status_incoming"
|
||||||
|
android:contentDescription="@string/content_description_call_direction"
|
||||||
|
android:padding="7dp"
|
||||||
|
android:layout_toRightOf="@id/avatar_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_marginLeft="5dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sip_uri"
|
||||||
|
style="@style/font6"
|
||||||
|
android:lines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toRightOf="@id/icon"
|
||||||
|
android:layout_marginLeft="10dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ import android.widget.CompoundButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -322,17 +323,6 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
LinphoneCallLog log = mLogs.get(position);
|
LinphoneCallLog log = mLogs.get(position);
|
||||||
LinphoneManager.getLc().removeCallLog(log);
|
LinphoneManager.getLc().removeCallLog(log);
|
||||||
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
|
||||||
} else {
|
|
||||||
if (LinphoneActivity.isInstanciated()) {
|
|
||||||
LinphoneCallLog log = mLogs.get(position);
|
|
||||||
LinphoneAddress address;
|
|
||||||
if (log.getDirection() == CallDirection.Incoming) {
|
|
||||||
address = log.getFrom();
|
|
||||||
} else {
|
|
||||||
address = log.getTo();
|
|
||||||
}
|
|
||||||
LinphoneActivity.instance().setAddresGoToDialerAndCall(address.asStringUriOnly(), address.getDisplayName(), null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,6 +348,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
public CheckBox select;
|
public CheckBox select;
|
||||||
public ImageView callDirection;
|
public ImageView callDirection;
|
||||||
public ImageView contactPicture;
|
public ImageView contactPicture;
|
||||||
|
public RelativeLayout CallContact;
|
||||||
|
|
||||||
public ViewHolder(View view) {
|
public ViewHolder(View view) {
|
||||||
contact = (TextView) view.findViewById(R.id.sip_uri);
|
contact = (TextView) view.findViewById(R.id.sip_uri);
|
||||||
|
@ -365,6 +356,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
select = (CheckBox) view.findViewById(R.id.delete);
|
select = (CheckBox) view.findViewById(R.id.delete);
|
||||||
callDirection = (ImageView) view.findViewById(R.id.icon);
|
callDirection = (ImageView) view.findViewById(R.id.icon);
|
||||||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||||
|
CallContact = (RelativeLayout) view.findViewById(R.id.history_click);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,6 +479,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEditMode) {
|
if (isEditMode) {
|
||||||
|
holder.CallContact.setOnClickListener(null);
|
||||||
holder.select.setVisibility(View.VISIBLE);
|
holder.select.setVisibility(View.VISIBLE);
|
||||||
holder.select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
holder.select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -526,6 +519,21 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
holder.CallContact.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (LinphoneActivity.isInstanciated()) {
|
||||||
|
LinphoneCallLog log = mLogs.get(position);
|
||||||
|
LinphoneAddress address;
|
||||||
|
if (log.getDirection() == CallDirection.Incoming) {
|
||||||
|
address = log.getFrom();
|
||||||
|
} else {
|
||||||
|
address = log.getTo();
|
||||||
|
}
|
||||||
|
LinphoneActivity.instance().setAddresGoToDialerAndCall(address.asStringUriOnly(), address.getDisplayName(), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue