use of org.telegram.ui.Cells.TextColorCell in project Telegram-FOSS by Telegram-FOSS-Team.
the class NotificationsCustomSettingsActivity method checkRowsEnabled.
private void checkRowsEnabled() {
if (!exceptions.isEmpty()) {
return;
}
int count = listView.getChildCount();
ArrayList<Animator> animators = new ArrayList<>();
boolean enabled = getNotificationsController().isGlobalNotificationsEnabled(currentType);
for (int a = 0; a < count; a++) {
View child = listView.getChildAt(a);
RecyclerListView.Holder holder = (RecyclerListView.Holder) listView.getChildViewHolder(child);
switch(holder.getItemViewType()) {
case 0:
{
HeaderCell headerCell = (HeaderCell) holder.itemView;
if (holder.getAdapterPosition() == messageSectionRow) {
headerCell.setEnabled(enabled, animators);
}
break;
}
case 1:
{
TextCheckCell textCell = (TextCheckCell) holder.itemView;
textCell.setEnabled(enabled, animators);
break;
}
case 3:
{
TextColorCell textCell = (TextColorCell) holder.itemView;
textCell.setEnabled(enabled, animators);
break;
}
case 5:
{
TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
textCell.setEnabled(enabled, animators);
break;
}
}
}
if (!animators.isEmpty()) {
if (animatorSet != null) {
animatorSet.cancel();
}
animatorSet = new AnimatorSet();
animatorSet.playTogether(animators);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
if (animator.equals(animatorSet)) {
animatorSet = null;
}
}
});
animatorSet.setDuration(150);
animatorSet.start();
}
}
use of org.telegram.ui.Cells.TextColorCell in project Telegram-FOSS by Telegram-FOSS-Team.
the class ProfileNotificationsActivity method checkRowsEnabled.
private void checkRowsEnabled() {
int count = listView.getChildCount();
ArrayList<Animator> animators = new ArrayList<>();
for (int a = 0; a < count; a++) {
View child = listView.getChildAt(a);
RecyclerListView.Holder holder = (RecyclerListView.Holder) listView.getChildViewHolder(child);
int type = holder.getItemViewType();
int position = holder.getAdapterPosition();
if (position != customRow && position != enableRow && type != 0) {
switch(type) {
case 1:
{
TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
textCell.setEnabled(customEnabled && notificationsEnabled, animators);
break;
}
case 2:
{
TextInfoPrivacyCell textCell = (TextInfoPrivacyCell) holder.itemView;
textCell.setEnabled(customEnabled && notificationsEnabled, animators);
break;
}
case 3:
{
TextColorCell textCell = (TextColorCell) holder.itemView;
textCell.setEnabled(customEnabled && notificationsEnabled, animators);
break;
}
case 4:
{
RadioCell radioCell = (RadioCell) holder.itemView;
radioCell.setEnabled(customEnabled && notificationsEnabled, animators);
break;
}
case 8:
{
if (position == previewRow) {
TextCheckCell checkCell = (TextCheckCell) holder.itemView;
checkCell.setEnabled(customEnabled && notificationsEnabled, animators);
}
break;
}
}
}
}
if (!animators.isEmpty()) {
if (animatorSet != null) {
animatorSet.cancel();
}
animatorSet = new AnimatorSet();
animatorSet.playTogether(animators);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
if (animator.equals(animatorSet)) {
animatorSet = null;
}
}
});
animatorSet.setDuration(150);
animatorSet.start();
}
}
Aggregations