diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2020-03-31 02:07:24 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-03-31 02:07:24 +0000 |
| commit | 39ab29969f7989f25e8e4a66860578df5f4d34d6 (patch) | |
| tree | 781aed02d1875be510ee21ae823cfd9d741f63fa | |
| parent | ea1d793894b9f7e0c5514da93f6e2cc8f6b98d08 (diff) | |
| parent | d2a4a0f5f1cfa8340c242f4f99f12c67dddb6dc5 (diff) | |
| download | platform_packages_apps_Car_LinkViewer-android11-tests-release.tar.gz platform_packages_apps_Car_LinkViewer-android11-tests-release.tar.bz2 platform_packages_apps_Car_LinkViewer-android11-tests-release.zip | |
Snap for 6348860 from d2a4a0f5f1cfa8340c242f4f99f12c67dddb6dc5 to rvc-releaseandroid-vts-11.0_r1android-cts-11.0_r1android-11.0.0_r3android-11.0.0_r2android-11.0.0_r17android-11.0.0_r1android11-tests-releaseandroid11-releaseandroid11-gsi
Change-Id: I8b4aaad3e2167caa39d09a1e2f40ad7d5db7458d
| -rw-r--r-- | res/layout/link_viewer_activity.xml | 9 | ||||
| -rw-r--r-- | res/values/themes.xml | 2 | ||||
| -rw-r--r-- | src/com/android/car/linkviewer/LinkViewerActivity.java | 9 |
3 files changed, 11 insertions, 9 deletions
diff --git a/res/layout/link_viewer_activity.xml b/res/layout/link_viewer_activity.xml index 581abf7..21b943f 100644 --- a/res/layout/link_viewer_activity.xml +++ b/res/layout/link_viewer_activity.xml @@ -21,19 +21,12 @@ android:layout_height="match_parent" android:background="@android:color/black"> - <com.android.car.ui.toolbar.Toolbar - android:id="@+id/car_toolbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:title="@string/app_name" - app:car_ui_state="subpage"/> - <TextView style="?android:attr/textAppearanceLarge" android:id="@+id/url_text" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@id/car_toolbar" + android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:maxLines="1" android:ellipsize="end" /> diff --git a/res/values/themes.xml b/res/values/themes.xml index c8c2c56..1fdd264 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -15,5 +15,5 @@ --> <resources> <!-- The theme for the LinkViewerActivity. --> - <style name="AppTheme" parent="Theme.CarUi"/> + <style name="AppTheme" parent="Theme.CarUi.WithToolbar"/> </resources> diff --git a/src/com/android/car/linkviewer/LinkViewerActivity.java b/src/com/android/car/linkviewer/LinkViewerActivity.java index 7bd43c0..4990af6 100644 --- a/src/com/android/car/linkviewer/LinkViewerActivity.java +++ b/src/com/android/car/linkviewer/LinkViewerActivity.java @@ -17,6 +17,9 @@ package com.android.car.linkviewer; +import static com.android.car.ui.core.CarUi.requireToolbar; +import static com.android.car.ui.toolbar.Toolbar.State.SUBPAGE; + import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; @@ -27,6 +30,8 @@ import android.util.Log; import android.widget.ImageView; import android.widget.TextView; +import com.android.car.ui.toolbar.ToolbarController; + import com.google.zxing.WriterException; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import com.google.zxing.qrcode.encoder.ByteMatrix; @@ -48,6 +53,10 @@ public class LinkViewerActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + ToolbarController toolbar = requireToolbar(this); + toolbar.setTitle(R.string.app_name); + toolbar.setState(SUBPAGE); + String url = getUrlFromIntent(getIntent()); if (url == null) { finish(); |
