Bug 1379066 - 7. Stop button supports Private mode r=jwu

Stop button is in Awesome bar to stop page loading, to let it becomes
ThemedImageButton to support Private mode.

MozReview-Commit-ID: CzbCyx1Mxc4

--HG--
extra : rebase_source : e21de93ca83eb3ed470bc2ede5a090c9e77ff5f7
This commit is contained in:
Julian_Chu 2017-07-06 16:28:11 +08:00
Родитель de3e7cc58e
Коммит 921b639b1b
2 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -48,11 +48,10 @@
android:orientation="horizontal"
android:visibility="gone" />
<ImageButton
<org.mozilla.gecko.widget.themed.ThemedImageButton
android:id="@+id/stop"
android:layout_width="@dimen/page_action_button_width"
android:layout_height="match_parent"
android:background="#00ffffff"
style="@style/UrlBar.ImageButton"
android:background="@drawable/action_bar_button"
android:contentDescription="@string/stop"
android:src="@drawable/urlbar_stop"
android:visibility="gone" />

Просмотреть файл

@ -19,6 +19,7 @@ import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.skin.SkinConfig;
import org.mozilla.gecko.toolbar.BrowserToolbarTabletBase.ForwardButtonAnimation;
import org.mozilla.gecko.Experiments;
import org.mozilla.gecko.util.HardwareUtils;
@ -105,7 +106,6 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
private OnTitleChangeListener mTitleChangeListener;
private final ThemedImageButton mSiteSecurity;
private final ImageButton mStop;
private OnStopListener mStopListener;
@ -170,6 +170,12 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
mSiteSecurity.setPrivateMode(isPrivate);
// Bug 1375351 should change class type to ThemedImageButton to avoid casting
if (SkinConfig.isPhoton()) {
((ThemedImageButton)mStop).setPrivateMode(isPrivate);
}
mPageActionLayout.setPrivateMode(isPrivate);
}
@ -427,7 +433,7 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
mTitle.setPadding(0, 0, (!isShowingProgress ? mTitlePadding : 0), 0);
}
List<View> getFocusOrder() {
List<? extends View> getFocusOrder() {
return Arrays.asList(mSiteSecurity, mPageActionLayout, mStop);
}