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


Java Toolbar.setTitleTextColor方法代码示例

本文整理汇总了Java中android.support.v7.widget.Toolbar.setTitleTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java Toolbar.setTitleTextColor方法的具体用法?Java Toolbar.setTitleTextColor怎么用?Java Toolbar.setTitleTextColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.widget.Toolbar的用法示例。


在下文中一共展示了Toolbar.setTitleTextColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_server_status);
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitleTextColor(ContextCompat.getColor(this, R.color.gold));
    setSupportActionBar(toolbar);

    findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View view) {
        final Intent browserIntent =
                new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.BROWSER_FORUMS_URL));
        startActivity(browserIntent);
        }
    });

    content = (ViewGroup) findViewById(R.id.content);
    sharedPref = getSharedPreferences(
            getString(R.string.preference_file_key), Context.MODE_PRIVATE);
    FirebaseMessaging.getInstance().subscribeToTopic("server-status");
}
 
开发者ID:dkarivalis,项目名称:SWGEmuServerStatus,代码行数:23,代码来源:ServerStatusActivity.java

示例2: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
   protected void onCreate(Bundle savedInstanceState)
{

       super.onCreate(savedInstanceState);
	setContentView(R.layout.about);
	TextView qdtzt=(TextView)findViewById(R.id.qdtzt);
	SharedPreferences sharedPreferences = getSharedPreferences("set", Context.MODE_PRIVATE);
	String qdt = sharedPreferences.getString("qdt", "");
	if("true".equals(qdt)){
		qdtzt.setText("启动界面:开");
	}
	if("false".equals(qdt)){
		qdtzt.setText("启动界面:关");
	}
       Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
       setSupportActionBar(toolbar);
       toolbar.setTitleTextColor(Color.WHITE);
}
 
开发者ID:qq1198,项目名称:mtoolbox,代码行数:20,代码来源:about.java

示例3: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_credit_history);

    toolbar = (Toolbar) findViewById(R.id.toolbar1);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("Credit History");
    toolbar.setTitleTextColor(ContextCompat.getColor(context, R.color.white));

    allList = new ArrayList<>();

    adapter = new PhotosAdapter(context, allList);
    adapter.setClickListener(new PhotosAdapter.ClickListener() {
        @Override
        public void onItemClickListener(View v, int pos) {
            //gotoDetailsActivity();
        }
    });

    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
    recyclerView.setLayoutManager(new GridLayoutManager(context, 3));
    recyclerView.setAdapter(adapter);

}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:27,代码来源:CreditHistoryActivity.java

示例4: setupAppBar

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
/**
 * Configures and styles both status bar and toolbar.
 */
private void setupAppBar() {
    setStatusBarColor(mStatusBarColor);

    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);

    // Set all of the Toolbar coloring
    toolbar.setBackgroundColor(mToolbarColor);
    toolbar.setTitleTextColor(mToolbarWidgetColor);

    final TextView toolbarTitle = (TextView) toolbar.findViewById(R.id.toolbar_title);
    toolbarTitle.setTextColor(mToolbarWidgetColor);
    toolbarTitle.setText(mToolbarTitle);

    // Color buttons inside the Toolbar
    Drawable stateButtonDrawable = ContextCompat.getDrawable(this, mToolbarCancelDrawable).mutate();
    stateButtonDrawable.setColorFilter(mToolbarWidgetColor, PorterDuff.Mode.SRC_ATOP);
    toolbar.setNavigationIcon(stateButtonDrawable);

    setSupportActionBar(toolbar);
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowTitleEnabled(false);
    }
}
 
开发者ID:Alcatraz323,项目名称:MaterialOCR,代码行数:28,代码来源:UCropActivity.java

示例5: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_note_edit_actvity);
    Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setTitle("Notes");
    toolbar.setTitleTextColor(Color.WHITE);
    Intent i = getIntent();
    String thisNote = i.getStringExtra(Constants.NOTES_EDIT_TEXT);
    position = i.getIntExtra(Constants.NOTES_EDIT_POSITION,0);

    etNotesDetail = (EditText) findViewById(R.id.etNoteEdit);
    if(notesEdit_LOG)
    Log.d(TAG, "onCreate: " + thisNote);
    etNotesDetail.setText(thisNote);
    if(thisNote != null)
    etNotesDetail.setSelection(thisNote.length());
}
 
开发者ID:Rishabhk07,项目名称:multi-copy,代码行数:23,代码来源:NoteEditActvity.java

示例6: initView

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
public void initView() {
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    toolbar.setTitle("泡泡影音");
    toolbar.setTitleTextColor(getResources().getColor(android.R.color.white));
}
 
开发者ID:popo1379,项目名称:popomusic,代码行数:8,代码来源:MainActivty.java

示例7: setToolBar

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
/**
 * 子类可以直接用
 *
 * @param title
 */
protected void setToolBar(Toolbar toolbar, String title) {
    toolbar.setTitle(title);
    setSupportActionBar(toolbar);
    toolbar.setTitleTextColor(Color.WHITE);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);//显示toolbar的返回按钮
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            onBackPressed();
        }
    });
}
 
开发者ID:paterWang,项目名称:EasyReader,代码行数:19,代码来源:BaseActivity.java

示例8: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_notification);

    toolbar = (Toolbar) findViewById(R.id.toolbar1);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("Notifications");
    toolbar.setTitleTextColor(ContextCompat.getColor(context, R.color.white));

    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);


    allList = new ArrayList<>();
    allAdapter = new NotificationAdapter(context, allList);
    allAdapter.setClickListener(new NotificationAdapter.ClickListener() {
        @Override
        public void onItemClickListener(View v, int pos) {
            gotoDetailsActivity();
        }
    });

    recyclerView.setLayoutManager(new LinearLayoutManager(context));
    recyclerView.setAdapter(allAdapter);

    setList();
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:29,代码来源:NotificationActivity.java

示例9: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
   protected void onCreate(Bundle savedInstanceState)
{

       super.onCreate(savedInstanceState);
	setContentView(R.layout.zb);
       Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
       setSupportActionBar(toolbar);
       toolbar.setTitleTextColor(Color.WHITE);}
 
开发者ID:qq1198,项目名称:mtoolbox,代码行数:10,代码来源:zb.java

示例10: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
   protected void onCreate(Bundle savedInstanceState)
   {
	super.onCreate(savedInstanceState);
       setContentView(R.layout.unicode);
       Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
       setSupportActionBar(toolbar);
       toolbar.setTitleTextColor(Color.WHITE);
	final TextInputLayout a = (TextInputLayout) findViewById(R.id.a);
	a.setHint("加密内容:");
	final TextInputLayout b = (TextInputLayout) findViewById(R.id.b);
	b.setHint("加密输出内容:");
}
 
开发者ID:qq1198,项目名称:mtoolbox,代码行数:14,代码来源:unicode.java

示例11: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_support);

    toolbar = (Toolbar) findViewById(R.id.toolbar1);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("Chat");
    toolbar.setTitleTextColor(ContextCompat.getColor(context, R.color.white));
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:12,代码来源:SupportActivity.java

示例12: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_all_levels);

    toolbar = (Toolbar) findViewById(R.id.toolbar1);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("All Levels");
    toolbar.setTitleTextColor(ContextCompat.getColor(context, R.color.white));
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:12,代码来源:AllLevelActivity.java

示例13: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setting);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);


    int headTextColor;
    if (Build.VERSION.SDK_INT >= 23) {
        headTextColor = getResources().getColor(R.color.setup_item_head_text, null);
    } else {
        headTextColor = getResources().getColor(R.color.setup_item_head_text);
    }

    toolbar.setTitleTextColor(headTextColor);
    setSupportActionBar(toolbar);

    int headColor;
    if (Build.VERSION.SDK_INT >= 23) {
        headColor = getResources().getColor(R.color.setup_item_head, null);
    } else {
        headColor = getResources().getColor(R.color.setup_item_head);
    }

    getSupportActionBar().setTitle("총공 설정");
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(headColor));
    getFragmentManager().beginTransaction()
            .replace(R.id.frame, new AttackSettingFragment())
            .commit();
}
 
开发者ID:monthlypub,项目名称:SmingZZick_App,代码行数:32,代码来源:AttackSettingActivity.java

示例14: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
   protected void onCreate(Bundle savedInstanceState)
{

       super.onCreate(savedInstanceState);
	setContentView(R.layout.dc);
       Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
       setSupportActionBar(toolbar);
       toolbar.setTitleTextColor(Color.WHITE);}
 
开发者ID:qq1198,项目名称:mtoolbox,代码行数:10,代码来源:dc.java

示例15: onCreate

import android.support.v7.widget.Toolbar; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about_us);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitleTextColor(Color.WHITE);
    setSupportActionBar(toolbar);

    // adds up navigation to the toolbar
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

}
 
开发者ID:chrisqz95,项目名称:couch-potatoes,代码行数:13,代码来源:AboutUsActivity.java


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