Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ActionBar actionBar = ((AppCompatActivity)getActivity()).getSupportActionBar();
- if (actionBar == null) {
- return;
- }
- actionBar.setDisplayShowHomeEnabled(false);
- actionBar.setDisplayShowCustomEnabled(true);
- actionBar.setDisplayShowTitleEnabled(false);
- actionBar.setCustomView(R.layout.actionbar_navigation_menu);
- ((TextView)actionBar.getCustomView().findViewById(R.id.action_bar_title)).setText(R.string.notebook_list_fragment_title);
- (actionBar.getCustomView().findViewById(R.id.upButtonRipple)).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- //クリック時の処理
- }
- });
- //デフォルトの設定を上書き
- Toolbar parent =(Toolbar)actionBar.getCustomView().getParent();
- parent.setContentInsetsAbsolute(0,0);
- Toolbar parent =(Toolbar)actionBar.getCustomView().getParent();
- parent.setContentInsetsAbsolute(0,0);
Add Comment
Please, Sign In to add comment