本文整理汇总了Java中android.support.graphics.drawable.VectorDrawableCompat.setTint方法的典型用法代码示例。如果您正苦于以下问题:Java VectorDrawableCompat.setTint方法的具体用法?Java VectorDrawableCompat.setTint怎么用?Java VectorDrawableCompat.setTint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.graphics.drawable.VectorDrawableCompat
的用法示例。
在下文中一共展示了VectorDrawableCompat.setTint方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_changas_activas);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager_ca);
final Integer idCategoria = getIntent().getIntExtra("EXTRA_POSITION",0);
setupViewPager(viewPager,idCategoria);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerCA);
// Adding menu icon to Toolbar
setSupportActionBar((Toolbar) findViewById(R.id.toolbar_ca));
if (getSupportActionBar() != null) {
VectorDrawableCompat indicator
= VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
//getSupportActionBar().setHomeAsUpIndicator(indicator);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Resources resources = getResources();
String categoryName = ((resources.getStringArray(R.array.array_categories))[idCategoria].toString());
getSupportActionBar().setTitle("Categoria: "+categoryName);
}
}
示例2: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_postulaciones_activas);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager_pa);
setupViewPager(viewPager);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerpa);
// Adding menu icon to Toolbar
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
VectorDrawableCompat indicator
= VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
supportActionBar.setHomeAsUpIndicator(indicator);
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
}
示例3: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_changas_pendientes);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager_cp);
setupViewPager(viewPager);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerCP);
// Adding menu icon to Toolbar
setSupportActionBar((Toolbar) findViewById(R.id.toolbar_cp));
if (getSupportActionBar() != null) {
VectorDrawableCompat indicator
= VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
//getSupportActionBar().setHomeAsUpIndicator(indicator);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Mis changas pendientes");
}
}
示例4: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_changas_activas);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager_ca);
setupViewPager(viewPager);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerCA);
// Adding menu icon to Toolbar
setSupportActionBar((Toolbar) findViewById(R.id.toolbar_ca));
if (getSupportActionBar() != null) {
VectorDrawableCompat indicator
= VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
//getSupportActionBar().setHomeAsUpIndicator(indicator);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Mis changas");
}
}
示例5: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_changas_finalizadas);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager_cf);
setupViewPager(viewPager);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerCF);
// Adding menu icon to Toolbar
setSupportActionBar((Toolbar) findViewById(R.id.toolbar_cf));
if (getSupportActionBar() != null) {
VectorDrawableCompat indicator
= VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
//getSupportActionBar().setHomeAsUpIndicator(indicator);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Mis changas finalizadas");
}
}
示例6: onClick
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
SuperToast superToast = new SuperToast(this);
switch (v.getId()) {
case R.id.main_button1:
superToast.setImage(-1);
superToast.setText("Text");
break;
case R.id.main_button2:
superToast.setImage(R.mipmap.ic_launcher);
break;
case R.id.main_button3:
superToast.setText("Color");
superToast.setColor(Color.GREEN);
break;
case R.id.main_button4:
superToast.setText("info");
superToast.setType(SuperToastType.INFO);
break;
case R.id.main_button5:
superToast.setText("Waring");
superToast.setType(SuperToastType.WARNING);
break;
case R.id.main_button6:
superToast.setText("Error");
superToast.setType(SuperToastType.ERROR);
break;
case R.id.main_button7:
superToast.setText("LongTime");
superToast.setDuration(5000);
break;
case R.id.main_button8:
superToast.setText("Center");
superToast.setGravity(Gravity.CENTER, 0, 0);
break;
case R.id.main_button9:
superToast.setText("Elevation");
superToast.setColor(Color.WHITE);
superToast.getTextView().setTextColor(Color.BLACK);
VectorDrawableCompat drawable = VectorDrawableCompat.create(getResources(), R.drawable.ic_sentiment_neutral_black_24dp, getTheme());
drawable.setTint(Color.BLACK);
superToast.setImage(drawable);
superToast.setElevation(5);
break;
}
superToast.show();
}
示例7: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Adding Toolbar to Main screen
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
setupViewPager(viewPager);
// Set Tabs inside Toolbar
TabLayout tabs = (TabLayout) findViewById(R.id.tabs);
tabs.setupWithViewPager(viewPager);
// Create Navigation drawer and inlfate layout
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer);
// Adding menu icon to Toolbar
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
VectorDrawableCompat indicator
= VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
supportActionBar.setHomeAsUpIndicator(indicator);
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
// Set behavior of Navigation drawer
navigationView.setNavigationItemSelectedListener(
new NavigationView.OnNavigationItemSelectedListener() {
// This method will trigger on item Click of navigation menu
@Override
public boolean onNavigationItemSelected(MenuItem menuItem) {
// Set item in checked state
menuItem.setChecked(true);
// TODO: handle navigation
// Closing drawer on item click
mDrawerLayout.closeDrawers();
return true;
}
});
// Adding Floating Action Button to bottom right of main view
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Snackbar.make(v, "Hello Snackbar!",
Snackbar.LENGTH_LONG).show();
}
});
}
示例8: onCreate
import android.support.graphics.drawable.VectorDrawableCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Adding Toolbar to Main screen
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Setting ViewPager for each Tabs
ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
setupViewPager(viewPager);
// Set Tabs inside Toolbar
TabLayout tabs = (TabLayout) findViewById(R.id.tabs);
tabs.setupWithViewPager(viewPager);
// Create Navigation drawer and inlfate layout
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer);
// Adding menu icon to Toolbar
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
VectorDrawableCompat indicator =
VectorDrawableCompat.create(getResources(), R.drawable.ic_menu, getTheme());
indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
supportActionBar.setHomeAsUpIndicator(indicator);
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
// Set behavior of Navigation drawer
navigationView.setNavigationItemSelectedListener(
new NavigationView.OnNavigationItemSelectedListener() {
// This method will trigger on item Click of navigation menu
@Override
public boolean onNavigationItemSelected(MenuItem menuItem) {
// Set item in checked state
menuItem.setChecked(true);
// TODO: handle navigation
// Closing drawer on item click
mDrawerLayout.closeDrawers();
return true;
}
});
// Adding Floating Action Button to bottom right of main view
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Snackbar.make(v, "Hello Snackbar!",
Snackbar.LENGTH_LONG).show();
}
});
}