diff --git a/mobile/android/base/home/HomePager.java b/mobile/android/base/home/HomePager.java index b885692034c..81f3b7e7b44 100644 --- a/mobile/android/base/home/HomePager.java +++ b/mobile/android/base/home/HomePager.java @@ -14,6 +14,7 @@ import org.mozilla.gecko.home.HomeConfig.PanelType; import org.mozilla.gecko.util.HardwareUtils; import android.content.Context; +import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -51,6 +52,9 @@ public class HomePager extends ViewPager { // Whether or not we need to restart the loader when we show the HomePager. private boolean mRestartLoader; + // Cached original ViewPager background. + private final Drawable mOriginalBackground; + // This is mostly used by UI tests to easily fetch // specific list views at runtime. static final String LIST_TAG_HISTORY = "history"; @@ -122,6 +126,8 @@ public class HomePager extends ViewPager { // ensure there is always a focusable view. This would ordinarily be done via an XML // attribute, but it is not working properly. setFocusableInTouchMode(true); + + mOriginalBackground = getBackground(); } @Override @@ -310,9 +316,18 @@ public class HomePager extends ViewPager { // Update the adapter with the new panel configs adapter.update(enabledPanels); - // Hide the tab strip if the new configuration contains no panels. final int count = enabledPanels.size(); - mTabStrip.setVisibility(count > 0 ? View.VISIBLE : View.INVISIBLE); + if (count == 0) { + // Set firefox watermark as background. + setBackgroundResource(R.drawable.home_pager_empty_state); + // Hide the tab strip as there are no panels. + mTabStrip.setVisibility(View.INVISIBLE); + } else { + mTabStrip.setVisibility(View.VISIBLE); + // Restore original background. + setBackground(mOriginalBackground); + } + // Re-install the adapter with the final state // in the pager. setAdapter(adapter); diff --git a/mobile/android/base/resources/drawable-hdpi/icon_home_empty_firefox.png b/mobile/android/base/resources/drawable-hdpi/icon_home_empty_firefox.png new file mode 100644 index 00000000000..e59641f68a4 Binary files /dev/null and b/mobile/android/base/resources/drawable-hdpi/icon_home_empty_firefox.png differ diff --git a/mobile/android/base/resources/drawable-mdpi/icon_home_empty_firefox.png b/mobile/android/base/resources/drawable-mdpi/icon_home_empty_firefox.png new file mode 100644 index 00000000000..18ae78dcd11 Binary files /dev/null and b/mobile/android/base/resources/drawable-mdpi/icon_home_empty_firefox.png differ diff --git a/mobile/android/base/resources/drawable-xhdpi/icon_home_empty_firefox.png b/mobile/android/base/resources/drawable-xhdpi/icon_home_empty_firefox.png new file mode 100644 index 00000000000..e4d44619b9d Binary files /dev/null and b/mobile/android/base/resources/drawable-xhdpi/icon_home_empty_firefox.png differ diff --git a/mobile/android/base/resources/drawable/home_pager_empty_state.xml b/mobile/android/base/resources/drawable/home_pager_empty_state.xml new file mode 100644 index 00000000000..71389ebc63b --- /dev/null +++ b/mobile/android/base/resources/drawable/home_pager_empty_state.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file