mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 1007442 - Part 1: Add scrolling to remote tabs tray where applicable. r=bnicholson
This commit is contained in:
parent
943b7aee84
commit
94a7c6f659
@ -4,44 +4,50 @@
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<org.mozilla.gecko.tabspanel.RemoteTabsSetupPanel
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/RemoteTabsPanelChild"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
<LinearLayout android:id="@+id/remote_tabs_setup_containing_layout"
|
||||
style="@style/RemoteTabsPanelChild"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance.Header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_getting_started_welcome_to_sync"/>
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_getting_started_description"/>
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance.Header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_getting_started_welcome_to_sync"/>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_getting_started_description"/>
|
||||
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
</LinearLayout>
|
||||
|
||||
<Button android:id="@+id/remote_tabs_setup_get_started"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/RemoteTabsItem.Button"
|
||||
android:text="@string/fxaccount_getting_started_get_started"
|
||||
android:layout_marginBottom="15dp"/>
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView android:id="@+id/remote_tabs_setup_old_sync_link"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/RemoteTabsItem.TextAppearance.Linkified"
|
||||
android:text="@string/fxaccount_getting_started_old_firefox"/>
|
||||
<Button android:id="@+id/remote_tabs_setup_get_started"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/RemoteTabsItem.Button"
|
||||
android:text="@string/fxaccount_getting_started_get_started"
|
||||
android:layout_marginBottom="15dp"/>
|
||||
|
||||
<TextView android:id="@+id/remote_tabs_setup_old_sync_link"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/RemoteTabsItem.TextAppearance.Linkified"
|
||||
android:text="@string/fxaccount_getting_started_old_firefox"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -4,44 +4,50 @@
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<org.mozilla.gecko.tabspanel.RemoteTabsVerificationPanel
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/RemoteTabsPanelChild"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance.Header.FXAccounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_full_label"
|
||||
android:layout_marginBottom="0dp"/>
|
||||
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance.Header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_confirm_account_header"
|
||||
android:layout_marginTop="0dp"/>
|
||||
|
||||
<TextView android:id="@+id/remote_tabs_confirm_verification"
|
||||
style="@style/RemoteTabsItem.TextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_confirm_account_verification_link"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
<LinearLayout android:id="@+id/remote_tabs_verification_containing_layout"
|
||||
style="@style/RemoteTabsPanelChild"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView android:id="@+id/remote_tabs_confirm_resend"
|
||||
style="@style/RemoteTabsItem.TextAppearance.Linkified.Resend"
|
||||
android:layout_width="match_parent"
|
||||
android:text="@string/fxaccount_confirm_account_resend_email"/>
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance.Header.FXAccounts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_full_label"
|
||||
android:layout_marginBottom="0dp"/>
|
||||
|
||||
<TextView style="@style/RemoteTabsItem.TextAppearance.Header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_confirm_account_header"
|
||||
android:layout_marginTop="0dp"/>
|
||||
|
||||
<TextView android:id="@+id/remote_tabs_confirm_verification"
|
||||
style="@style/RemoteTabsItem.TextAppearance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/fxaccount_confirm_account_verification_link"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout style="@style/RemoteTabsSection"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView android:id="@+id/remote_tabs_confirm_resend"
|
||||
style="@style/RemoteTabsItem.TextAppearance.Linkified.Resend"
|
||||
android:layout_width="match_parent"
|
||||
android:text="@string/fxaccount_confirm_account_resend_email"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -17,13 +17,16 @@ import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
/**
|
||||
* A tabs panel which allows a user to get started setting up a Firefox
|
||||
* Accounts account. Currently used as one sub-panel in a sequence
|
||||
* contained by the {@link RemoteTabsPanel}.
|
||||
*/
|
||||
class RemoteTabsSetupPanel extends LinearLayout implements PanelView {
|
||||
class RemoteTabsSetupPanel extends ScrollView implements PanelView {
|
||||
private LinearLayout containingLayout;
|
||||
|
||||
private TabsPanel tabsPanel;
|
||||
|
||||
public RemoteTabsSetupPanel(Context context, AttributeSet attrs) {
|
||||
@ -34,7 +37,10 @@ class RemoteTabsSetupPanel extends LinearLayout implements PanelView {
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
final View setupGetStartedButton = findViewById(R.id.remote_tabs_setup_get_started);
|
||||
containingLayout = (LinearLayout) findViewById(R.id.remote_tabs_setup_containing_layout);
|
||||
|
||||
final View setupGetStartedButton =
|
||||
containingLayout.findViewById(R.id.remote_tabs_setup_get_started);
|
||||
setupGetStartedButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View v) {
|
||||
@ -47,7 +53,8 @@ class RemoteTabsSetupPanel extends LinearLayout implements PanelView {
|
||||
}
|
||||
});
|
||||
|
||||
final View setupOlderVersionLink = findViewById(R.id.remote_tabs_setup_old_sync_link);
|
||||
final View setupOlderVersionLink =
|
||||
containingLayout.findViewById(R.id.remote_tabs_setup_old_sync_link);
|
||||
setupOlderVersionLink.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View v) {
|
||||
@ -78,6 +85,6 @@ class RemoteTabsSetupPanel extends LinearLayout implements PanelView {
|
||||
|
||||
@Override
|
||||
public boolean shouldExpand() {
|
||||
return getOrientation() == LinearLayout.VERTICAL;
|
||||
return containingLayout.getOrientation() == LinearLayout.VERTICAL;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
@ -21,9 +22,11 @@ import android.widget.TextView;
|
||||
* to confirm a Firefox Account. Currently used as one sub-panel in a sequence
|
||||
* contained by the {@link RemoteTabsPanel}.
|
||||
*/
|
||||
class RemoteTabsVerificationPanel extends LinearLayout implements PanelView {
|
||||
class RemoteTabsVerificationPanel extends ScrollView implements PanelView {
|
||||
private static final String LOG_TAG = RemoteTabsVerificationPanel.class.getSimpleName();
|
||||
|
||||
private LinearLayout containingLayout;
|
||||
|
||||
private TabsPanel tabsPanel;
|
||||
|
||||
public RemoteTabsVerificationPanel(Context context, AttributeSet attrs) {
|
||||
@ -34,7 +37,9 @@ class RemoteTabsVerificationPanel extends LinearLayout implements PanelView {
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
final View resendLink = findViewById(R.id.remote_tabs_confirm_resend);
|
||||
containingLayout = (LinearLayout) findViewById(R.id.remote_tabs_setup_containing_layout);
|
||||
|
||||
final View resendLink = containingLayout.findViewById(R.id.remote_tabs_confirm_resend);
|
||||
resendLink.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -56,7 +61,7 @@ class RemoteTabsVerificationPanel extends LinearLayout implements PanelView {
|
||||
|
||||
private void refresh() {
|
||||
final TextView verificationView =
|
||||
(TextView) findViewById(R.id.remote_tabs_confirm_verification);
|
||||
(TextView) containingLayout.findViewById(R.id.remote_tabs_confirm_verification);
|
||||
final String email = FirefoxAccounts.getFirefoxAccountEmail(getContext());
|
||||
if (email == null) {
|
||||
autoHideTabsPanelOnUnexpectedState("Account email DNE on View refresh.");
|
||||
@ -108,6 +113,6 @@ class RemoteTabsVerificationPanel extends LinearLayout implements PanelView {
|
||||
|
||||
@Override
|
||||
public boolean shouldExpand() {
|
||||
return getOrientation() == LinearLayout.VERTICAL;
|
||||
return containingLayout.getOrientation() == LinearLayout.VERTICAL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user