I\'m trying to make Toolbar with EditText within it like this:
Right now I can do some thing similar but only with static title, Any ideas to get started?
You can use a linear layout with the same color of your toolbar. The toolbar attribute android:elevation
needs to be 0px
.
Activity (xml)
Toolbar (xml)
Fragment (xml)
Activity (java)
public class TaskActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initializeTodo(savedInstanceState);
setContentView(R.layout.activity_task);
//set the toolbar
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(null);
}
The result: