本文整理汇总了Java中com.software.shell.fab.ActionButton类的典型用法代码示例。如果您正苦于以下问题:Java ActionButton类的具体用法?Java ActionButton怎么用?Java ActionButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionButton类属于com.software.shell.fab包,在下文中一共展示了ActionButton类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getPresenter().onResponse();
mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
mActionButton = (ActionButton) view.findViewById(R.id.actionButton_fragment_ad);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setHasFixedSize(true);
mAdapter = new RecyclerViewMaterialAdapter(new AdAdapter(mContentItems, this));
mRecyclerView.setAdapter(mAdapter);
setScrollListener();
MaterialViewPagerHelper.registerRecyclerView(getActivity(), mRecyclerView, null);
}
示例2: 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();
}
});
}
示例3: animateActionButtonVisibility
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
private void animateActionButtonVisibility(final boolean videoExist) {
ActionButton videoBtn = binding.playVideoBtn;
videoBtn.setEnabled(videoExist);
Runnable r = () -> {
// Button alpha may change during transition, we may have to wait until its end
// to check its state.
Timber.w("Action btn alpha: " + videoBtn.getAlpha());
boolean actionBtnShouldAnimate = (videoExist && videoBtn.getAlpha() != 1) || (!videoExist && videoBtn.getAlpha() != 0);
if (!actionBtnShouldAnimate) {
return;
}
Animator alphaAnimator = AnimatorUtils.getAlphaAnimator(videoBtn, !videoExist);
alphaAnimator.setDuration(600);
alphaAnimator.start();
};
// Wait just in case transition is still in progress.
videoBtn.postDelayed(r, ACTION_BUTTON_VISIBILITY_ANIM_DELAY);
}
示例4: showFab
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
private void showFab() {
/*按钮动画
fab.setShowAnimation(ActionButton.Animations.FADE_IN);
fab.setHideAnimation(ActionButton.Animations.FADE_OUT);
// 左右移动动画
fab.setShowAnimation(ActionButton.Animations.JUMP_FROM_RIGHT);
fab.setHideAnimation(ActionButton.Animations.JUMP_TO_RIGHT);*/
// 上下移动动画
fab.setShowAnimation(ActionButton.Animations.JUMP_FROM_DOWN);
fab.setHideAnimation(ActionButton.Animations.JUMP_TO_DOWN);
fab.show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
fab.hide();
}
}, 2000);
}
示例5: declareActionButtons
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
public void declareActionButtons() {
mButtonClass = (ActionButton) findViewById(R.id.action_button);
// Call to second helper method that sets properties
makeActionButton(mButtonClass, R.drawable.ic_file_document_white_36dp);
mButtonPicture = (ActionButton) findViewById(R.id.action_button_picture);
makeActionButton(mButtonPicture, R.drawable.ic_camera_white_36dp);
mButtonText = (ActionButton) findViewById(R.id.action_button_assignment);
makeActionButton(mButtonText, R.drawable.ic_file_document_white_36dp);
}
示例6: 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;
}
示例7: declareActionButtons
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
public void declareActionButtons() {
mButtonClass = (ActionButton) findViewById(id.action_button);
// Call to second helper method that sets properties
makeActionButton(mButtonClass, R.drawable.ic_file_document_white_36dp);
mButtonPicture = (ActionButton) findViewById(id.action_button_picture);
makeActionButton(mButtonPicture, R.drawable.ic_camera_white_36dp);
mButtonText = (ActionButton) findViewById(id.action_button_assignment);
makeActionButton(mButtonText, R.drawable.ic_file_document_white_36dp);
}
示例8: addNewRemoteBookmark
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
/**
* Add new {@link Bookmark} to remote backend.
*
* @param newBookmark
* A new {@link Bookmark}.
* @param btn
* {@link ActionButton} the button to fire the adding.
* @param viewForSnack
* {@link View} anchor for showing {@link Snackbar} messages.
*/
public void addNewRemoteBookmark( Bookmark newBookmark, ActionButton btn, View viewForSnack ) {
//Same bookmark should not be added again.
for( Bookmark cached : mCachedBookmarks ) {
if( cached.equals( newBookmark ) ) {
return;
}
}
mCachedBookmarks.add( newBookmark );
btn.setImageResource( R.drawable.ic_bookmarked );
btn.setEnabled( false );
addNewBookmarkInternal( newBookmark, btn, viewForSnack );
}
示例9: removeRemoteBookmark
import com.software.shell.fab.ActionButton; //导入依赖的package包/类
/**
* Remove a {@link Bookmark} from remote backend.
*
* @param bookmark
* An old {@link Bookmark}.
* @param btn
* {@link ActionButton} the button to fire the removing.
* @param viewForSnack
* {@link View} anchor for showing {@link Snackbar} messages.
*/
public void removeRemoteBookmark( Bookmark bookmark, ActionButton btn, View viewForSnack ) {
for( Bookmark cached : mCachedBookmarks ) {
if( cached.equals( bookmark ) ) {
mCachedBookmarks.remove( cached );
btn.setImageResource( R.drawable.ic_not_bookmarked );
btn.setEnabled( false );
removeBookmarkInternal( bookmark, btn, viewForSnack );
break;
}
}
}
示例10: 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);
}
示例11: 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();
}
}
});
}