Remove padding between top divider and wifi list

We need View in addtion to ProgressBar, since the latter doesn't
allow us to control its padding on the bottom.

Bug: 3443287
Change-Id: I1f8fb8eca11d52d9c18866301553110c2147b3ef
This commit is contained in:
Daisuke Miyakawa
2011-02-10 11:54:06 -08:00
parent 4cdb398787
commit beec0b2da6
2 changed files with 33 additions and 3 deletions

View File

@@ -52,7 +52,7 @@
android:gravity="bottom"/> android:gravity="bottom"/>
<!-- Divider --> <!-- Divider -->
<RelativeLayout <FrameLayout
android:id="@+id/top_divider" android:id="@+id/top_divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -62,7 +62,15 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal" /> style="?android:attr/progressBarStyleHorizontal" />
</RelativeLayout> <View
android:id="@+id/top_divider_no_progress"
android:layout_width="match_parent"
android:layout_height="3dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="0dip"
android:background="@color/divider_color"
android:visibility="gone" />
</FrameLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/content" android:id="@+id/content"
@@ -70,7 +78,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/top_divider" android:layout_below="@id/top_divider"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dip"
android:layout_marginBottom="0dip"> android:layout_marginBottom="0dip">
<FrameLayout <FrameLayout
@@ -89,17 +96,20 @@
android:minWidth="406dip" android:minWidth="406dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="160dip" android:minHeight="160dip"
android:layout_marginTop="10dip"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:visibility="gone" /> android:visibility="gone" />
<View <View
android:id="@+id/wifi_config_padding" android:id="@+id/wifi_config_padding"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="360dip" android:layout_height="360dip"
android:layout_marginTop="10dip"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/connecting_status_layout" android:id="@+id/connecting_status_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="360dip" android:layout_height="360dip"
android:layout_marginTop="10dip"
android:visibility="gone"> android:visibility="gone">
<TextView <TextView
android:id="@+id/connecting_status" android:id="@+id/connecting_status"

View File

@@ -89,6 +89,7 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
private CharSequence mEditingTitle; private CharSequence mEditingTitle;
private ProgressBar mProgressBar; private ProgressBar mProgressBar;
private View mTopDividerNoProgress;
private WifiSettings mWifiSettings; private WifiSettings mWifiSettings;
private Button mAddNetworkButton; private Button mAddNetworkButton;
@@ -171,8 +172,11 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
mTitleView = (TextView)findViewById(R.id.wifi_setup_title); mTitleView = (TextView)findViewById(R.id.wifi_setup_title);
mProgressBar = (ProgressBar)findViewById(R.id.scanning_progress_bar); mProgressBar = (ProgressBar)findViewById(R.id.scanning_progress_bar);
mProgressBar.setMax(2); mProgressBar.setMax(2);
mTopDividerNoProgress = findViewById(R.id.top_divider_no_progress);
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(true); mProgressBar.setIndeterminate(true);
mTopDividerNoProgress.setVisibility(View.GONE);
mAddNetworkButton = (Button)findViewById(R.id.wifi_setup_add_network); mAddNetworkButton = (Button)findViewById(R.id.wifi_setup_add_network);
mAddNetworkButton.setOnClickListener(this); mAddNetworkButton.setOnClickListener(this);
@@ -258,10 +262,14 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
// Let users know the device is working correctly though currently there's // Let users know the device is working correctly though currently there's
// no visible network on the list. // no visible network on the list.
if (mWifiSettings.getAccessPointsCount() == 0) { if (mWifiSettings.getAccessPointsCount() == 0) {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(true); mProgressBar.setIndeterminate(true);
mTopDividerNoProgress.setVisibility(View.GONE);
} else { } else {
// Users already connected to a network, or see available networks. // Users already connected to a network, or see available networks.
mProgressBar.setVisibility(View.GONE);
mProgressBar.setIndeterminate(false); mProgressBar.setIndeterminate(false);
mTopDividerNoProgress.setVisibility(View.VISIBLE);
} }
break; break;
} }
@@ -286,8 +294,10 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
} }
private void showDisconnectedState(String stateString) { private void showDisconnectedState(String stateString) {
mProgressBar.setVisibility(View.GONE);
mProgressBar.setIndeterminate(false); mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(0); mProgressBar.setProgress(0);
mTopDividerNoProgress.setVisibility(View.VISIBLE);
mAddNetworkButton.setEnabled(true); mAddNetworkButton.setEnabled(true);
mRefreshButton.setEnabled(true); mRefreshButton.setEnabled(true);
@@ -300,8 +310,10 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
// We save this title and show it when authentication failed. // We save this title and show it when authentication failed.
mEditingTitle = mTitleView.getText(); mEditingTitle = mTitleView.getText();
showConnectingTitle(); showConnectingTitle();
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(false); mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(1); mProgressBar.setProgress(1);
mTopDividerNoProgress.setVisibility(View.GONE);
setPaddingVisibility(View.VISIBLE); setPaddingVisibility(View.VISIBLE);
} }
@@ -317,8 +329,10 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
trySetBackground(R.drawable.setups_bg_complete); trySetBackground(R.drawable.setups_bg_complete);
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(false); mProgressBar.setIndeterminate(false);
mProgressBar.setProgress(2); mProgressBar.setProgress(2);
mTopDividerNoProgress.setVisibility(View.GONE);
showConnectedTitle(); showConnectedTitle();
@@ -385,7 +399,9 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
} }
private void showScanningStatus() { private void showScanningStatus() {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(true); mProgressBar.setIndeterminate(true);
mTopDividerNoProgress.setVisibility(View.GONE);
mAddNetworkButton.setEnabled(false); mAddNetworkButton.setEnabled(false);
mRefreshButton.setEnabled(false); mRefreshButton.setEnabled(false);
} }
@@ -569,7 +585,9 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
// Wifi list becomes empty for a moment. We show "scanning" effect to a user so that // Wifi list becomes empty for a moment. We show "scanning" effect to a user so that
// he/she won't be astonished there. This stops once the scan finishes. // he/she won't be astonished there. This stops once the scan finishes.
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(true); mProgressBar.setIndeterminate(true);
mTopDividerNoProgress.setVisibility(View.GONE);
// Remembered networks may be re-used during SetupWizard, which confuse users. // Remembered networks may be re-used during SetupWizard, which confuse users.
// We force the module to forget them to reduce UX complexity // We force the module to forget them to reduce UX complexity
@@ -621,7 +639,9 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
// If we already show some of access points but the bar still shows "scanning" state, it // If we already show some of access points but the bar still shows "scanning" state, it
// should be stopped. // should be stopped.
if (mProgressBar.isIndeterminate() && accessPoints.size() > 0) { if (mProgressBar.isIndeterminate() && accessPoints.size() > 0) {
mProgressBar.setVisibility(View.GONE);
mProgressBar.setIndeterminate(false); mProgressBar.setIndeterminate(false);
mTopDividerNoProgress.setVisibility(View.VISIBLE);
mAddNetworkButton.setEnabled(true); mAddNetworkButton.setEnabled(true);
mRefreshButton.setEnabled(true); mRefreshButton.setEnabled(true);
} }