зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1348718 - Use cross icon as close button r=sebastian
Move this change to ActionBarPresenter. Use cross icon as close button to match design spec. MozReview-Commit-ID: JgUcKp7p7Bc --HG-- extra : rebase_source : 8350b2d8684cd967cb7463949017c26db4ef1782
This commit is contained in:
Родитель
1338acd53a
Коммит
da67ae40c0
|
@ -8,6 +8,7 @@ package org.mozilla.gecko.customtabs;
|
|||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.ColorInt;
|
||||
|
@ -73,6 +74,8 @@ public class ActionBarPresenter {
|
|||
mIdentityPopup.show();
|
||||
}
|
||||
});
|
||||
|
||||
initIndicator();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,6 +129,7 @@ public class ActionBarPresenter {
|
|||
|
||||
/**
|
||||
* To assign a long-click-listener to text area of ActionBar
|
||||
*
|
||||
* @param listener then callback to trigger
|
||||
*/
|
||||
public void setTextLongClickListener(View.OnLongClickListener listener) {
|
||||
|
@ -143,6 +147,13 @@ public class ActionBarPresenter {
|
|||
return mTextPrimaryColor;
|
||||
}
|
||||
|
||||
private void initIndicator() {
|
||||
mActionBar.setDisplayHomeAsUpEnabled(true);
|
||||
final Drawable icon = mActionBar.getThemedContext().getDrawable(R.drawable.ic_close_light);
|
||||
DrawableCompat.setTint(icon, mTextPrimaryColor);
|
||||
mActionBar.setHomeAsUpIndicator(icon);
|
||||
}
|
||||
|
||||
/**
|
||||
* To update appearance of CustomView of ActionBar, includes its icon, title and url text.
|
||||
*
|
||||
|
|
|
@ -94,7 +94,6 @@ public class CustomTabsActivity extends GeckoApp implements Tabs.OnTabsChangedLi
|
|||
actionBarPresenter.displayUrlOnly(startIntent.getDataString());
|
||||
actionBarPresenter.setBackgroundColor(IntentUtil.getToolbarColor(startIntent), getWindow());
|
||||
actionBarPresenter.setTextLongClickListener(new UrlCopyListener());
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
Tabs.registerOnTabsChangedListener(this);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче