Improved slider content display + refresh registers on click
This commit is contained in:
parent
4235b26bb5
commit
5b6eab3acc
6 changed files with 42 additions and 21 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ bin
|
||||||
doc
|
doc
|
||||||
ant.properties
|
ant.properties
|
||||||
local.properties
|
local.properties
|
||||||
|
tests/*$py.class
|
||||||
|
|
|
@ -1,26 +1,37 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="horizontal"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/State"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/Identity"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:layout_weight="4"/>
|
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/Default"
|
android:id="@+id/Default"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<LinearLayout
|
||||||
|
android:layout_toLeftOf="@id/Default"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:contentDescription="@string/content_description_led"
|
||||||
|
android:id="@+id/State"
|
||||||
|
android:src="@drawable/led_disconnected"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Identity"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@android:color/white"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:src="@drawable/wizard_ok"/>
|
android:src="@drawable/wizard_notok"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:src="@drawable/wizard_ok"/>
|
android:src="@drawable/wizard_notok"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:src="@drawable/wizard_ok"/>
|
android:src="@drawable/wizard_notok"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,9 @@ public class StatusFragment extends Fragment {
|
||||||
LinphoneActivity.instance().exit();
|
LinphoneActivity.instance().exit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// We create it once to not delay the first display
|
||||||
|
populateSliderContent();
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
@ -386,6 +389,12 @@ public class StatusFragment extends Fragment {
|
||||||
TextView identity = (TextView) view.findViewById(R.id.Identity);
|
TextView identity = (TextView) view.findViewById(R.id.Identity);
|
||||||
String sipAddress = (lpc.getIdentity() != null && lpc.getIdentity().startsWith("sip:")) ? lpc.getIdentity().split("sip:")[1] : lpc.getIdentity();
|
String sipAddress = (lpc.getIdentity() != null && lpc.getIdentity().startsWith("sip:")) ? lpc.getIdentity().split("sip:")[1] : lpc.getIdentity();
|
||||||
identity.setText(sipAddress);
|
identity.setText(sipAddress);
|
||||||
|
identity.setOnClickListener(new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
LinphoneManager.getLc().refreshRegisters();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
CheckBox isDefault = (CheckBox) view.findViewById(R.id.Default);
|
CheckBox isDefault = (CheckBox) view.findViewById(R.id.Default);
|
||||||
checkboxes.add(isDefault);
|
checkboxes.add(isDefault);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue