本文整理汇总了Java中com.balysv.materialripple.MaterialRippleLayout类的典型用法代码示例。如果您正苦于以下问题:Java MaterialRippleLayout类的具体用法?Java MaterialRippleLayout怎么用?Java MaterialRippleLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MaterialRippleLayout类属于com.balysv.materialripple包,在下文中一共展示了MaterialRippleLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
private void init() {
labelView.clear();
List<Tag> tags = mProvider.getItems();
for (Tag tag : tags) {
labelView.addLabel(tag.title);
labelView.setLayoutTransition(null);
int position = labelView.getLabelsCounter() - 1;
Label label = labelView.getLabel(position);
View view = LayoutInflater.from(labelView.getContext()).inflate(R.layout.item_site_tag, null);
MaterialRippleLayout rippleLayout = (MaterialRippleLayout) view.findViewById(R.id.ripple_layout);
LinearLayout child = (LinearLayout) label.getChildAt(0);
child.setBackgroundResource(android.R.color.transparent);
label.removeView(child);
rippleLayout.addView(child);
label.addView(view);
rippleLayout.setOnClickListener(v -> {
if (position >= 0 && mProvider != null) {
tag.selected = !tag.selected;
notifyItemChanged(position);
if (mItemClickListener != null)
mItemClickListener.onItemClick(v, position);
}
});
}
}
示例2: onCreateViewHolder
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
@Override
public FavoritesShowViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
//View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.shared_favorites_shows, null);
//FavoritesShowViewHolder favoritesShowViewHolder = new FavoritesShowViewHolder(view);
/* Ripple Effect Return */
final LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
return new FavoritesShowViewHolder(
MaterialRippleLayout.on(inflater.inflate(R.layout.shared_favorites_shows, viewGroup, false))
.rippleOverlay(true)
.rippleAlpha(0.2f)
.rippleColor(Utils.getColor(mContext, R.color.myseriesPrimaryBackgroundColor))
.rippleHover(true)
.create(),
mFavoritesFragment
);
}
示例3: getView
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View view;
view=layoutInflater.inflate(R.layout.custom_list_single_item, null);
MaterialRippleLayout ripple=(MaterialRippleLayout)view.findViewById(R.id.ripple);
FontText libraryOwnerTxt=(FontText)view.findViewById(R.id.library_name_txt);
FontText libraryDescTxt=(FontText)view.findViewById(R.id.library_desc_txt);
libraryOwnerTxt.setText("\n"+libraryName[position]);
libraryDescTxt.setText(libraryDesc[position] + "\n");
ripple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Toast.makeText(context, libraryName[position], Toast.LENGTH_SHORT).show();
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(libraryUrl[position]));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
});
return view;
}
示例4: getView
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View view;
view=layoutInflater.inflate(R.layout.custom_list_single_item, null);
MaterialRippleLayout ripple=(MaterialRippleLayout)view.findViewById(R.id.ripple);
final FontText titleTxt=(FontText)view.findViewById(R.id.library_name_txt);
FontText bodyTxt=(FontText)view.findViewById(R.id.library_desc_txt);
titleTxt.setText("\n"+titleArrLst.get(position).trim());
bodyTxt.setText(urlArrLst.get(position)+ "\n");
ripple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(context, titleArrLst.get(position).trim(), Toast.LENGTH_SHORT).show();
Intent intent=new Intent(context, SavedExtndActivity.class);
intent.putExtra("saved_extnd_title", titleArrLst.get(position));
intent.putExtra("saved_extnd_url", urlArrLst.get(position));
intent.putExtra("saved_extnd_body", bodyArrLst.get(position));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
});
return view;
}
示例5: onCreate
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.demo);
// xml initialization
findViewById(R.id.ripple_layout_1).setOnClickListener(this);
findViewById(R.id.ripple_layout_1).setOnLongClickListener(this);
// static initialization
View view = findViewById(R.id.ripple_layout_2);
MaterialRippleLayout.on(view)
.rippleColor(Color.parseColor("#FF0000"))
.rippleAlpha(0.2f)
.rippleHover(true)
.create();
view.setOnLongClickListener(this);
view.setOnClickListener(this);
}
示例6: onWindowFocusChanged
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
//scroll to the correct icon in the horizontal scroll view if we are opening an edit intent OR if the user has rotated the screen
if (editIntentFlag || !rotateHasOccuredFlag) {
String icons[] = getResources().getStringArray(R.array.icons_array_pro);
int selected = Arrays.asList(icons).indexOf(iconName);
MaterialRippleLayout rip = (MaterialRippleLayout) findViewById(getResources().getIdentifier("ripple_imageButton" + Integer.toString(selected + 1), "id", getPackageName()));
rip.setRadius(1000);
selectedRippleButtonId = rip.getId();
int x = rip.getLeft();
int y = rip.getTop();
hsv.scrollTo(x, y);
editIntentFlag = false;
}
}
示例7: onCreateView
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container,
Bundle savedInstanceState) {
final Utils utils = new Utils(getActivity());
View rootView = inflater.inflate(R.layout.cards_fragment, container, false);
RelativeLayout relativeLayout = (RelativeLayout) rootView.findViewById(R.id.vg_cover);
// Set the width of cards according to width of screen
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) relativeLayout.getLayoutParams();
layoutParams.width = (int) (utils.getScreenWidth() * .8f);
relativeLayout.setOnClickListener(this);
frontText = (TextView) rootView.findViewById(R.id.frontText);
backText = (TextView) rootView.findViewById(R.id.backText);
pronunciationBtn = (MaterialRippleLayout) rootView.findViewById(R.id.pronunciationBtn);
pronunciationBtn.setEnabled(false);
// Instantiate the various views of the card.
updateCheckedStatus(cardModel);
pronunciationBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mp.start();
}
});
return rootView;
}
示例8: enableQuietHours
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
/**
* Enables or disables the ability to change the start and end time for the Quiet Hours functionality.
* It also changes the color of the view
*/
private static void enableQuietHours(boolean boo, Activity ac) {
final TextView quietHourStartView = (TextView) ac.findViewById(R.id.notifications_quiet_hours_start);
final TextView quietHourEndView = (TextView) ac.findViewById(R.id.notifications_quiet_hours_end);
final TextView quietHourStartTagView = (TextView) ac.findViewById(R.id.notifications_quiet_hours_start_tag);
final TextView quietHourEndTagView = (TextView) ac.findViewById(R.id.notifications_quiet_hours_end_tag);
final TextView notificationsDuringQuietHours = (TextView) ac.findViewById(R.id.notifications_show_in_quiet_hours);
int color = getEnabledTextColor(ac);
if(!boo)
color = getDisabledTextColor(ac);
quietHourStartView.setTextColor(color);
quietHourEndView.setTextColor(color);
quietHourStartTagView.setTextColor(color);
quietHourEndTagView.setTextColor(color);
notificationsDuringQuietHours.setTextColor(color);
MaterialRippleLayout rippleStart = (MaterialRippleLayout) ac.findViewById(R.id.notifications_quiet_hours_start_ripple);
rippleStart.setEnabled(boo);
MaterialRippleLayout rippleEnd = (MaterialRippleLayout) ac.findViewById(R.id.notifications_quiet_hours_end_ripple);
rippleEnd.setEnabled(boo);
MaterialRippleLayout rippleShowNotificationsInQuietHours = (MaterialRippleLayout) ac.findViewById(R.id.notifications_show_in_quiet_hours_ripple);
rippleShowNotificationsInQuietHours.setEnabled(boo);
}
示例9: enableVibrate
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
/**
* Enables or disables the ability to change the vibrate function.
* It also changes the color of the view
*/
private static void enableVibrate(boolean boo, Activity ac) {
final TextView vibrateView = (TextView) ac.findViewById(R.id.notifications_vibrate);
MaterialRippleLayout rippleVibrate = (MaterialRippleLayout) ac.findViewById(R.id.notifications_vibrate_ripple);
int color = getEnabledTextColor(ac);
if(!boo)
color = getDisabledTextColor(ac);
vibrateView.setTextColor(color);
rippleVibrate.setEnabled(boo);
}
示例10: enableScreenWake
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
/**
* Enables or disables the ability to change the screen wake function.
* It also changes the color of the view
*/
private static void enableScreenWake(boolean boo, Activity ac) {
final TextView screenWakeView = (TextView) ac.findViewById(R.id.notifications_screen_wake);
MaterialRippleLayout rippleScreenWake = (MaterialRippleLayout) ac.findViewById(R.id.notifications_screen_wake_ripple);
int color = getEnabledTextColor(ac);
if(!boo)
color = getDisabledTextColor(ac);
screenWakeView.setTextColor(color);
rippleScreenWake.setEnabled(boo);
}
示例11: enableSoundPlay
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
/**
* Enables or disables the ability to change the play sound function.
* It also changes the color of the view
*/
private static void enableSoundPlay(boolean boo, Activity ac) {
final TextView soundPlayView = (TextView) ac.findViewById(R.id.notifications_sound);
MaterialRippleLayout rippleSoundPlay = (MaterialRippleLayout) ac.findViewById(R.id.notifications_sound_ripple);
int color = getEnabledTextColor(ac);
if(!boo)
color = getDisabledTextColor(ac);
soundPlayView.setTextColor(color);
rippleSoundPlay.setEnabled(boo);
}
示例12: enableBlinkLED
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
/**
* Enables or disables the ability to change the blink LED function.
* It also changes the color of the view
*/
private static void enableBlinkLED(boolean boo, Activity ac) {
final CheckedTextView soundPlayView = (CheckedTextView) ac.findViewById(R.id.notifications_led);
MaterialRippleLayout rippleSoundPlay = (MaterialRippleLayout) ac.findViewById(R.id.notifications_led_ripple);
int color = getEnabledTextColor(ac);
if(!boo)
color = getDisabledTextColor(ac);
soundPlayView.setTextColor(color);
rippleSoundPlay.setEnabled(boo);
}
示例13: enableQuietHoursCheck
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
/**
* Enables or disables the ability to change the quiet hours function.
* It also changes the color of the view
*/
private static void enableQuietHoursCheck(boolean boo, Activity ac) {
final TextView quietHoursView = (TextView) ac.findViewById(R.id.notifications_quiet_hours);
MaterialRippleLayout rippleSoundPlay = (MaterialRippleLayout) ac.findViewById(R.id.notifications_quiet_hours_ripple);
int color = getEnabledTextColor(ac);
if(!boo)
color = getDisabledTextColor(ac);
quietHoursView.setTextColor(color);
rippleSoundPlay.setEnabled(boo);
}
示例14: ripple
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
public static void ripple(View view) {
MaterialRippleLayout.on(view)
.rippleColor(AppController.getAppContext().getResources().getColor(R.color.colorAccent))
.rippleAlpha(0.2f)
.rippleHover(true)
.create();
}
示例15: ripple
import com.balysv.materialripple.MaterialRippleLayout; //导入依赖的package包/类
public static void ripple(View view) {
MaterialRippleLayout.on(view)
.rippleColor(App.getAppContext().getResources().getColor(R.color.theme_red))
.rippleAlpha(0.2f)
.rippleHover(true)
.create();
}