Java Code Examples for org.chromium.chrome.browser.signin.SigninAndSyncView#Listener

The following examples show how to use org.chromium.chrome.browser.signin.SigninAndSyncView#Listener . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecentTabsRowAdapter.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
View getChildView(int childPosition, boolean isLastChild, View convertView,
        ViewGroup parent) {
    if (convertView == null) {
        SigninAndSyncView.Listener listener = new SigninAndSyncView.Listener() {
            @Override
            public void onViewDismissed() {
                mRecentTabsManager.setSigninPromoDeclined();
                notifyDataSetChanged();
            }
        };

        convertView =
                SigninAndSyncView.create(parent, listener, SigninAccessPoint.RECENT_TABS);
    }
    if (!mRecentTabsManager.isSignedIn()) {
        RecordUserAction.record("Signin_Impression_FromRecentTabs");
    }
    return convertView;
}
 
Example 2
Source File: RecentTabsRowAdapter.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
View getChildView(int childPosition, boolean isLastChild, View convertView,
        ViewGroup parent) {
    if (convertView == null) {
        SigninAndSyncView.Listener listener = new SigninAndSyncView.Listener() {
            @Override
            public void onViewDismissed() {
                mRecentTabsManager.setSigninPromoDeclined();
                notifyDataSetChanged();
            }
        };

        convertView =
                SigninAndSyncView.create(parent, listener, SigninAccessPoint.RECENT_TABS);
    }
    if (!mRecentTabsManager.isSignedIn()) {
        RecordUserAction.record("Signin_Impression_FromRecentTabs");
    }
    return convertView;
}
 
Example 3
Source File: BookmarkPromoHeader.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * @return Signin promo header {@link ViewHolder} instance that can be used with
 *         {@link RecyclerView}.
 */
ViewHolder createHolder(ViewGroup parent) {
    SigninAndSyncView.Listener listener = new SigninAndSyncView.Listener() {
        @Override
        public void onViewDismissed() {
            setSigninPromoDeclined();
            updateShouldShow(true);
        }
    };

    SigninAndSyncView view =
            SigninAndSyncView.create(parent, listener, SigninAccessPoint.BOOKMARK_MANAGER);
    // A MarginResizer is used to apply margins in regular and wide display modes. Remove the
    // view's lateral padding so that margins can be used instead.
    ApiCompatibilityUtils.setPaddingRelative(
            view, 0, view.getPaddingTop(), 0, view.getPaddingBottom());
    return new ViewHolder(view) {};
}
 
Example 4
Source File: RecentTabsRowAdapter.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
View getChildView(int childPosition, boolean isLastChild, View convertView,
        ViewGroup parent) {
    if (convertView == null) {
        SigninAndSyncView.Listener listener = new SigninAndSyncView.Listener() {
            @Override
            public void onViewDismissed() {
                mRecentTabsManager.setSigninPromoDeclined();
                notifyDataSetChanged();
            }
        };

        convertView =
                SigninAndSyncView.create(parent, listener, SigninAccessPoint.RECENT_TABS);
    }
    if (!mRecentTabsManager.isSignedIn()) {
        RecordUserAction.record("Signin_Impression_FromRecentTabs");
    }
    return convertView;
}
 
Example 5
Source File: BookmarkPromoHeader.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * @return Signin promo header {@link ViewHolder} instance that can be used with
 *         {@link RecyclerView}.
 */
ViewHolder createHolder(ViewGroup parent) {
    SigninAndSyncView.Listener listener = new SigninAndSyncView.Listener() {
        @Override
        public void onViewDismissed() {
            setSigninPromoDeclined();
            updateShouldShow(true);
        }
    };

    return new ViewHolder(
            SigninAndSyncView.create(parent, listener, SigninAccessPoint.BOOKMARK_MANAGER)) {};
}
 
Example 6
Source File: BookmarkPromoHeader.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * @return Signin promo header {@link ViewHolder} instance that can be used with
 *         {@link RecyclerView}.
 */
ViewHolder createHolder(ViewGroup parent) {
    SigninAndSyncView.Listener listener = new SigninAndSyncView.Listener() {
        @Override
        public void onViewDismissed() {
            setSigninPromoDeclined();
            updateShouldShow(true);
        }
    };

    return new ViewHolder(
            SigninAndSyncView.create(parent, listener, SigninAccessPoint.BOOKMARK_MANAGER)) {};
}