本文整理汇总了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");
}
示例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);
}
示例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);
}
示例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);
}
}
示例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());
}
示例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));
}
示例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();
}
});
}
示例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();
}
示例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);}
示例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("加密输出内容:");
}
示例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));
}
示例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));
}
示例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();
}
示例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);}
示例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);
}