@@ -0,0 +1,3603 @@
+package com.box.androidsdk.browse.uidata;%0A%0Aimport android.content.Context;%0Aimport android.graphics.Color;%0Aimport android.os.Bundle;%0Aimport android.os.Parcelable;%0Aimport android.support.v7.widget.SearchView;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0Aimport android.view.inputmethod.EditorInfo;%0A%0Aimport com.box.androidsdk.browse.R;%0A%0A/**%0A * Custom Search view to support new search design%0A */%0Apublic class BoxCustomSearchView extends SearchView %7B%0A%0A    private BoxCustomSearchListener mBoxCustomSearchListener;%0A%0A    public BoxCustomSearchView(final Context context)%7B%0A        super(context);%0A        initSearchView(context);%0A    %7D%0A%0A    public BoxCustomSearchView(final Context context, final AttributeSet attrs)%7B%0A        super(context, attrs);%0A        initSearchView(context);%0A    %7D%0A%0A    private void initSearchView(final Context context)%7B%0A%0A        findViewById(R.id.search_plate).setBackgroundColor(Color.TRANSPARENT);%0A        setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI %7C EditorInfo.IME_ACTION_SEARCH%7C EditorInfo.IME_FLAG_NO_FULLSCREEN);%0A        setQueryHint(context.getString(R.string.box_browsesdk_search_hint));%0A        this.setOnQueryTextListener(new OnQueryTextListener() %7B%0A            @Override%0A            public boolean onQueryTextSubmit(String query) %7B%0A%0A                mBoxCustomSearchListener.onQueryTextSubmit(query);%0A%0A                // Don't perform default action, return true%0A                return true;%0A            %7D%0A%0A            @Override%0A            public boolean onQueryTextChange(String newText) %7B%0A%0A                mBoxCustomSearchListener.onQueryTextChange(newText);%0A%0A                // Don't perform default action, return true%0A                return true;%0A            %7D%0A        %7D);%0A%0A        this.setOnSearchClickListener(new OnClickListener() %7B%0A            @Override%0A            public void onClick(View v) %7B%0A                mBoxCustomSearchListener.onSearchExpanded();%0A            %7D%0A        %7D);%0A%0A        this.setOnCloseListener(new OnCloseListener() %7B%0A            @Override%0A            public boolean onClose() %7B%0A                mBoxCustomSearchListener.onSearchCollapsed();%0A                return false;%0A            %7D%0A        %7D);%0A    %7D%0A%0A%0A    private static final String EXTRA_ORIGINAL_PARCELABLE = %22extraOriginalParcelable%22;%0A%0A    @Override%0A    protected Parcelable onSaveInstanceState() %7B%0A        Parcelable parcelable = super.onSaveInstanceState();%0A        Bundle bundle = new Bundle();%0A        bundle.putParcelable(EXTRA_ORIGINAL_PARCELABLE,parcelable);%0A        return bundle;%0A    %7D%0A%0A    @Override%0A    protected void onRestoreInstanceState(Parcelable state) %7B%0A        if (state instanceof Bundle)%7B%0A            super.onRestoreInstanceState(((Bundle) state).getParcelable(EXTRA_ORIGINAL_PARCELABLE));%0A        %7D else %7B%0A            super.onRestoreInstanceState(state);%0A        %7D%0A    %7D%0A%0A    public void setOnBoxSearchListener(final BoxCustomSearchListener boxCustomSearchListener)%7B%0A        mBoxCustomSearchListener = boxCustomSearchListener;%0A    %7D%0A%0A    public interface BoxCustomSearchListener %7B%0A%0A        /**%0A         * User clicked on search icon and expanded search%0A         */%0A        void onSearchExpanded();%0A%0A        /**%0A         * User clicked on back and collapsed search%0A         */%0A        void onSearchCollapsed();%0A%0A        /**%0A         * The text in search field has changed%0A         * @param text%0A         */%0A        void onQueryTextChange(String text);%0A%0A        /**%0A         * User pressed enter (or search button on keyboard) and submitted the search query%0A         * @param text%0A         */%0A        void onQueryTextSubmit(String text);%0A    %7D%0A%7D%0A

Add BoxCustomSearchView