use of org.chromium.chrome.browser.widget.FadingShadowView in project AndroidChromium by JackyAndroid.
the class BookmarkContentView method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mItemsContainer = (BookmarkRecyclerView) findViewById(R.id.bookmark_items_container);
TextView emptyView = (TextView) findViewById(R.id.bookmark_empty_view);
emptyView.setText(R.string.bookmarks_folder_empty);
mItemsContainer.setEmptyView(emptyView);
mActionBar = (BookmarkActionBar) findViewById(R.id.bookmark_action_bar);
mLoadingView = (LoadingView) findViewById(R.id.bookmark_initial_loading_view);
FadingShadowView shadow = (FadingShadowView) findViewById(R.id.shadow);
if (DeviceFormFactor.isLargeTablet(getContext())) {
shadow.setVisibility(View.GONE);
} else {
shadow.init(ApiCompatibilityUtils.getColor(getResources(), R.color.toolbar_shadow_color), FadingShadow.POSITION_TOP);
}
}
use of org.chromium.chrome.browser.widget.FadingShadowView in project AndroidChromium by JackyAndroid.
the class EditorView method prepareToolbar.
/**
* Prepares the toolbar for use.
*
* Many of the things that would ideally be set as attributes don't work and need to be set
* programmatically. This is likely due to how we compile the support libraries.
*/
private void prepareToolbar() {
EditorDialogToolbar toolbar = (EditorDialogToolbar) mLayout.findViewById(R.id.action_bar);
toolbar.setTitle(mEditorModel.getTitle());
toolbar.setTitleTextColor(Color.WHITE);
toolbar.setShowDeleteMenuItem(false);
// Show the help article when the user asks.
toolbar.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
launchAutofillHelpPage(mContext);
return true;
}
});
// Cancel editing when the user hits the back arrow.
toolbar.setNavigationContentDescription(R.string.cancel);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
cancelEdit();
}
});
// Make it appear that the toolbar is floating by adding a shadow.
FadingShadowView shadow = (FadingShadowView) mLayout.findViewById(R.id.shadow);
shadow.init(ApiCompatibilityUtils.getColor(mContext.getResources(), R.color.toolbar_shadow_color), FadingShadow.POSITION_TOP);
// The top shadow is handled by the toolbar, so hide the one used in the field editor.
FadingEdgeScrollView scrollView = (FadingEdgeScrollView) mLayout.findViewById(R.id.scroll_view);
scrollView.setShadowVisibility(false, true);
}
use of org.chromium.chrome.browser.widget.FadingShadowView in project AndroidChromium by JackyAndroid.
the class ListUrlsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
setContentView(R.layout.physical_web_list_urls_activity);
initSharedPreferences();
mAdapter = new NearbyUrlsAdapter(this);
View emptyView = findViewById(R.id.physical_web_empty);
mListView = (ListView) findViewById(R.id.physical_web_urls_list);
mListView.setEmptyView(emptyView);
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(this);
mEmptyListText = (TextView) findViewById(R.id.physical_web_empty_list_text);
mScanningImageView = (ImageView) findViewById(R.id.physical_web_logo);
mSwipeRefreshWidget = (SwipeRefreshWidget) findViewById(R.id.physical_web_swipe_refresh_widget);
mSwipeRefreshWidget.setOnRefreshListener(this);
mBottomBar = findViewById(R.id.physical_web_bottom_bar);
int shadowColor = ApiCompatibilityUtils.getColor(getResources(), R.color.bottom_bar_shadow_color);
FadingShadowView shadow = (FadingShadowView) findViewById(R.id.physical_web_bottom_bar_shadow);
shadow.init(shadowColor, FadingShadow.POSITION_BOTTOM);
View bottomBarClose = (View) findViewById(R.id.physical_web_bottom_bar_close);
bottomBarClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hideBottomBar();
}
});
mPwsClient = new PwsClientImpl(this);
int referer = getIntent().getIntExtra(REFERER_KEY, 0);
if (savedInstanceState == null) {
// Ensure this is a newly-created activity.
PhysicalWebUma.onActivityReferral(this, referer);
}
mIsInitialDisplayRecorded = false;
mIsRefreshing = false;
mIsRefreshUserInitiated = false;
mNearbyForegroundSubscription = new NearbyForegroundSubscription(this);
}
Aggregations