13a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov/* 23a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * Copyright (C) 2017 The Android Open Source Project 33a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * 43a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * Licensed under the Apache License, Version 2.0 (the "License"); 53a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * you may not use this file except in compliance with the License. 63a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * You may obtain a copy of the License at 73a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * 83a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * http://www.apache.org/licenses/LICENSE-2.0 93a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * 103a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * Unless required by applicable law or agreed to in writing, software 113a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * distributed under the License is distributed on an "AS IS" BASIS, 123a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 133a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * See the License for the specific language governing permissions and 143a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov * limitations under the License. 153a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov */ 163a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 173a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovpackage android.support.v7.app; 183a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 193a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovimport android.support.v7.appcompat.test.R; 203a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovimport android.support.v7.testutils.BaseTestActivity; 213a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovimport android.support.v7.widget.Toolbar; 223a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovimport android.view.Menu; 233a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovimport android.view.MenuInflater; 243a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 253a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikovpublic class AppCompatMenuItemIconTintingTestActivity extends BaseTestActivity { 263a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov private Toolbar mToolbar; 273a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 283a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov @Override 293a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov protected int getContentViewLayoutResId() { 303a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov return R.layout.appcompat_toolbar_activity; 313a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov } 323a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 333a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov @Override 343a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov protected void onContentViewSet() { 353a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov mToolbar = findViewById(R.id.toolbar); 363a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov setSupportActionBar(mToolbar); 373a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov } 383a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 393a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov @Override 403a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov public boolean onCreateOptionsMenu(Menu menu) { 413a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov MenuInflater inflater = getMenuInflater(); 423a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov inflater.inflate(R.menu.appcompat_menu_icon_tinting, menu); 433a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 443a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov return true; 453a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov } 463a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov 473a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov public Menu getToolbarMenu() { 483a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov return mToolbar.getMenu(); 493a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov } 503a7c6d2009dfcf99c738d70eafe146eedf6e0ac2Kirill Grouchnikov} 51