feat: show event log at profile activity
Co-authored-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
This commit is contained in:
parent
5f1f86f355
commit
4969677765
@ -345,10 +345,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
private boolean callItemVisible;
|
private boolean callItemVisible;
|
||||||
private boolean videoCallItemVisible;
|
private boolean videoCallItemVisible;
|
||||||
private boolean editItemVisible;
|
private boolean editItemVisible;
|
||||||
|
private boolean eventLogItemVisible;
|
||||||
private ActionBarMenuItem animatingItem;
|
private ActionBarMenuItem animatingItem;
|
||||||
private ActionBarMenuItem callItem;
|
private ActionBarMenuItem callItem;
|
||||||
private ActionBarMenuItem videoCallItem;
|
private ActionBarMenuItem videoCallItem;
|
||||||
private ActionBarMenuItem editItem;
|
private ActionBarMenuItem editItem;
|
||||||
|
private ActionBarMenuItem eventLogItem;
|
||||||
private ActionBarMenuItem otherItem;
|
private ActionBarMenuItem otherItem;
|
||||||
private ActionBarMenuItem searchItem;
|
private ActionBarMenuItem searchItem;
|
||||||
private ImageView ttlIconView;
|
private ImageView ttlIconView;
|
||||||
@ -1340,6 +1342,11 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
editItem.setScaleY(1f - value);
|
editItem.setScaleY(1f - value);
|
||||||
editItem.setAlpha(1f - value);
|
editItem.setAlpha(1f - value);
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setScaleX(1f - value);
|
||||||
|
eventLogItem.setScaleY(1f - value);
|
||||||
|
eventLogItem.setAlpha(1f - value);
|
||||||
|
}
|
||||||
if (callItemVisible) {
|
if (callItemVisible) {
|
||||||
callItem.setScaleX(1f - value);
|
callItem.setScaleX(1f - value);
|
||||||
callItem.setScaleY(1f - value);
|
callItem.setScaleY(1f - value);
|
||||||
@ -1365,6 +1372,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
if (editItemVisible) {
|
if (editItemVisible) {
|
||||||
editItem.setVisibility(GONE);
|
editItem.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setVisibility(GONE);
|
||||||
|
}
|
||||||
if (callItemVisible) {
|
if (callItemVisible) {
|
||||||
callItem.setVisibility(GONE);
|
callItem.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
@ -1384,6 +1394,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
if (editItemVisible) {
|
if (editItemVisible) {
|
||||||
editItem.setVisibility(VISIBLE);
|
editItem.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
if (callItemVisible) {
|
if (callItemVisible) {
|
||||||
callItem.setVisibility(VISIBLE);
|
callItem.setVisibility(VISIBLE);
|
||||||
}
|
}
|
||||||
@ -1520,6 +1533,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
return callItem;
|
return callItem;
|
||||||
} else if (editItemVisible) {
|
} else if (editItemVisible) {
|
||||||
return editItem;
|
return editItem;
|
||||||
|
} else if (eventLogItemVisible) {
|
||||||
|
return eventLogItem;
|
||||||
} else if (searchItem != null) {
|
} else if (searchItem != null) {
|
||||||
return searchItem;
|
return searchItem;
|
||||||
} else {
|
} else {
|
||||||
@ -2813,6 +2828,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
callItem.setVisibility(expanded || !callItemVisible ? GONE : INVISIBLE);
|
callItem.setVisibility(expanded || !callItemVisible ? GONE : INVISIBLE);
|
||||||
videoCallItem.setVisibility(expanded || !videoCallItemVisible ? GONE : INVISIBLE);
|
videoCallItem.setVisibility(expanded || !videoCallItemVisible ? GONE : INVISIBLE);
|
||||||
editItem.setVisibility(expanded || !editItemVisible ? GONE : INVISIBLE);
|
editItem.setVisibility(expanded || !editItemVisible ? GONE : INVISIBLE);
|
||||||
|
eventLogItem.setVisibility(expanded || !eventLogItemVisible ? GONE : INVISIBLE);
|
||||||
otherItem.setVisibility(expanded ? GONE : INVISIBLE);
|
otherItem.setVisibility(expanded ? GONE : INVISIBLE);
|
||||||
// if (qrItem != null) {
|
// if (qrItem != null) {
|
||||||
// qrItem.setVisibility(expanded ? GONE : INVISIBLE);
|
// qrItem.setVisibility(expanded ? GONE : INVISIBLE);
|
||||||
@ -2888,6 +2904,8 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
callItem = menu.addItem(call_item, R.drawable.ic_call);
|
callItem = menu.addItem(call_item, R.drawable.ic_call);
|
||||||
callItem.setContentDescription(LocaleController.getString("Call", R.string.Call));
|
callItem.setContentDescription(LocaleController.getString("Call", R.string.Call));
|
||||||
}
|
}
|
||||||
|
eventLogItem = menu.addItem(event_log, R.drawable.msg_log);
|
||||||
|
eventLogItem.setContentDescription(LocaleController.getString("EventLog", R.string.EventLog));
|
||||||
editItem = menu.addItem(edit_channel, R.drawable.group_edit_profile);
|
editItem = menu.addItem(edit_channel, R.drawable.group_edit_profile);
|
||||||
editItem.setContentDescription(LocaleController.getString("Edit", R.string.Edit));
|
editItem.setContentDescription(LocaleController.getString("Edit", R.string.Edit));
|
||||||
otherItem = menu.addItem(10, R.drawable.ic_ab_other, resourcesProvider);
|
otherItem = menu.addItem(10, R.drawable.ic_ab_other, resourcesProvider);
|
||||||
@ -5800,6 +5818,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
callItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
callItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
||||||
videoCallItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
videoCallItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
||||||
editItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
editItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
||||||
|
eventLogItem.setIconColor(getThemedColor(Theme.key_actionBarDefaultIcon));
|
||||||
|
|
||||||
if (verifiedDrawable != null) {
|
if (verifiedDrawable != null) {
|
||||||
color1 = getThemedColor(Theme.key_profile_verifiedBackground);
|
color1 = getThemedColor(Theme.key_profile_verifiedBackground);
|
||||||
@ -5821,7 +5840,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
|
|
||||||
updateEmojiStatusDrawableColor();
|
updateEmojiStatusDrawableColor();
|
||||||
|
|
||||||
if (avatarsViewPagerIndicatorView.getSecondaryMenuItem() != null && (videoCallItemVisible || editItemVisible || callItemVisible)) {
|
if (avatarsViewPagerIndicatorView.getSecondaryMenuItem() != null && (videoCallItemVisible || editItemVisible || callItemVisible || eventLogItemVisible)) {
|
||||||
needLayoutText(Math.min(1f, extraHeight / AndroidUtilities.dp(88f)));
|
needLayoutText(Math.min(1f, extraHeight / AndroidUtilities.dp(88f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5854,6 +5873,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
if (editItemVisible) {
|
if (editItemVisible) {
|
||||||
editItem.setVisibility(View.VISIBLE);
|
editItem.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
otherItem.setVisibility(View.VISIBLE);
|
otherItem.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
if (sharedMediaLayout.isSearchItemVisible()) {
|
if (sharedMediaLayout.isSearchItemVisible()) {
|
||||||
@ -5876,10 +5898,12 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
animators.add(ObjectAnimator.ofFloat(videoCallItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
animators.add(ObjectAnimator.ofFloat(videoCallItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(otherItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
animators.add(ObjectAnimator.ofFloat(otherItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(editItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
animators.add(ObjectAnimator.ofFloat(editItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
||||||
|
animators.add(ObjectAnimator.ofFloat(eventLogItem, View.ALPHA, visible ? 0.0f : 1.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(callItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
animators.add(ObjectAnimator.ofFloat(callItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(videoCallItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
animators.add(ObjectAnimator.ofFloat(videoCallItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(otherItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
animators.add(ObjectAnimator.ofFloat(otherItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(editItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
animators.add(ObjectAnimator.ofFloat(editItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
||||||
|
animators.add(ObjectAnimator.ofFloat(eventLogItem, View.TRANSLATION_Y, visible ? -AndroidUtilities.dp(10) : 0.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(mediaSearchItem, View.ALPHA, visible ? 1.0f : 0.0f));
|
animators.add(ObjectAnimator.ofFloat(mediaSearchItem, View.ALPHA, visible ? 1.0f : 0.0f));
|
||||||
animators.add(ObjectAnimator.ofFloat(mediaSearchItem, View.TRANSLATION_Y, visible ? 0.0f : AndroidUtilities.dp(10)));
|
animators.add(ObjectAnimator.ofFloat(mediaSearchItem, View.TRANSLATION_Y, visible ? 0.0f : AndroidUtilities.dp(10)));
|
||||||
animators.add(ObjectAnimator.ofFloat(sharedMediaLayout.photoVideoOptionsItem, View.ALPHA, visible ? 1.0f : 0.0f));
|
animators.add(ObjectAnimator.ofFloat(sharedMediaLayout.photoVideoOptionsItem, View.ALPHA, visible ? 1.0f : 0.0f));
|
||||||
@ -5908,6 +5932,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
if (editItemVisible) {
|
if (editItemVisible) {
|
||||||
editItem.setVisibility(View.GONE);
|
editItem.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
otherItem.setVisibility(View.GONE);
|
otherItem.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
if (sharedMediaLayout.isSearchItemVisible()) {
|
if (sharedMediaLayout.isSearchItemVisible()) {
|
||||||
@ -6472,6 +6499,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
int viewWidth = AndroidUtilities.isTablet() ? AndroidUtilities.dp(490) : AndroidUtilities.displaySize.x;
|
int viewWidth = AndroidUtilities.isTablet() ? AndroidUtilities.dp(490) : AndroidUtilities.displaySize.x;
|
||||||
ActionBarMenuItem item = avatarsViewPagerIndicatorView.getSecondaryMenuItem();
|
ActionBarMenuItem item = avatarsViewPagerIndicatorView.getSecondaryMenuItem();
|
||||||
int extra = 0;
|
int extra = 0;
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
extra += 48;
|
||||||
|
}
|
||||||
if (editItemVisible) {
|
if (editItemVisible) {
|
||||||
extra += 48;
|
extra += 48;
|
||||||
}
|
}
|
||||||
@ -7200,6 +7230,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
editItem.setAlpha(0.0f);
|
editItem.setAlpha(0.0f);
|
||||||
animators.add(ObjectAnimator.ofFloat(editItem, View.ALPHA, 1.0f));
|
animators.add(ObjectAnimator.ofFloat(editItem, View.ALPHA, 1.0f));
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setAlpha(0.0f);
|
||||||
|
animators.add(ObjectAnimator.ofFloat(eventLogItem, View.ALPHA, 1.0f));
|
||||||
|
}
|
||||||
if (ttlIconView.getTag() != null) {
|
if (ttlIconView.getTag() != null) {
|
||||||
ttlIconView.setAlpha(0f);
|
ttlIconView.setAlpha(0f);
|
||||||
animators.add(ObjectAnimator.ofFloat(ttlIconView, View.ALPHA, 1.0f));
|
animators.add(ObjectAnimator.ofFloat(ttlIconView, View.ALPHA, 1.0f));
|
||||||
@ -7260,6 +7294,10 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
editItem.setAlpha(1.0f);
|
editItem.setAlpha(1.0f);
|
||||||
animators.add(ObjectAnimator.ofFloat(editItem, View.ALPHA, 0.0f));
|
animators.add(ObjectAnimator.ofFloat(editItem, View.ALPHA, 0.0f));
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setAlpha(1.0f);
|
||||||
|
animators.add(ObjectAnimator.ofFloat(eventLogItem, View.ALPHA, 0.0f));
|
||||||
|
}
|
||||||
if (ttlIconView != null) {
|
if (ttlIconView != null) {
|
||||||
animators.add(ObjectAnimator.ofFloat(ttlIconView, View.ALPHA, ttlIconView.getAlpha(), 0.0f));
|
animators.add(ObjectAnimator.ofFloat(ttlIconView, View.ALPHA, ttlIconView.getAlpha(), 0.0f));
|
||||||
}
|
}
|
||||||
@ -8475,6 +8513,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
otherItem.removeAllSubItems();
|
otherItem.removeAllSubItems();
|
||||||
animatingItem = null;
|
animatingItem = null;
|
||||||
|
|
||||||
|
eventLogItemVisible = false;
|
||||||
editItemVisible = false;
|
editItemVisible = false;
|
||||||
callItemVisible = false;
|
callItemVisible = false;
|
||||||
videoCallItemVisible = false;
|
videoCallItemVisible = false;
|
||||||
@ -8612,6 +8651,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
}
|
}
|
||||||
if (ChatObject.hasAdminRights(currentChat)) {
|
if (ChatObject.hasAdminRights(currentChat)) {
|
||||||
otherItem.addSubItem(event_log, R.drawable.group_log, LocaleController.getString("EventLog", R.string.EventLog));
|
otherItem.addSubItem(event_log, R.drawable.group_log, LocaleController.getString("EventLog", R.string.EventLog));
|
||||||
|
eventLogItemVisible = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (chatInfo != null) {
|
if (chatInfo != null) {
|
||||||
@ -8703,9 +8743,27 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||||||
editItem.setVisibility(View.GONE);
|
editItem.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
if (eventLogItem.getVisibility() != View.VISIBLE) {
|
||||||
|
eventLogItem.setVisibility(View.VISIBLE);
|
||||||
|
if (animated) {
|
||||||
|
eventLogItem.setAlpha(0);
|
||||||
|
eventLogItem.animate().alpha(1f).setDuration(150).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (eventLogItem.getVisibility() != View.GONE) {
|
||||||
|
eventLogItem.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (avatarsViewPagerIndicatorView != null) {
|
if (avatarsViewPagerIndicatorView != null) {
|
||||||
if (avatarsViewPagerIndicatorView.isIndicatorFullyVisible()) {
|
if (avatarsViewPagerIndicatorView.isIndicatorFullyVisible()) {
|
||||||
|
if (eventLogItemVisible) {
|
||||||
|
eventLogItem.setVisibility(View.GONE);
|
||||||
|
eventLogItem.animate().cancel();
|
||||||
|
eventLogItem.setAlpha(1f);
|
||||||
|
}
|
||||||
if (editItemVisible) {
|
if (editItemVisible) {
|
||||||
editItem.setVisibility(View.GONE);
|
editItem.setVisibility(View.GONE);
|
||||||
editItem.animate().cancel();
|
editItem.animate().cancel();
|
||||||
|
Loading…
Reference in New Issue
Block a user