本文整理汇总了Java中com.software.shell.fab.ActionButton.setButtonColor方法的典型用法代码示例。如果您正苦于以下问题:Java ActionButton.setButtonColor方法的具体用法?Java ActionButton.setButtonColor怎么用?Java ActionButton.setButtonColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.software.shell.fab.ActionButton
的用法示例。
在下文中一共展示了ActionButton.setButtonColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupFAB
import com.software.shell.fab.ActionButton; //导入方法依赖的package包/类
private void setupFAB() {
fab = (ActionButton) findViewById(R.id.action_button);
fab.setType(ActionButton.Type.DEFAULT);
fab.setButtonColor(getResources().getColor(R.color.orange));
fab.setButtonColorPressed(getResources().getColor(R.color.orange_dark));
fab.setImageResource(R.drawable.ic_pin_drop_white_24dp);
fab.setShowAnimation(ActionButton.Animations.ROLL_FROM_DOWN);
fab.setHideAnimation(ActionButton.Animations.ROLL_TO_DOWN);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((ActionButton) v).hide();
((ActionButton) v).playHideAnimation();
setSavePointMode();
}
});
}
示例2: makeActionButton
import com.software.shell.fab.ActionButton; //导入方法依赖的package包/类
public ActionButton makeActionButton(ActionButton ab, int drawable) {
// Creates, and sets ActionButtons
ab.setButtonColor(getResources().getColor(R.color.primary_color));
ab.setButtonColorPressed(getResources().getColor(R.color.dark_primary));
ab.setImageDrawable(getResources().getDrawable(drawable));
return ab;
}
示例3: onCreate
import com.software.shell.fab.ActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
(SupportStreetViewPanoramaFragment)
getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(this);
mAct = this;
mRequestingLocationUpdates = true;
final ActionButton ab = (ActionButton) findViewById(R.id.action_button);
ab.setImageResource(R.drawable.ic_qr);
ab.setShowAnimation(ActionButton.Animations.JUMP_FROM_DOWN);
ab.setHideAnimation(ActionButton.Animations.JUMP_TO_DOWN);
ab.setButtonColor(getResources().getColor(R.color.fab_material_amber_500));
ab.setButtonColorPressed(getResources().getColor(R.color.fab_material_amber_900));
ab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ab.hide();
new IntentIntegrator(mAct).initiateScan();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
ab.show();
}
}, 1000);
}
});
mLocationReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
mPreviousLocation = mCurrentLocation;
mCurrentLocation = intent.getParcelableExtra(LocationUpdaterService.COPA_MESSAGE);
updateMap();
mLocationsList.add(mCurrentLocation);
if (BuildConfig.DEBUG) {
Log.d(TAG, "LocationList size: " + mLocationsList.size());
}
}
};
mRequestLocationIntent = new Intent(this, LocationUpdaterService.class);
startService(mRequestLocationIntent);
// Update values using data stored in the Bundle.
updateValuesFromBundle(savedInstanceState);
}
示例4: onCreate
import com.software.shell.fab.ActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_quote);
toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
getSupportActionBar().setTitle("");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
quote = (EditText) findViewById(R.id.quoteEt);
author = (EditText) findViewById(R.id.authorEt);
ActionButton actionButton = (ActionButton) findViewById(R.id.action_button);
actionButton.setType(ActionButton.Type.DEFAULT);
actionButton.setButtonColor(getResources().getColor(R.color.accent));
actionButton.setButtonColorPressed(getResources().getColor(R.color.primary_dark));
actionButton.setImageResource(R.drawable.send);
actionButton.removeShadow();
actionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (quote.getText().toString().length()<1){
YoYo.with(Techniques.Pulse)
.delay(10)
.duration(500)
.playOn(quote);
}else if(author.getText().toString().length()<1 ){
YoYo.with(Techniques.Pulse)
.delay(10)
.duration(500)
.playOn(author);
}else {
ParseObject gameScore = new ParseObject("Quote");
gameScore.put("time", new Date().getTime());
gameScore.put("quote", quote.getText().toString());
gameScore.put("author", author.getText().toString());
gameScore.put("user", ParseUser.getCurrentUser().getObjectId());
gameScore.put("user_name", ParseUser.getCurrentUser().getUsername());
gameScore.put("user_id", ParseUser.getCurrentUser().get("user_id"));
gameScore.saveInBackground();
Toast.makeText(CreateQuoteActivity.this, "Succesfully Posted", Toast.LENGTH_SHORT).show();
finish();
}
}
});
}