本文整理汇总了Java中com.melnykov.fab.FloatingActionButton.setColorRipple方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setColorRipple方法的具体用法?Java FloatingActionButton.setColorRipple怎么用?Java FloatingActionButton.setColorRipple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.melnykov.fab.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.setColorRipple方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResume
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
public void onResume() {
super.onResume();
listView = (ListView) findViewById(R.id.list_view);
bartoursAdapter = new BartoursAdapter(
this,
bartout.getBartours()
);
listView.setAdapter(bartoursAdapter);
listView.setOnItemClickListener(this);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.newBartourButton);
fab.attachToListView(listView);
if(bartout.getActiveBartour() != null) {
fab.setColorNormal(Color.GRAY);
fab.setColorPressed(Color.GRAY);
fab.setColorRipple(Color.GRAY);
} else {
fab.setColorNormal(Color.parseColor("#4CAF50"));
fab.setColorPressed(Color.parseColor("#2E7D32"));
fab.setColorRipple(Color.parseColor("#43A047"));
}
}
示例2: addHelperFab
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
public void addHelperFab(Context context ,HelperFab.Location location,final HelperFab fab) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
final FloatingActionButton newFab = (FloatingActionButton)inflater.inflate(R.layout.fab_layout_normal,null);
newFab.setBackgroundColor(fab.getBackgroundColor());
newFab.setColorNormal(fab.getBackgroundColor());
newFab.setColorPressed(fab.getFabSelectedColor());
newFab.setColorRipple(fab.getFabRippleColor());
newFab.setImageDrawable(fab.getDrawable());
newFab.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
fab.onClick();
}
});
if(location == HelperFab.Location.RIGHT) {
helperFabRight = newFab;
}
else if(location == HelperFab.Location.LEFT) {
helperFabLeft = newFab;
}
}
示例3: onBindViewHolder
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(ColorPaletteViewHolder holder, final int position) {
final FloatingActionButton button = holder.getButton();
button.setColorNormal(mNormalColorList[position]);
button.setColorPressed(mPressedColorList[position]);
button.setColorRipple(mRippleColorList[position]);
setButtonSelectedStatus(button, mSelectedPosition == position);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setButtonSelectedStatus(button, true);
updateButtons(position, mSelectedPosition);
mSelectedPosition = position;
if (mColorSelectedListener != null) {
mColorSelectedListener.onColorSelected(position);
}
}
});
}
示例4: onContentChanged
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void onContentChanged() {
super.onContentChanged();
if (!mHasFAB)
return;
View view = getWindow().getDecorView().findViewById(android.R.id.content);
if (view instanceof FrameLayout) {
FrameLayout base = (FrameLayout) view;
if (base.findViewById(R.id.fab) == null) {
FrameLayout layout = (FrameLayout) getLayoutInflater().inflate(R.layout.fab, base);
mFAB = (FloatingActionButton) layout.findViewById(R.id.fab);
layout.removeView(mFAB);
base.addView(mFAB);
mFAB.setColorRipple(UiUtil.darkerColor(mFAB.getColorNormal(), 0.5f));
mFAB.setColorPressed(UiUtil.darkerColor(mFAB.getColorNormal(), 0.3f));
mFAB.setOnClickListener(this);
}
}
}
示例5: setCheckInButtonColor
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
private void setCheckInButtonColor(View view) {
FloatingActionButton checkInButton = (FloatingActionButton) view.findViewById(R.id.checkInButton);
if(bartour == null) {
checkInButton.setColorNormal(Color.GRAY);
checkInButton.setColorPressed(Color.GRAY);
checkInButton.setColorRipple(Color.GRAY);
} else {
checkInButton.setColorNormal(Color.parseColor("#4CAF50"));
checkInButton.setColorPressed(Color.parseColor("#2E7D32"));
checkInButton.setColorRipple(Color.parseColor("#43A047"));
}
}
示例6: setupMenuItem
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
private static FloatingActionButton setupMenuItem(FloatingActionButton menuBase, int id,
int drawable,
int style,
View.OnClickListener menuItemClickListener) {
int[] styleValues = new int[]{com.melnykov.fab.R.attr.fab_colorNormal,
com.melnykov.fab.R.attr.fab_colorPressed,
com.melnykov.fab.R.attr.fab_colorRipple,
com.melnykov.fab.R.attr.fab_shadow};
Context context = menuBase.getContext();
TypedArray array = context.obtainStyledAttributes(style, styleValues);
int color;
FloatingActionButton button = new FloatingActionButton(menuBase.getContext(), null, style);
button.setId(id);
button.setType(menuBase.getType());
if ((color = array.getColor(0, -1)) != -1)
button.setColorNormal(color);
if ((color = array.getColor(1, -1)) != -1)
button.setColorPressed(color);
if ((color = array.getColor(2, -1)) != -1)
button.setColorRipple(color);
if (array.getBoolean(3, false))
button.setShadow(true);
else
button.setShadow(false);
array.recycle();
button.setImageResource(drawable);
button.setLayoutParams(menuBase.getLayoutParams());
button.setVisibility(View.GONE);
button.setOnClickListener(menuItemClickListener);
((ViewGroup) menuBase.getParent()).addView(button);
return button;
}
示例7: onCreateView
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//requestPermissions();
View rootView = inflater.inflate(
R.layout.fragment_recyclerview, container, false);
recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
FastScroller fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
fastScroller.setRecyclerView(recyclerView);
audioVisualization = (AudioVisualization) rootView.findViewById(R.id.visualizer_view);
backdrop = (ImageView) rootView.findViewById(R.id.white_backdrop);
fab.attachToRecyclerView(recyclerView);
fab.setColorNormal(getResources().getColor(R.color.colorAccent));
fab.setColorPressed(getResources().getColor(R.color.widget_pause));
fab.setColorRipple(getResources().getColor(R.color.window_background));
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
MusicPlayer.shuffleAll(getActivity());
}
}, 80);
}
});
new loadSongs().execute("");
((BaseActivity) getActivity()).setMusicStateListenerListener(this);
// if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED
// && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.MODIFY_AUDIO_SETTINGS) == PackageManager.PERMISSION_GRANTED) {
//
// requestPermissions();
//
// }
//
// requestPermissions();
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
Boolean stateWave = sharedPrefs.getBoolean(getString(R.string.pref_switch_wave_key), true);
if(stateWave)
backdrop.setVisibility(View.GONE);
else
backdrop.setVisibility(View.VISIBLE);
return rootView;
}