Revision control

Copy as Markdown

<?xml version="1.0" encoding="utf-8"?>
<data>
<variable
name="isAccountsUIEnabled"
type="boolean" />
<variable
name="isEmpty"
type="boolean" />
<variable
name="isSignedIn"
type="boolean" />
<variable
name="isSyncEnabled"
type="boolean" />
<variable
name="lastSync"
type="long" />
<variable
name="isSyncing"
type="boolean" />
<variable
name="isNarrow"
type="boolean" />
<variable
name="callback"
type="org.mozilla.vrbrowser.ui.callbacks.HistoryCallback" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:visibleGone="@{!isNarrow &amp;&amp; !isEmpty}">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/syncDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/buttons_layout"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:textColor="@color/rhino"
android:textSize="@dimen/text_medium_size"
android:textStyle="italic"
android:text="@{!isSyncEnabled ? @string/fxa_account_syncing_off : null}"
app:lastSync="@{lastSync}"
app:visibleGone="@{isAccountsUIEnabled &amp;&amp; isSignedIn &amp;&amp; isSyncEnabled &amp;&amp; !isSyncing}"/>
<FrameLayout
android:id="@+id/buttons_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toStartOf="@+id/clearButton"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
visibleGone="@{isAccountsUIEnabled}">
<Button
android:id="@+id/syncButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:enabled="@{isSyncEnabled &amp;&amp; !isSyncing}"
android:background="@drawable/content_panel_button_background"
android:drawableStart="@{isSyncing ? null : @drawable/ic_icon_settings_sign_in}"
android:drawableTint="@color/library_panel_button_text_color"
android:drawablePadding="5dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:onClick="@{(view) -> callback != null ? callback.onSyncHistory(view) : void}"
android:padding="5dp"
android:text="@{isSyncing ? @string/fxa_syncing : @string/fxa_sync}"
android:textColor="@color/library_panel_button_text_color"
android:textSize="18sp"
android:textStyle="bold"
app:visibleGone="@{isSignedIn &amp;&amp; isSyncEnabled}"/>
<Button
android:id="@+id/loginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:background="@drawable/content_panel_button_background"
android:drawableStart="@drawable/ic_icon_settings_sign_in"
android:drawableTint="@color/library_panel_button_text_color"
android:drawablePadding="5dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:onClick="@{(view) -> callback != null ? callback.onFxALogin(view) : void}"
android:padding="5dp"
android:text="@string/fxa_account_sing_to_sync"
android:textColor="@color/library_panel_button_text_color"
android:textSize="18sp"
android:textStyle="bold"
app:visibleGone="@{!isSignedIn}"/>
<Button
android:id="@+id/syncSettingsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:background="@drawable/content_panel_button_background"
android:drawableStart="@drawable/ic_icon_settings_sign_in"
android:drawableTint="@color/library_panel_button_text_color"
android:drawablePadding="5dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:onClick="@{(view) -> callback != null ? callback.onFxASynSettings(view) : void}"
android:padding="5dp"
android:text="@string/fxa_account_sync_settings"
android:textColor="@color/library_panel_button_text_color"
android:textSize="18sp"
android:textStyle="bold"
app:visibleGone="@{isSignedIn &amp;&amp; !isSyncEnabled}"/>
</FrameLayout>
<Button
android:id="@+id/clearButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/content_panel_button_background"
android:fontFamily="sans-serif"
android:gravity="center"
android:onClick="@{(view) -> callback != null ? callback.onClearHistory(view) : void}"
android:padding="5dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:text="@string/history_clear"
android:textColor="@color/library_panel_button_text_color"
android:textSize="18sp"
android:textStyle="bold"
android:enabled="@{!isEmpty}"/>
</RelativeLayout>
</LinearLayout>
</layout>