maxems java里有吗_Java TextView.getTextColors方法代码示例

import android.widget.TextView; //导入方法依赖的package包/类

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_summary);

overridePendingTransition(R.anim.pull_in_right, R.anim.push_out_left);

summaryTextView = (TextView) findViewById(R.id.summary_text_view);

summaryTextViewDefaultColor = summaryTextView.getTextColors();

locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);

contactsLinearLayout = (LinearLayout) findViewById(R.id.contacts_linear_layout);

shutdownButton = (FloatingActionButton) findViewById(R.id.shutdown_button);

shutdownButton.setOnClickListener(this);

int flags = WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON

| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD

| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;

getWindow().addFlags(flags);

// TODO: Sostituisci con BitmapDescriptorFactory.fromResource(R.drawable.ic_message) quando https://code.google.com/p/gmaps-api-issues/issues/detail?id=9011 sarà corretto

Drawable vectorDrawable = ContextCompat.getDrawable(this, R.drawable.ic_message);

int w = vectorDrawable.getIntrinsicWidth();

int h = vectorDrawable.getIntrinsicHeight();

vectorDrawable.setBounds(0, 0, w, h);

Bitmap bm = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(bm);

vectorDrawable.draw(canvas);

mapMarkerBitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bm);

// :ODOT

MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map_fragment);

mapFragment.getMapAsync(this);

smsUpdateReceiver = new SmsUpdateReceiver();

registerReceiver(smsUpdateReceiver, new IntentFilter("android.provider.Telephony.SMS_RECEIVED"));

sentSmsStatusReceiver = new BroadcastReceiver() {

@Override

public void onReceive(Context context, Intent intent) {

int contactIndex = intent.getIntExtra(CONTACT_INDEX_EXTRA, -1);

if (contactIndex < 0 || contactIndex >= favoriteContacts.size())

return;

boolean smsDelivered = intent.getAction().equals(SMS_STATUS_DELIVERED_ACTION);

RoundedContactBadge contactBadge = (RoundedContactBadge) contactsLinearLayout.getChildAt(contactIndex);

if (smsDelivered)

contactBadge.setContactStatus(RoundedContactBadge.ContactStatus.DELIVERED);

else {

boolean smsSent = getResultCode() == Activity.RESULT_OK;

contactBadge.setContactStatus(smsSent ? RoundedContactBadge.ContactStatus.SENT : RoundedContactBadge.ContactStatus.ERROR);

}

}

};

IntentFilter filter = new IntentFilter();

filter.addAction(SMS_STATUS_SENT_ACTION);

filter.addAction(SMS_STATUS_DELIVERED_ACTION);

registerReceiver(sentSmsStatusReceiver, filter);

loadContactsIfNeeded();

if (savedInstanceState == null)

alertAllContacts();

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值