本文整理汇总了Java中com.melnykov.fab.FloatingActionButton.setColorNormal方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setColorNormal方法的具体用法?Java FloatingActionButton.setColorNormal怎么用?Java FloatingActionButton.setColorNormal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.melnykov.fab.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.setColorNormal方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpFAB
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
/**
* Setup utility for the FAB
*
* @param context
* @param icon the icon to apply
* @param button the FAB button
* @param mFABlistener the listener to apply
*/
public static void setUpFAB(Activity context, int icon, FloatingActionButton button, View.OnClickListener mFABlistener) {
button.setVisibility(View.VISIBLE);
button.setType(FloatingActionButton.TYPE_NORMAL);
if (ThemeUtils.getAppTheme3(context) < 6) {
button.setColorNormal(context.getResources().getColor(
ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context)));
button.setColorPressed(context.getResources().getColor(
ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context)));
} else {
button.setColorNormal(ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context));
button.setColorPressed(ThemeUtils.getDrawableColor(ThemeUtils.getAppTheme3(context), context));
}
button.setImageDrawable(context.getResources().getDrawable(icon));
button.setOnClickListener(mFABlistener);
}
示例2: 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"));
}
}
示例3: 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;
}
}
示例4: 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);
}
}
});
}
示例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;
}