зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1386975 - Part 2: Fix Robocop/Mochitest-chrome errors when Photon is enabled. r=maliu,nalexander,sebastian
MozReview-Commit-ID: FszicKMWywf --HG-- extra : rebase_source : a963060986941e8518a1e278c6699cfe18549212
This commit is contained in:
Родитель
51ea6f24b7
Коммит
dd509b472e
|
@ -18,6 +18,7 @@ import android.view.View;
|
|||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.view.animation.AnimationSet;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ViewSwitcher;
|
||||
|
||||
public class TabCounter extends ThemedTextSwitcher
|
||||
|
@ -75,6 +76,10 @@ public class TabCounter extends ThemedTextSwitcher
|
|||
}
|
||||
}
|
||||
|
||||
public CharSequence getText() {
|
||||
return ((TextView) getCurrentView()).getText();
|
||||
}
|
||||
|
||||
void setCountWithAnimation(int count) {
|
||||
// Don't animate from initial state
|
||||
if (mCount == 0) {
|
||||
|
|
|
@ -51,6 +51,10 @@ public class TabCounter extends ThemedRelativeLayout {
|
|||
animationSet = createAnimatorSet();
|
||||
}
|
||||
|
||||
public CharSequence getText() {
|
||||
return text.getText();
|
||||
}
|
||||
|
||||
private AnimatorSet createAnimatorSet() {
|
||||
final AnimatorSet animatorSet = new AnimatorSet();
|
||||
createBoxAnimatorSet(animatorSet);
|
||||
|
|
|
@ -47,6 +47,6 @@
|
|||
android:duplicateParentState="true"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/tab_close"
|
||||
android:tint="@color/tab_strip_item_title"/>
|
||||
gecko:drawableTintList="@color/tab_strip_item_title"/>
|
||||
|
||||
</merge>
|
||||
|
|
|
@ -8,9 +8,10 @@ import android.app.Activity;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextSwitcher;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.mozilla.gecko.toolbar.TabCounter;
|
||||
|
||||
public class FennecNativeElement implements Element {
|
||||
private final Activity mActivity;
|
||||
private final Integer mId;
|
||||
|
@ -66,9 +67,9 @@ public class FennecNativeElement implements Element {
|
|||
if (v instanceof EditText) {
|
||||
EditText et = (EditText)v;
|
||||
mText = et.getEditableText();
|
||||
} else if (v instanceof TextSwitcher) {
|
||||
TextSwitcher ts = (TextSwitcher)v;
|
||||
mText = ((TextView)ts.getCurrentView()).getText();
|
||||
} else if (v instanceof TabCounter) {
|
||||
TabCounter tc = (TabCounter)v;
|
||||
mText = tc.getText();
|
||||
} else if (v instanceof ViewGroup) {
|
||||
ViewGroup vg = (ViewGroup)v;
|
||||
for (int i = 0; i < vg.getChildCount(); i++) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.mozilla.gecko.tests.helpers.DeviceHelper;
|
|||
import org.mozilla.gecko.tests.helpers.NavigationHelper;
|
||||
import org.mozilla.gecko.tests.helpers.WaitHelper;
|
||||
import org.mozilla.gecko.toolbar.PageActionLayout;
|
||||
import org.mozilla.gecko.toolbar.TabCounter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
|
@ -116,13 +117,12 @@ public class ToolbarComponent extends BaseComponent {
|
|||
return (TextView) getToolbarView().findViewById(R.id.url_bar_title);
|
||||
}
|
||||
|
||||
private TextSwitcher getTabsCounter() {
|
||||
return (TextSwitcher) getToolbarView().findViewById(R.id.tabs_counter);
|
||||
private TabCounter getTabsCounter() {
|
||||
return (TabCounter) getToolbarView().findViewById(R.id.tabs_counter);
|
||||
}
|
||||
|
||||
private int getTabsCount() {
|
||||
TextView currentView = (TextView) getTabsCounter().getCurrentView();
|
||||
String tabsCountText = currentView.getText().toString();
|
||||
String tabsCountText = getTabsCounter().getText().toString();
|
||||
return Integer.parseInt(tabsCountText);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче