Fixed layout issues, mostly for tablets
This commit is contained in:
parent
2c2744ce54
commit
cdfc07c560
8 changed files with 910 additions and 2 deletions
|
@ -26,6 +26,7 @@ import android.util.SparseArray
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.linphone.R
|
||||
|
||||
class RecyclerViewHeaderDecoration(private val adapter: HeaderAdapter) : RecyclerView.ItemDecoration() {
|
||||
private val headers: SparseArray<View> = SparseArray()
|
||||
|
@ -54,7 +55,8 @@ class RecyclerViewHeaderDecoration(private val adapter: HeaderAdapter) : Recycle
|
|||
}
|
||||
|
||||
val displayMetrics = parent.context.resources.displayMetrics
|
||||
val widthSpec = View.MeasureSpec.makeMeasureSpec(displayMetrics.widthPixels, View.MeasureSpec.EXACTLY)
|
||||
val width = if (view.resources.getBoolean(R.bool.isTablet)) displayMetrics.widthPixels / 2 else displayMetrics.widthPixels
|
||||
val widthSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY)
|
||||
val heightSpec = View.MeasureSpec.makeMeasureSpec(displayMetrics.heightPixels, View.MeasureSpec.EXACTLY)
|
||||
val childWidth = ViewGroup.getChildMeasureSpec(widthSpec, parent.paddingLeft + parent.paddingRight, view.layoutParams.width)
|
||||
val childHeight = ViewGroup.getChildMeasureSpec(heightSpec, parent.paddingTop + parent.paddingBottom, view.layoutParams.height)
|
||||
|
|
|
@ -79,7 +79,7 @@ class TimestampUtils {
|
|||
if (isSameYear(timestamp, timestampInSecs)) {
|
||||
// Remove the year part of the format
|
||||
dateFormat.applyPattern(
|
||||
dateFormat.toPattern().replace("/?y+/?|\\s?y+\\s?".toRegex(), if (shortDate) "" else " ")
|
||||
dateFormat.toPattern().replace("/?y+/?|,?\\s?y+\\s?".toRegex(), if (shortDate) "" else " ")
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_below="@id/searchBar"
|
||||
android:layout_toRightOf="@id/tabs_fragment"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
|
191
app/src/main/res/layout-sw533dp-land/history_detail_fragment.xml
Normal file
191
app/src/main/res/layout-sw533dp-land/history_detail_fragment.xml
Normal file
|
@ -0,0 +1,191 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:bind="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="backClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="newContactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="contactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.history.viewmodels.CallLogViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="?attr/lightToolbarBackgroundColor"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:contentDescription="@string/content_description_go_back"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="18dp"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.6" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{newContactClickListener}"
|
||||
android:visibility="@{viewModel.contact != null ? View.GONE : View.VISIBLE}"
|
||||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contact_add" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{contactClickListener}"
|
||||
android:visibility="@{viewModel.contact == null ? View.GONE : View.VISIBLE}"
|
||||
android:contentDescription="@string/content_description_go_to_contact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contact" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<org.linphone.contact.BigContactAvatarView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
bind:layout="@layout/contact_avatar_big"
|
||||
app:viewModel="@{viewModel}"/>
|
||||
|
||||
<TextView
|
||||
android:text="@{viewModel.contact.fullName ?? viewModel.displayName}"
|
||||
style="@style/big_contact_name_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal" />
|
||||
|
||||
<org.linphone.views.MarqueeTextView
|
||||
android:text="@{viewModel.peerSipUri}"
|
||||
style="@style/sip_uri_font"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startCall()}"
|
||||
android:contentDescription="@string/content_description_start_call"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/round_orange_button_background"
|
||||
android:src="@drawable/call_start_default" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startChat(false)}"
|
||||
android:contentDescription="@string/content_description_start_chat"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/round_orange_button_background"
|
||||
android:src="@drawable/chat_start_default" />
|
||||
|
||||
<RelativeLayout
|
||||
android:onClick="@{() -> viewModel.startChat(true)}"
|
||||
android:visibility="@{viewModel.secureChatAllowed ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/content_description_start_encrypted_chat"
|
||||
android:background="@drawable/round_orange_button_background"
|
||||
android:src="@drawable/chat_start_default" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:contentDescription="@string/content_description_start_encrypted_chat"
|
||||
android:src="@drawable/security_toogle_icon_green" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<TextView
|
||||
style="@style/assistant_input_field_header_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/history_calls_list"
|
||||
android:textAllCaps="true" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:entries="@{viewModel.callsHistory}"
|
||||
app:layout="@{@layout/history_detail_cell}"/>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/wait_layout"
|
||||
bind:visibility="@{viewModel.waitForChatRoomCreation}"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
139
app/src/main/res/layout-sw533dp/chat_room_master_fragment.xml
Normal file
139
app/src/main/res/layout-sw533dp/chat_room_master_fragment.xml
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="newOneToOneChatRoomClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="newGroupChatRoomClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="editClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatRoomsListViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/tabs_fragment"
|
||||
android:name="org.linphone.activities.main.fragments.TabsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
tools:layout="@layout/tabs_fragment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/tabs_fragment"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="?attr/lightToolbarBackgroundColor"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{newOneToOneChatRoomClickListener}"
|
||||
android:contentDescription="@string/content_description_create_one_to_one_chat_room"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/chat_new" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{viewModel.groupChatAvailable ? View.VISIBLE : View.GONE}"
|
||||
android:onClick="@{newGroupChatRoomClickListener}"
|
||||
android:contentDescription="@string/content_description_create_group_chat_room"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/chat_group_new" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.4" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{editClickListener}"
|
||||
android:enabled="@{!viewModel.chatRooms.empty}"
|
||||
android:contentDescription="@string/content_description_enter_edition_mode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/delete" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/list_edit_top_bar_fragment"
|
||||
android:name="org.linphone.activities.main.fragments.ListTopBarFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignTop="@id/top_bar"
|
||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/chatList"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
style="@style/empty_list_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/no_chat_history"
|
||||
android:visibility="@{viewModel.chatRooms.empty ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/chat_nav_container"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="false"
|
||||
app:navGraph="@navigation/chat_nav_graph"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
210
app/src/main/res/layout-sw533dp/contact_master_fragment.xml
Normal file
210
app/src/main/res/layout-sw533dp/contact_master_fragment.xml
Normal file
|
@ -0,0 +1,210 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="allContactsToggleClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="sipContactsToggleClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="newContactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="editClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.contact.viewmodels.ContactsListViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/tabs_fragment"
|
||||
android:name="org.linphone.activities.main.fragments.TabsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
tools:layout="@layout/tabs_fragment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/tabs_fragment"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="?attr/lightToolbarBackgroundColor"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{allContactsToggleClickListener}"
|
||||
android:enabled="@{viewModel.sipContactsSelected}"
|
||||
android:contentDescription="@string/content_description_show_all_contacts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contacts_all" />
|
||||
|
||||
<View
|
||||
android:visibility="@{viewModel.sipContactsSelected ? View.GONE : View.VISIBLE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/accentColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{sipContactsToggleClickListener}"
|
||||
android:enabled="@{!viewModel.sipContactsSelected}"
|
||||
android:contentDescription="@string/content_description_show_sip_contacts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:gravity="center"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contacts_sip" />
|
||||
|
||||
<View
|
||||
android:visibility="@{viewModel.sipContactsSelected ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/accentColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{newContactClickListener}"
|
||||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contact_add" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{editClickListener}"
|
||||
android:enabled="@{!viewModel.contactsList.empty}"
|
||||
android:contentDescription="@string/content_description_enter_edition_mode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/delete" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/list_edit_top_bar_fragment"
|
||||
android:name="org.linphone.activities.main.fragments.ListTopBarFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignTop="@id/top_bar"
|
||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||
|
||||
<SearchView
|
||||
android:id="@+id/searchBar"
|
||||
queryValue="@={viewModel.filter}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:iconifiedByDefault="false"
|
||||
android:inputType="textPersonName"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:layout_margin="10dp"
|
||||
android:queryBackground="@color/transparent_color"
|
||||
android:queryHint="@string/contact_filter_hint"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_below="@id/searchBar"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/contactsList"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_below="@id/searchBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
style="@style/empty_list_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_sip_contact"
|
||||
android:visibility="@{viewModel.sipContactsSelected && viewModel.contactsList.empty ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<TextView
|
||||
style="@style/empty_list_font"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:text="@string/no_contact"
|
||||
android:visibility="@{!viewModel.sipContactsSelected && viewModel.contactsList.empty ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/contacts_nav_container"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="false"
|
||||
app:navGraph="@navigation/contacts_nav_graph"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
191
app/src/main/res/layout-sw533dp/history_detail_fragment.xml
Normal file
191
app/src/main/res/layout-sw533dp/history_detail_fragment.xml
Normal file
|
@ -0,0 +1,191 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:bind="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="backClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="newContactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="contactClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.history.viewmodels.CallLogViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="?attr/lightToolbarBackgroundColor"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:onClick="@{backClickListener}"
|
||||
android:contentDescription="@string/content_description_go_back"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="18dp"
|
||||
android:src="@drawable/back" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.6" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{newContactClickListener}"
|
||||
android:visibility="@{viewModel.contact != null ? View.GONE : View.VISIBLE}"
|
||||
android:contentDescription="@string/content_description_add_contact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contact_add" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{contactClickListener}"
|
||||
android:visibility="@{viewModel.contact == null ? View.GONE : View.VISIBLE}"
|
||||
android:contentDescription="@string/content_description_go_to_contact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/contact" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<org.linphone.contact.BigContactAvatarView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
bind:layout="@layout/contact_avatar_big"
|
||||
app:viewModel="@{viewModel}"/>
|
||||
|
||||
<TextView
|
||||
android:text="@{viewModel.contact.fullName ?? viewModel.displayName}"
|
||||
style="@style/big_contact_name_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal" />
|
||||
|
||||
<org.linphone.views.MarqueeTextView
|
||||
android:text="@{viewModel.peerSipUri}"
|
||||
style="@style/sip_uri_font"
|
||||
android:singleLine="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startCall()}"
|
||||
android:contentDescription="@string/content_description_start_call"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/round_orange_button_background"
|
||||
android:src="@drawable/call_start_default" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{() -> viewModel.startChat(false)}"
|
||||
android:contentDescription="@string/content_description_start_chat"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/round_orange_button_background"
|
||||
android:src="@drawable/chat_start_default" />
|
||||
|
||||
<RelativeLayout
|
||||
android:onClick="@{() -> viewModel.startChat(true)}"
|
||||
android:visibility="@{viewModel.secureChatAllowed ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/content_description_start_encrypted_chat"
|
||||
android:background="@drawable/round_orange_button_background"
|
||||
android:src="@drawable/chat_start_default" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:contentDescription="@string/content_description_start_encrypted_chat"
|
||||
android:src="@drawable/security_toogle_icon_green" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<TextView
|
||||
style="@style/assistant_input_field_header_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/history_calls_list"
|
||||
android:textAllCaps="true" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:entries="@{viewModel.callsHistory}"
|
||||
app:layout="@{@layout/history_detail_cell}"/>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/wait_layout"
|
||||
bind:visibility="@{viewModel.waitForChatRoomCreation}"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
174
app/src/main/res/layout-sw533dp/history_master_fragment.xml
Normal file
174
app/src/main/res/layout-sw533dp/history_master_fragment.xml
Normal file
|
@ -0,0 +1,174 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="allCallLogsToggleClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="missedCallLogsToggleClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="editClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.history.viewmodels.CallLogsListViewModel" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/tabs_fragment"
|
||||
android:name="org.linphone.activities.main.fragments.TabsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
tools:layout="@layout/tabs_fragment" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@id/tabs_fragment"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="?attr/lightToolbarBackgroundColor"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{allCallLogsToggleClickListener}"
|
||||
android:enabled="@{viewModel.missedCallLogsSelected}"
|
||||
android:contentDescription="@string/content_description_show_all_calls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/history_all" />
|
||||
|
||||
<View
|
||||
android:visibility="@{viewModel.missedCallLogsSelected ? View.GONE : View.VISIBLE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/accentColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2">
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{missedCallLogsToggleClickListener}"
|
||||
android:enabled="@{!viewModel.missedCallLogsSelected}"
|
||||
android:contentDescription="@string/content_description_show_missed_calls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:gravity="center"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/history_missed" />
|
||||
|
||||
<View
|
||||
android:visibility="@{viewModel.missedCallLogsSelected ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/accentColor" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.4" />
|
||||
|
||||
<ImageView
|
||||
android:onClick="@{editClickListener}"
|
||||
android:enabled="@{viewModel.missedCallLogsSelected ? !viewModel.missedCallLogs.empty : !viewModel.callLogs.empty}"
|
||||
android:contentDescription="@string/content_description_enter_edition_mode"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.2"
|
||||
android:background="?attr/button_background_drawable"
|
||||
android:padding="15dp"
|
||||
android:src="@drawable/delete" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/list_edit_top_bar_fragment"
|
||||
android:name="org.linphone.activities.main.fragments.ListTopBarFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignTop="@id/top_bar"
|
||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/callLogsList"
|
||||
android:layout_below="@id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
style="@style/empty_list_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/no_call_history"
|
||||
android:visibility="@{viewModel.callLogs.empty && !viewModel.missedCallLogsSelected ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<TextView
|
||||
style="@style/empty_list_font"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/no_missed_call_history"
|
||||
android:visibility="@{viewModel.missedCallLogs.empty && viewModel.missedCallLogsSelected ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/history_nav_container"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="false"
|
||||
app:navGraph="@navigation/history_nav_graph"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
Loading…
Reference in a new issue