diff options
author | Michael Kolb <kolby@google.com> | 2011-03-02 14:53:15 -0800 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-03-02 14:53:37 -0800 |
commit | e3524d8049879deb11a4f4bbff637872d5b21ce5 (patch) | |
tree | a29d7c9d35d9a50d5dc02c3a3cda354b7eb90b55 | |
parent | 386442409f4e2336d388d4d090c5f3fcb79db7e2 (diff) | |
download | packages_apps_Browser-e3524d8049879deb11a4f4bbff637872d5b21ce5.zip packages_apps_Browser-e3524d8049879deb11a4f4bbff637872d5b21ce5.tar.gz packages_apps_Browser-e3524d8049879deb11a4f4bbff637872d5b21ce5.tar.bz2 |
fix another url bar icon bug
Bug: 3419951
Change-Id: I1d84dfb37d01f76829a5006861f649572d104c4f
-rw-r--r-- | res/layout/url_bar.xml | 9 | ||||
-rw-r--r-- | src/com/android/browser/TitleBarXLarge.java | 28 |
2 files changed, 12 insertions, 25 deletions
diff --git a/res/layout/url_bar.xml b/res/layout/url_bar.xml index 4d8efdd..f2b32c4 100644 --- a/res/layout/url_bar.xml +++ b/res/layout/url_bar.xml @@ -51,19 +51,12 @@ android:orientation="horizontal" android:background="@drawable/url_background"> <ImageView - android:id="@+id/web_icon" + android:id="@+id/url_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:src="@drawable/ic_web_holo_dark" style="@style/HoloIcon" /> <ImageView - android:id="@+id/voice_icon" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:src="@drawable/ic_voice_search_holo_dark" - style="@style/HoloIcon" - android:visibility="gone" /> - <ImageView android:id="@+id/lock" android:layout_width="wrap_content" android:layout_height="match_parent" diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java index 85935a0..14e7c72 100644 --- a/src/com/android/browser/TitleBarXLarge.java +++ b/src/com/android/browser/TitleBarXLarge.java @@ -57,15 +57,14 @@ public class TitleBarXLarge extends TitleBarBase private ImageButton mBackButton; private ImageButton mForwardButton; private ImageView mStar; - private ImageView mWebIcon; - private View mSearchButton; + private ImageView mUrlIcon; + private ImageView mSearchButton; private View mUrlContainer; private View mGoButton; private ImageView mStopButton; private View mAllButton; private View mClearButton; - private View mVoiceSearch; - private View mVoiceSearchIndicator; + private ImageView mVoiceSearch; private PageProgressView mProgressView; private Drawable mFocusDrawable; private Drawable mUnfocusDrawable; @@ -111,17 +110,16 @@ public class TitleBarXLarge extends TitleBarBase // back/forward. Probably should be done inside onPageStarted. mBackButton = (ImageButton) findViewById(R.id.back); mForwardButton = (ImageButton) findViewById(R.id.forward); - mWebIcon = (ImageView) findViewById(R.id.web_icon); + mUrlIcon = (ImageView) findViewById(R.id.url_icon); mStar = (ImageView) findViewById(R.id.star); mStopButton = (ImageView) findViewById(R.id.stop); - mSearchButton = findViewById(R.id.search); + mSearchButton = (ImageView) findViewById(R.id.search); mLockIcon = (ImageView) findViewById(R.id.lock); mGoButton = findViewById(R.id.go); mClearButton = findViewById(R.id.clear); - mVoiceSearch = findViewById(R.id.voicesearch); + mVoiceSearch = (ImageView) findViewById(R.id.voicesearch); mProgressView = (PageProgressView) findViewById(R.id.progress); mUrlContainer = findViewById(R.id.urlbar_focused); - mVoiceSearchIndicator = findViewById(R.id.voice_icon); mBackButton.setOnClickListener(this); mForwardButton.setOnClickListener(this); mStar.setOnClickListener(this); @@ -293,23 +291,21 @@ public class TitleBarXLarge extends TitleBarBase mSearchButton.setVisibility(View.GONE); mStar.setVisibility(View.GONE); mClearButton.setVisibility(View.VISIBLE); - if (mInVoiceMode) { - mVoiceSearchIndicator.setVisibility(View.VISIBLE); - } - mWebIcon.setImageResource(R.drawable.ic_search_holo_dark); + mUrlIcon.setImageResource(R.drawable.ic_search_holo_dark); updateSearchMode(false); } else { mGoButton.setVisibility(View.GONE); mVoiceSearch.setVisibility(View.GONE); mStar.setVisibility(View.VISIBLE); mClearButton.setVisibility(View.GONE); - mVoiceSearchIndicator.setVisibility(View.GONE); if (mUseQuickControls) { mSearchButton.setVisibility(View.GONE); } else { mSearchButton.setVisibility(View.VISIBLE); } - mWebIcon.setImageResource(R.drawable.ic_web_holo_dark); + mUrlIcon.setImageResource(mInVoiceMode ? + R.drawable.ic_search_holo_dark + : R.drawable.ic_web_holo_dark); } } @@ -399,9 +395,7 @@ public class TitleBarXLarge extends TitleBarBase public void setInVoiceMode(boolean voicemode, List<String> voiceResults) { mInVoiceMode = voicemode; mUrlInput.setVoiceResults(voiceResults); - mVoiceSearchIndicator.setVisibility(mInVoiceMode - ? View.VISIBLE : View.GONE); - mWebIcon.setVisibility(mInVoiceMode ? View.GONE : View.VISIBLE); + mUrlIcon.setImageDrawable(mSearchButton.getDrawable()); } @Override |