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: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
|
||||
android:id="@+id/detail"
|
||||
android:src="@drawable/list_detail"
|
||||
|
@ -93,18 +55,63 @@
|
|||
android:visibility="gone"
|
||||
android:padding="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"
|
||||
<RelativeLayout
|
||||
android:id="@+id/history_click"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_toRightOf="@id/icon"
|
||||
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>
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ import android.widget.CompoundButton;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
|
@ -212,7 +213,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
historyList.setAdapter(new CallHistoryAdapter(getActivity().getApplicationContext()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
ContactsManager.removeContactsListener(this);
|
||||
|
@ -322,17 +323,6 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
LinphoneCallLog log = mLogs.get(position);
|
||||
LinphoneManager.getLc().removeCallLog(log);
|
||||
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,20 +348,22 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
public CheckBox select;
|
||||
public ImageView callDirection;
|
||||
public ImageView contactPicture;
|
||||
|
||||
public RelativeLayout CallContact;
|
||||
|
||||
public ViewHolder(View view) {
|
||||
contact = (TextView) view.findViewById(R.id.sip_uri);
|
||||
detail = (ImageView) view.findViewById(R.id.detail);
|
||||
select = (CheckBox) view.findViewById(R.id.delete);
|
||||
callDirection = (ImageView) view.findViewById(R.id.icon);
|
||||
contactPicture = (ImageView) view.findViewById(R.id.contact_picture);
|
||||
CallContact = (RelativeLayout) view.findViewById(R.id.history_click);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CallHistoryAdapter(Context aContext) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getCount() {
|
||||
return mLogs.size();
|
||||
}
|
||||
|
@ -421,7 +413,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
View view = null;
|
||||
ViewHolder holder = null;
|
||||
|
||||
|
||||
if (convertView != null) {
|
||||
view = convertView;
|
||||
holder = (ViewHolder) view.getTag();
|
||||
|
@ -487,6 +479,7 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
|||
}
|
||||
|
||||
if (isEditMode) {
|
||||
holder.CallContact.setOnClickListener(null);
|
||||
holder.select.setVisibility(View.VISIBLE);
|
||||
holder.select.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue