зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
944da30fea
Коммит
27de3ebe09
|
@ -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)
|
||||
|
|
|
@ -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,8 +1009,10 @@ abstract public class GeckoApp
|
|||
loadUrl(url, AwesomeBar.Type.EDIT);
|
||||
}
|
||||
});
|
||||
mGeckoLayout.addView(mAboutHomeContent);
|
||||
}
|
||||
mAboutHomeContent.setVisibility(mShow ? View.VISIBLE : View.GONE);
|
||||
if (mAboutHomeContent != null)
|
||||
mAboutHomeContent.setVisibility(mShow ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче