当前位置: 首页>>代码示例>>Java>>正文


Java VectorDrawableCompat.setTint方法代码示例

本文整理汇总了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);
    }

}
 
开发者ID:sloiza,项目名称:changApp,代码行数:24,代码来源:ChangasPorCategoriaActivity.java

示例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);
    }

}
 
开发者ID:sloiza,项目名称:changApp,代码行数:20,代码来源:PostulacionesActivasActivity.java

示例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");
    }

}
 
开发者ID:sloiza,项目名称:changApp,代码行数:21,代码来源:ChangasPendientesActivity.java

示例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");
    }

}
 
开发者ID:sloiza,项目名称:changApp,代码行数:21,代码来源:ChangasActivasActivity.java

示例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");
    }

}
 
开发者ID:sloiza,项目名称:changApp,代码行数:21,代码来源:ChangasFinalizadasActivity.java

示例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();
}
 
开发者ID:zzyandzzy,项目名称:SuperToast,代码行数:48,代码来源:MainActivity.java

示例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();
        }
    });
}
 
开发者ID:TORU0239,项目名称:android-design-library-master,代码行数:52,代码来源:MainActivity.java

示例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();
        }
    });
}
 
开发者ID:TORU0239,项目名称:android-design-library-master,代码行数:52,代码来源:MainActivity.java


注:本文中的android.support.graphics.drawable.VectorDrawableCompat.setTint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。