[Android] Added new view for new tab page

This is is to avoid null pointer exception

Chromium change:
https://chromium.googlesource.com/chromium/src/+/efb886565e933f36643147e9c9ee7ce19dc17bce

Cryptids: Injecting view into NTP logo space

This adds a GIF view that will eventually be used for cryptid rendering.

The general approach is:
* The existing logo is wrapped in a FrameLayout with a new ViewStub.
* When we get a callback indicating that no doodle is present, the NTP
  requests a drawable from the PCR and injects it into an ImageView
  inflated from the ViewStub.

Out-of-scope for this CL is to actually populate the GIF image data; I
have been testing locally with a res/raw file read into a byte array.

Change-Id: Ib5deae5322856c9d8e8a68f0fd46cdb2aaadbe79
Bug: 1061949
This commit is contained in:
samartnik
2020-09-11 14:45:31 -04:00
committed by Max Karolinskiy
parent d905691d49
commit 60de48a04f
@@ -48,6 +48,30 @@
</FrameLayout>
<FrameLayout
android:id="@+id/logo_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ViewStub
android:id="@+id/cryptid_holder"
android:layout="@layout/new_tab_page_cryptid_holder"
android:layout_width="@dimen/cryptid_width_in_logo_wrapper"
android:layout_height="@dimen/cryptid_height_in_logo_wrapper"
android:layout_gravity="bottom|start" />
<org.chromium.chrome.browser.ntp.LogoView
android:id="@+id/search_provider_logo"
android:layout_width="wrap_content"
android:layout_height="@dimen/ntp_logo_height"
android:layout_gravity="center_horizontal"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="@dimen/ntp_logo_margin_top"
android:layout_marginBottom="23dp" />
</FrameLayout>
<LinearLayout
android:id="@+id/parent_layout"
android:layout_width="match_parent"