bug 711184 - make sure we don't do any work creating about:home if we're not showing about:home r=dougt

This commit is contained in:
Brad Lassey 2011-12-16 16:17:57 -05:00
parent c76192df95
commit a3df325117
3 changed files with 10 additions and 15 deletions

View File

@ -62,6 +62,7 @@ import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@ -161,6 +162,10 @@ public class AboutHomeContent extends ScrollView {
}
void init(final Activity activity) {
LayoutInflater inflater =
(LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.abouthome_content, this);
GeckoAppShell.getHandler().post(new Runnable() {
public void run() {
if (mCursor != null)

View File

@ -1000,8 +1000,8 @@ abstract public class GeckoApp
public void run() {
mAutoCompletePopup.hide();
if (mAboutHomeContent == null) {
mAboutHomeContent = (AboutHomeContent) findViewById(R.id.abouthome_content);
if (mAboutHomeContent == null && mShow) {
mAboutHomeContent = new AboutHomeContent(GeckoApp.mAppContext, null);
mAboutHomeContent.init(GeckoApp.mAppContext);
mAboutHomeContent.setUriLoadCallback(new AboutHomeContent.UriLoadCallback() {
public void callback(String url) {
@ -1009,7 +1009,9 @@ abstract public class GeckoApp
loadUrl(url, AwesomeBar.Type.EDIT);
}
});
mGeckoLayout.addView(mAboutHomeContent);
}
if (mAboutHomeContent != null)
mAboutHomeContent.setVisibility(mShow ? View.VISIBLE : View.GONE);
}
}

View File

@ -20,18 +20,6 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<org.mozilla.gecko.AboutHomeContent android:id="@+id/abouthome_content"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:isScrollContainer="true"
android:visibility="gone">
<include layout="@layout/abouthome_content"/>
</org.mozilla.gecko.AboutHomeContent>
<org.mozilla.gecko.AutoCompletePopup android:id="@+id/autocomplete_popup"
style="@android:style/Widget.ListView.White"
android:layout_width="fill_parent"