Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an imageview instead of search hint #299

Open
mladenbabic opened this issue Feb 1, 2018 · 3 comments
Open

Add an imageview instead of search hint #299

mladenbabic opened this issue Feb 1, 2018 · 3 comments

Comments

@mladenbabic
Copy link

No description provided.

@vutrannguyen
Copy link

@mladenbabic Have you solved this problem yet? Looking forward to sharing

@mladenbabic
Copy link
Author

@vutrannguyen Yes, but it is too much customized for my project and it won't be helpful for you.

@vutrannguyen
Copy link

    Thanks for the reply @mladenbabic . I solved that problem like this:
        Toolbar headerMain = view.findViewById(R.id.headerMain);
        SearchInputView searchBar = headerMain.findViewById(R.id.search_bar_text);
        ImageView imageView = new ImageView(getContext());
        imageView.setImageResource(R.drawable.logo);

        FrameLayout frameLayout = headerMain.findViewById(R.id.search_input_parent);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT
        );
        layoutParams.setMargins(-80,15,0,15);
        layoutParams.addRule(RelativeLayout.BELOW, R.id.search_input_parent);
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);

        frameLayout.addView(imageView, layoutParams);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants