Kate Mobile v109.1版本的 MD5 值为:fcd76ded5f363ecbfac46035a4ed2a23
以下内容为反编译后的 GroupActivity.java 源代码,内容仅作参考
package com.perm.kate;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ImageSpan;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.perm.kate.AudioClickHelper;
import com.perm.kate.api.Audio;
import com.perm.kate.api.Contact;
import com.perm.kate.api.Group;
import com.perm.kate.api.Photo;
import com.perm.kate.api.User;
import com.perm.kate.history.History;
import com.perm.kate.photoupload.AvatarUploader;
import com.perm.kate.photoupload.PhotoChooser;
import com.perm.kate.photoupload.UploadCallback;
import com.perm.kate.session.Callback;
import com.perm.kate.theme.ThemeColorsHelper;
import com.perm.utils.Linkify;
import com.perm.utils.ShortcutHelper;
import com.perm.utils.SmileHelper;
import com.perm.utils.WallSubscriptions;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
public class GroupActivity extends BaseActivity {
private ArrayList contacts;
private ImageView coverView;
private View docs;
private View docs_separator;
private Group g;
private Integer is_favorite;
private boolean is_suggest;
private TextView label_status;
private ArrayList links;
private ImageView photo;
String screen_name;
private Audio status_audio;
private TextView tv_albums_count;
private TextView tv_audios_count;
private TextView tv_contacts_count;
private TextView tv_docs_count;
private TextView tv_links_count;
private TextView tv_members_count;
private TextView tv_photos_count;
private TextView tv_podcasts_count;
private TextView tv_topics_count;
private TextView tv_videos_count;
private TextView tv_wall_count;
private Long group_id = null;
private Long user_id = null;
private boolean is_join_group = false;
private boolean is_closed = false;
private final Callback callback = new Callback(this) {
@Override
public void error(Throwable th) {
GroupActivity.this.showProgressBar(false);
super.error(th);
}
@Override
public void ready(Object obj) {
GroupActivity.this.showProgressBar(false);
ArrayList arrayList = (ArrayList) obj;
if (arrayList == null || arrayList.size() <= 0) {
return;
}
Group group = (Group) arrayList.get(0);
if (((Group) arrayList.get(0)).is_member.booleanValue() && !GroupActivity.this.is_join_group) {
KApplication.db.createUserGroup(GroupActivity.this.user_id.longValue(), GroupActivity.this.group_id.longValue(), group.is_admin, group.admin_level);
} else if (!((Group) arrayList.get(0)).is_member.booleanValue()) {
KApplication.db.deleteUserGroup(GroupActivity.this.user_id.longValue(), GroupActivity.this.group_id.longValue());
}
KApplication.db.createOrUpdateGroup((Group) arrayList.get(0), true);
GroupActivity.this.contacts = ((Group) arrayList.get(0)).contacts;
GroupActivity.this.links = ((Group) arrayList.get(0)).links;
GroupActivity.this.status_audio = ((Group) arrayList.get(0)).status_audio;
GroupActivity.this.is_favorite = ((Group) arrayList.get(0)).is_favorite;
GroupActivity.this.is_messages_blocked = ((Group) arrayList.get(0)).is_messages_blocked;
GroupActivity.this.screen_name = ((Group) arrayList.get(0)).screen_name;
GroupActivity.this.displayDataOnUiThread();
Long l = group.ban_info_end_date;
if (l != null) {
GroupActivity.this.displayBanInfoInUiThread(l.longValue(), group.ban_info_comment, group.ban_info_reason);
}
}
};
Integer is_messages_blocked = null;
private final Callback callback_wall_count = new Callback(this) {
@Override
public void error(Throwable th) {
}
@Override
public void ready(Object obj) {
Integer num = (Integer) obj;
KApplication.db.updateGroupWallCount(GroupActivity.this.group_id.longValue(), num);
GroupActivity.this.displayWallCountInUiThread(num);
}
};
private final View.OnClickListener topicClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(GroupActivity.this, GroupTopicsActivity.class);
intent.putExtra("com.perm.kate.gid", Long.toString(GroupActivity.this.group_id.longValue()));
GroupActivity.this.startActivity(intent);
}
};
private final View.OnClickListener goodsClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(GroupActivity.this, MarketAlbumsActivity.class);
intent.putExtra("group_id", GroupActivity.this.group_id);
GroupActivity.this.startActivity(intent);
}
};
private final View.OnClickListener wallClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
intent.setClass(GroupActivity.this, WallActivity2.class);
intent.putExtra("com.perm.kate.user_id", Long.toString(GroupActivity.this.group_id.longValue() * (-1)));
intent.putExtra("com.perm.kate.is_suggest", GroupActivity.this.is_suggest);
GroupActivity.this.startActivity(intent);
}
};
private final View.OnClickListener audioClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity groupActivity = GroupActivity.this;
ProfileFragment.ShowAudioAcivity(groupActivity, Long.valueOf(-groupActivity.group_id.longValue()));
}
};
private final View.OnClickListener albumsClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity groupActivity = GroupActivity.this;
ProfileFragment.ShowAlbumsAcivity(groupActivity, Long.valueOf(-groupActivity.group_id.longValue()));
}
};
private final View.OnClickListener allPhotosClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity groupActivity = GroupActivity.this;
Helper.showAllPhotos(groupActivity, Long.toString(-groupActivity.group_id.longValue()));
}
};
private final View.OnClickListener videoClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity groupActivity = GroupActivity.this;
ProfileFragment.ShowVideosAcivity(groupActivity, Long.valueOf(-groupActivity.group_id.longValue()));
}
};
private final View.OnClickListener groupMenuClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (GroupActivity.this.g == null || GroupActivity.this.g.wiki_page == null) {
return;
}
Helper.showWebActivity("http://m.vk.com/pages?oid=-" + GroupActivity.this.g.gid + "&p=" + URLEncoder.encode(GroupActivity.this.g.wiki_page), GroupActivity.this.getString(R.string.group_menu), GroupActivity.this);
}
};
private final View.OnClickListener joinClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity.this.showJoinDialog();
}
};
private final View.OnClickListener membersClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity.this.showGroupMembers();
}
};
private final View.OnClickListener contactsClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (GroupActivity.this.contacts == null || GroupActivity.this.contacts.size() <= 0) {
return;
}
GroupActivity.this.showGroupContacts();
}
};
private final View.OnClickListener linksClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if ((GroupActivity.this.links == null || GroupActivity.this.links.size() <= 0) && !KApplication.db.isAdminInGroup(GroupActivity.this.user_id, GroupActivity.this.group_id.longValue())) {
return;
}
GroupActivity.this.showGroupLinks();
}
};
private final View.OnClickListener podcastsClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity.this.showPodcasts();
}
};
private final View.OnClickListener docsClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(GroupActivity.this, DocsActivity2.class);
intent.putExtra("owner_id", -GroupActivity.this.group_id.longValue());
GroupActivity.this.startActivity(intent);
}
};
private final View.OnClickListener storiesClickListener = new View.OnClickListener() {
@Override
public final void onClick(View view) {
GroupActivity.this.lambda$new$0(view);
}
};
private final Callback join_callback = new Callback(this) {
@Override
public void error(Throwable th) {
GroupActivity.this.showProgressBar(false);
super.error(th);
}
@Override
public void ready(Object obj) {
GroupActivity.this.showProgressBar(false);
String str = (String) obj;
if (str == null || !str.equals("1")) {
return;
}
if (GroupActivity.this.is_closed) {
GroupActivity.this.displayToast(R.string.toast_group_request_sent);
return;
}
GroupActivity.this.displayToast(R.string.toast_group_joined);
KApplication.db.createUserGroup(GroupActivity.this.user_id.longValue(), GroupActivity.this.group_id.longValue(), Boolean.FALSE, 0);
GroupActivity.this.displayDataOnUiThread();
}
};
private final Callback leave_callback = new Callback(this) {
@Override
public void error(Throwable th) {
GroupActivity.this.showProgressBar(false);
super.error(th);
}
@Override
public void ready(Object obj) {
GroupActivity.this.showProgressBar(false);
String str = (String) obj;
if (str == null || !str.equals("1")) {
return;
}
GroupActivity.this.displayToast(R.string.toast_group_leaved);
KApplication.db.deleteUserGroup(GroupActivity.this.user_id.longValue(), GroupActivity.this.group_id.longValue());
GroupActivity.this.displayDataOnUiThread();
}
};
private final View.OnLongClickListener descriptionLongClickListener = new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
TextView textView = (TextView) view;
if (textView != null) {
Helper.createCopyTextContextMenu(textView.getText().toString(), GroupActivity.this);
return true;
}
return false;
}
};
private final View.OnClickListener photoClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity.this.downloadAvatarsAlbum();
}
};
private final PhotoChooser.Callback photoChooserCallback = new PhotoChooser.Callback() {
@Override
public void canceled() {
}
@Override
public void selected(ArrayList arrayList) {
GroupActivity.this.editPhotoBeforeUpload(arrayList);
}
@Override
public void selectedFromAlbum(ArrayList arrayList) {
}
};
protected final UploadCallback uploadCallback = new UploadCallback() {
@Override
public void success(ArrayList arrayList) {
GroupActivity.this.refreshInThread();
}
};
private final Callback avatars_photos_callback = new Callback(this) {
@Override
public void ready(Object obj) {
GroupActivity.this.showAvatarImage((ArrayList) obj);
}
};
private final View.OnClickListener statusClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (KApplication.db.isAdminOrEditorInGroup(GroupActivity.this.user_id, GroupActivity.this.group_id.longValue()) && GroupActivity.this.status_audio == null) {
GroupActivity.this.showStatusAcivity();
} else if (GroupActivity.this.status_audio != null) {
ArrayList arrayList = new ArrayList();
arrayList.add(GroupActivity.this.status_audio);
new AudioClickHelper(GroupActivity.this, null).CreateContextMenu(GroupActivity.this.status_audio, false, arrayList, false, 11);
} else if (GroupActivity.this.g == null || !Helper.isNotEmpty(GroupActivity.this.g.status)) {
} else {
GroupActivity.this.showStatusDialog();
}
}
};
private final View.OnClickListener messageClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity.this.showMessageThread();
}
};
private final View.OnClickListener messagesReadClick = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (KApplication.getSession(GroupActivity.this.group_id.longValue()) != null) {
GroupActivity.this.startDialogs();
} else if (!KApplication.db.isAdminInGroup(GroupActivity.this.user_id, GroupActivity.this.group_id.longValue())) {
GroupActivity.this.showGroupTokenDialog();
} else {
Intent intent = new Intent();
intent.setClass(GroupActivity.this, LoginActivity.class);
intent.putExtra("group_id", GroupActivity.this.group_id);
GroupActivity.this.startActivityForResult(intent, 5);
}
}
};
static class AudioClickHelper extends com.perm.kate.AudioClickHelper {
public AudioClickHelper(BaseActivity baseActivity, AudioClickHelper.AudioClickHelperCallback audioClickHelperCallback) {
super(baseActivity, audioClickHelperCallback);
}
}
private void adjustCoverViewSize() {
Display defaultDisplay = getWindowManager().getDefaultDisplay();
this.coverView.getLayoutParams().height = (KApplication.isTablet ? Math.max(defaultDisplay.getWidth(), defaultDisplay.getHeight()) : Math.min(defaultDisplay.getWidth(), defaultDisplay.getHeight())) / (KApplication.isTablet ? 6 : 3);
}
private void allowMessages() {
new Thread() {
@Override
public void run() {
GroupActivity.this.showProgressBar(true);
KApplication.session.allowMessagesFromGroup(GroupActivity.this.group_id.longValue(), new Callback(GroupActivity.this) {
@Override
public void ready(Object obj) {
if (((Integer) obj).intValue() == 1) {
GroupActivity.this.is_messages_blocked = 0;
}
}
}, GroupActivity.this);
GroupActivity.this.showProgressBar(false);
}
}.start();
}
private void choseSubscriptionType() {
AlertDialog create = new AlertDialog.Builder(this).setTitle(R.string.wall_notify_enable).setItems(new CharSequence[]{getText(R.string.menu_all_posts), getText(R.string.menu_suggested_posts)}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i == 0) {
GroupActivity.this.subscribe(0);
} else if (i != 1) {
} else {
GroupActivity.this.subscribe(1);
}
}
}).create();
create.setCanceledOnTouchOutside(true);
create.show();
}
private void copyGroupLink() {
String str = "club" + this.group_id;
if (TextUtils.isEmpty(this.screen_name) || str.equals(this.screen_name)) {
Helper.copyGroupLink(this.group_id.longValue(), null, this);
return;
}
new AlertDialog.Builder(this).setItems(new CharSequence[]{"https://vk.com/" + this.screen_name, "https://vk.com/" + str}, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
GroupActivity.this.lambda$copyGroupLink$1(dialogInterface, i);
}
}).create().show();
}
public void coverClick() {
if (this.g == null) {
return;
}
Intent intent = new Intent();
intent.setClass(this, PhotoViewerActrivity.class);
ArrayList arrayList = new ArrayList();
Photo photo = new Photo();
Group group = this.g;
photo.src_big = group.cover_800;
photo.src = group.cover_400;
arrayList.add(photo);
intent.putExtra("com.perm.kate.photos", arrayList);
startActivity(intent);
}
private void denyMessages() {
new Thread() {
@Override
public void run() {
GroupActivity.this.showProgressBar(true);
KApplication.session.denyMessagesFromGroup(GroupActivity.this.group_id.longValue(), new Callback(GroupActivity.this) {
@Override
public void ready(Object obj) {
if (((Integer) obj).intValue() == 1) {
GroupActivity.this.is_messages_blocked = 1;
}
}
}, GroupActivity.this);
GroupActivity.this.showProgressBar(false);
}
}.start();
}
public void displayBanInfo(long j, String str, Integer num) {
String str2 = getString(R.string.toast_group_ban_list) + "\n";
if (num != null && num.intValue() > 0) {
str2 = str2 + "\n" + getString(R.string.label_ban_reason) + ": " + getResources().getStringArray(R.array.ban_reason_values)[num.intValue()];
}
if (j > 0) {
str2 = str2 + "\n" + getString(R.string.blocked_till) + " " + Helper.getDate(j);
}
if (str != null && str.length() > 0) {
str2 = str2 + "\n" + getString(R.string.text_comment) + ": " + str;
}
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(str2).setPositiveButton("OK", (DialogInterface.OnClickListener) null);
AlertDialog create = builder.create();
create.setCanceledOnTouchOutside(true);
create.show();
}
public void displayBanInfoInUiThread(final long j, final String str, final Integer num) {
if (isFinishing()) {
return;
}
runOnUiThread(new Runnable() {
@Override
public void run() {
GroupActivity.this.displayBanInfo(j, str, num);
}
});
}
public void displayData() {
boolean z;
TextView textView;
Integer num;
TextView textView2;
Integer num2;
boolean z2;
String str;
String str2;
Integer num3;
ArrayList arrayList;
Integer num4;
Integer num5;
Integer num6;
Integer num7;
Integer num8;
Integer num9;
boolean z3;
View findViewById;
View findViewById2;
Boolean bool;
Boolean bool2;
String coverUrl;
View findViewById3;
Integer num10;
TextView textView3;
Group group;
String str3;
Long l;
try {
Group fetchGroupFull = KApplication.db.fetchGroupFull(this.group_id.longValue());
this.g = fetchGroupFull;
if (fetchGroupFull == null) {
return;
}
getIsSuggest();
int i = 0;
if (this.g.is_closed.intValue() != 1 && this.g.is_closed.intValue() != 2) {
z = false;
this.is_closed = z;
textView = (TextView) findViewById(R.id.name);
num = this.g.verified;
if (num == null && num.intValue() == 1) {
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
spannableStringBuilder.append((CharSequence) this.g.name).append((CharSequence) " ");
spannableStringBuilder.setSpan(new ImageSpan(this, ThemeColorsHelper.isLightTheme() ? R.drawable.ic_verified : R.drawable.ic_verified2, 1), spannableStringBuilder.length() - 1, spannableStringBuilder.length(), 33);
textView.setText(spannableStringBuilder);
textView.setContentDescription(this.g.name + ", страница подтверждена");
} else {
textView.setText(this.g.name);
}
Group group2 = this.g;
((TextView) findViewById(R.id.tv_group_type)).setText(getStringTypeGroup(this, group2.type, group2.is_closed));
textView2 = (TextView) findViewById(R.id.tv_start_date);
num2 = this.g.type;
if (num2 != null && num2.intValue() == 2 && (l = this.g.start_date) != null && l.longValue() > 0) {
textView2.setVisibility(0);
textView2.setText(Helper.getStringDate(this.g.start_date.longValue(), this));
}
boolean isJoinGroup = KApplication.db.isJoinGroup(this.group_id.longValue(), this.user_id.longValue());
this.is_join_group = isJoinGroup;
z2 = isJoinGroup;
View findViewById4 = findViewById(R.id.fl_button_bg2);
findViewById4.setVisibility(!this.is_join_group ? 8 : 0);
((TextView) findViewById(R.id.join_group_text)).setText(!this.is_closed ? R.string.label_request_for_join_group : R.string.label_join_group);
KApplication.getImageLoader().DisplayImage(this.g.photo_medium, this.photo, true, 90, Helper.getAvaStubId(), true);
if (Build.VERSION.SDK_INT == 23 && (str3 = (group = this.g).description) != null) {
group.description = str3.replace("\u00ad", "-");
}
str = this.g.description;
if (str != null && str.length() > 0) {
findViewById(R.id.ll_description).setVisibility(0);
findViewById(R.id.group_separator).setVisibility(0);
SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(this.g.description);
Linkify.addWebLinks(spannableStringBuilder2);
NewsCursorAdapter.spannableLink(spannableStringBuilder2, this, true);
((TextView) findViewById(R.id.tv_description)).setText(spannableStringBuilder2);
((TextView) findViewById(R.id.tv_description)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.tv_description)).setOnLongClickListener(this.descriptionLongClickListener);
}
if (this.g.wiki_page != null) {
findViewById(R.id.group_menu).setVisibility(8);
if (isOldUI()) {
findViewById(R.id.group_separator).setVisibility(8);
}
} else {
findViewById(R.id.group_menu).setVisibility(0);
if (isOldUI()) {
findViewById(R.id.group_separator).setVisibility(0);
}
}
TextView textView4 = this.tv_contacts_count;
ArrayList arrayList2 = this.contacts;
str2 = "0";
textView4.setText((arrayList2 != null || arrayList2.size() <= 0) ? "0" : String.valueOf(this.contacts.size()));
this.tv_contacts_count.setVisibility(0);
num3 = this.g.members_count;
if (num3 != null && (textView3 = this.tv_members_count) != null) {
textView3.setText(String.valueOf(num3));
this.tv_members_count.setVisibility(0);
}
TextView textView5 = this.tv_links_count;
arrayList = this.links;
if (arrayList != null && arrayList.size() > 0) {
str2 = String.valueOf(this.links.size());
}
textView5.setText(str2);
this.tv_links_count.setVisibility(0);
updateLabelStatus(this.g.status);
num4 = this.g.videos_count;
if (num4 != null) {
this.tv_videos_count.setText(String.valueOf(num4));
this.tv_videos_count.setVisibility(0);
}
num5 = this.g.topics_count;
if (num5 != null) {
this.tv_topics_count.setText(String.valueOf(num5));
this.tv_topics_count.setVisibility(0);
}
num6 = this.g.photos_count;
if (num6 != null) {
this.tv_photos_count.setText(String.valueOf(num6));
this.tv_photos_count.setVisibility(0);
}
num7 = this.g.albums_count;
if (num7 != null) {
this.tv_albums_count.setText(String.valueOf(num7));
this.tv_albums_count.setVisibility(0);
}
num8 = this.g.audios_count;
if (num8 != null) {
this.tv_audios_count.setText(String.valueOf(num8));
this.tv_audios_count.setVisibility(0);
}
if (this.g.type.intValue() == 1 && (num10 = this.g.docs_count) != null) {
this.tv_docs_count.setText(String.valueOf(num10));
this.tv_docs_count.setVisibility(0);
} else if (this.g.type.intValue() == 1) {
this.docs.setVisibility(8);
if (isOldUI()) {
this.docs_separator.setVisibility(8);
}
}
num9 = this.g.podcasts_count;
if (num9 != null && num9.intValue() > 0) {
findViewById(R.id.podcasts).setVisibility(0);
this.tv_podcasts_count.setText(String.valueOf(this.g.podcasts_count));
findViewById3 = findViewById(R.id.podcasts_separator);
if (findViewById3 != null) {
findViewById3.setVisibility(0);
}
}
displayWallCount(this.g.posts_count);
View findViewById5 = findViewById(R.id.fl_button_bg);
Boolean bool3 = this.g.can_message;
z3 = bool3 == null && bool3.booleanValue();
if (z3) {
findViewById5.setVisibility(8);
((LinearLayout.LayoutParams) findViewById4.getLayoutParams()).rightMargin = 0;
} else {
findViewById5.setVisibility(0);
((ViewGroup) findViewById5).getChildAt(0).setOnClickListener(this.messageClick);
((LinearLayout.LayoutParams) findViewById4.getLayoutParams()).rightMargin = Helper.getDIP(8.0d);
}
findViewById = findViewById(R.id.buttons);
if (!z2 && !z3) {
findViewById.setVisibility(8);
findViewById2 = findViewById(R.id.messages_read);
View findViewById6 = findViewById(R.id.read_messages_separator);
bool = this.g.can_message;
if (bool == null && bool.booleanValue() && KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue())) {
findViewById2.setOnClickListener(this.messagesReadClick);
findViewById2.setVisibility(0);
if (isOldUI()) {
findViewById6.setVisibility(0);
}
} else {
findViewById2.setVisibility(8);
if (isOldUI()) {
findViewById6.setVisibility(8);
}
}
bool2 = this.g.market_enabled;
if (bool2 == null && bool2.booleanValue()) {
findViewById(R.id.goods).setVisibility(0);
if (isOldUI()) {
findViewById(R.id.goods_separator).setVisibility(0);
}
} else {
findViewById(R.id.goods).setVisibility(8);
if (isOldUI()) {
findViewById(R.id.goods_separator).setVisibility(8);
}
}
coverUrl = getCoverUrl();
if (!TextUtils.isEmpty(coverUrl)) {
KApplication.getImageLoader().DisplayImage(coverUrl, this.coverView, true, 800, Helper.getSquareStubId(), false);
}
ImageView imageView = this.coverView;
if (getCoverEnabled() || TextUtils.isEmpty(coverUrl)) {
i = 8;
}
imageView.setVisibility(i);
}
findViewById.setVisibility(0);
findViewById2 = findViewById(R.id.messages_read);
View findViewById62 = findViewById(R.id.read_messages_separator);
bool = this.g.can_message;
if (bool == null) {
}
findViewById2.setVisibility(8);
if (isOldUI()) {
}
bool2 = this.g.market_enabled;
if (bool2 == null) {
}
findViewById(R.id.goods).setVisibility(8);
if (isOldUI()) {
}
coverUrl = getCoverUrl();
if (!TextUtils.isEmpty(coverUrl)) {
}
ImageView imageView2 = this.coverView;
if (getCoverEnabled()) {
}
i = 8;
imageView2.setVisibility(i);
}
z = true;
this.is_closed = z;
textView = (TextView) findViewById(R.id.name);
num = this.g.verified;
if (num == null) {
}
textView.setText(this.g.name);
Group group22 = this.g;
((TextView) findViewById(R.id.tv_group_type)).setText(getStringTypeGroup(this, group22.type, group22.is_closed));
textView2 = (TextView) findViewById(R.id.tv_start_date);
num2 = this.g.type;
if (num2 != null) {
textView2.setVisibility(0);
textView2.setText(Helper.getStringDate(this.g.start_date.longValue(), this));
}
boolean isJoinGroup2 = KApplication.db.isJoinGroup(this.group_id.longValue(), this.user_id.longValue());
this.is_join_group = isJoinGroup2;
if (isJoinGroup2) {
}
View findViewById42 = findViewById(R.id.fl_button_bg2);
findViewById42.setVisibility(!this.is_join_group ? 8 : 0);
((TextView) findViewById(R.id.join_group_text)).setText(!this.is_closed ? R.string.label_request_for_join_group : R.string.label_join_group);
KApplication.getImageLoader().DisplayImage(this.g.photo_medium, this.photo, true, 90, Helper.getAvaStubId(), true);
if (Build.VERSION.SDK_INT == 23) {
group.description = str3.replace("\u00ad", "-");
}
str = this.g.description;
if (str != null) {
findViewById(R.id.ll_description).setVisibility(0);
findViewById(R.id.group_separator).setVisibility(0);
SpannableStringBuilder spannableStringBuilder22 = new SpannableStringBuilder(this.g.description);
Linkify.addWebLinks(spannableStringBuilder22);
NewsCursorAdapter.spannableLink(spannableStringBuilder22, this, true);
((TextView) findViewById(R.id.tv_description)).setText(spannableStringBuilder22);
((TextView) findViewById(R.id.tv_description)).setMovementMethod(LinkMovementMethod.getInstance());
((TextView) findViewById(R.id.tv_description)).setOnLongClickListener(this.descriptionLongClickListener);
}
if (this.g.wiki_page != null) {
}
TextView textView42 = this.tv_contacts_count;
ArrayList arrayList22 = this.contacts;
str2 = "0";
textView42.setText((arrayList22 != null || arrayList22.size() <= 0) ? "0" : String.valueOf(this.contacts.size()));
this.tv_contacts_count.setVisibility(0);
num3 = this.g.members_count;
if (num3 != null) {
textView3.setText(String.valueOf(num3));
this.tv_members_count.setVisibility(0);
}
TextView textView52 = this.tv_links_count;
arrayList = this.links;
if (arrayList != null) {
str2 = String.valueOf(this.links.size());
}
textView52.setText(str2);
this.tv_links_count.setVisibility(0);
updateLabelStatus(this.g.status);
num4 = this.g.videos_count;
if (num4 != null) {
}
num5 = this.g.topics_count;
if (num5 != null) {
}
num6 = this.g.photos_count;
if (num6 != null) {
}
num7 = this.g.albums_count;
if (num7 != null) {
}
num8 = this.g.audios_count;
if (num8 != null) {
}
if (this.g.type.intValue() == 1) {
}
if (this.g.type.intValue() == 1) {
}
num9 = this.g.podcasts_count;
if (num9 != null) {
findViewById(R.id.podcasts).setVisibility(0);
this.tv_podcasts_count.setText(String.valueOf(this.g.podcasts_count));
findViewById3 = findViewById(R.id.podcasts_separator);
if (findViewById3 != null) {
}
}
displayWallCount(this.g.posts_count);
View findViewById52 = findViewById(R.id.fl_button_bg);
Boolean bool32 = this.g.can_message;
if (bool32 == null) {
}
if (z3) {
}
findViewById = findViewById(R.id.buttons);
if (!z2) {
findViewById.setVisibility(8);
findViewById2 = findViewById(R.id.messages_read);
View findViewById622 = findViewById(R.id.read_messages_separator);
bool = this.g.can_message;
if (bool == null) {
}
findViewById2.setVisibility(8);
if (isOldUI()) {
}
bool2 = this.g.market_enabled;
if (bool2 == null) {
}
findViewById(R.id.goods).setVisibility(8);
if (isOldUI()) {
}
coverUrl = getCoverUrl();
if (!TextUtils.isEmpty(coverUrl)) {
}
ImageView imageView22 = this.coverView;
if (getCoverEnabled()) {
}
i = 8;
imageView22.setVisibility(i);
}
findViewById.setVisibility(0);
findViewById2 = findViewById(R.id.messages_read);
View findViewById6222 = findViewById(R.id.read_messages_separator);
bool = this.g.can_message;
if (bool == null) {
}
findViewById2.setVisibility(8);
if (isOldUI()) {
}
bool2 = this.g.market_enabled;
if (bool2 == null) {
}
findViewById(R.id.goods).setVisibility(8);
if (isOldUI()) {
}
coverUrl = getCoverUrl();
if (!TextUtils.isEmpty(coverUrl)) {
}
ImageView imageView222 = this.coverView;
if (getCoverEnabled()) {
}
i = 8;
imageView222.setVisibility(i);
} catch (Throwable th) {
Helper.reportError(th);
th.printStackTrace();
}
}
public void displayDataOnUiThread() {
if (isFinishing()) {
return;
}
runOnUiThread(new Runnable() {
@Override
public void run() {
GroupActivity.this.displayData();
}
});
}
public void displayWallCount(Integer num) {
if (num != null) {
this.tv_wall_count.setText(Integer.toString(num.intValue()));
this.tv_wall_count.setVisibility(0);
}
}
public void displayWallCountInUiThread(final Integer num) {
if (isFinishing()) {
return;
}
runOnUiThread(new Runnable() {
@Override
public void run() {
GroupActivity.this.displayWallCount(num);
}
});
}
public void downloadAvatarsAlbum() {
showProgressBar(true);
new Thread() {
@Override
public void run() {
KApplication.session.getPhotos(Long.valueOf(-GroupActivity.this.group_id.longValue()), -6L, null, null, true, GroupActivity.this.avatars_photos_callback, GroupActivity.this);
GroupActivity.this.showProgressBar(false);
}
}.start();
}
public void editPhotoBeforeUpload(ArrayList arrayList) {
Intent intent = new Intent(this, PhotoUploadOptionsActivity.class);
intent.putExtra("uris", arrayList);
startActivityForResult(intent, 0);
}
private void faveAddGroup() {
final Callback callback = new Callback(this) {
@Override
public void error(Throwable th) {
GroupActivity.this.showProgressBar(false);
}
@Override
public void ready(Object obj) {
if (GroupActivity.this.isFinishing()) {
return;
}
GroupActivity.this.showProgressBar(false);
Integer num = (Integer) obj;
if (num == null || num.intValue() != 1) {
return;
}
GroupActivity.this.is_favorite = 1;
GroupActivity.this.displayToast(R.string.toast_bookmark_added);
}
};
showProgressBar(true);
new Thread() {
@Override
public void run() {
KApplication.session.faveAddPage(null, GroupActivity.this.group_id, callback, GroupActivity.this);
}
}.start();
}
private void faveRemoveGroup() {
final Callback callback = new Callback(this) {
@Override
public void error(Throwable th) {
GroupActivity.this.showProgressBar(false);
}
@Override
public void ready(Object obj) {
if (GroupActivity.this.isFinishing()) {
return;
}
GroupActivity.this.showProgressBar(false);
Integer num = (Integer) obj;
if (num == null || num.intValue() != 1) {
return;
}
GroupActivity.this.is_favorite = 0;
GroupActivity.this.displayToast(R.string.toast_bookmark_removed);
}
};
showProgressBar(true);
new Thread() {
@Override
public void run() {
KApplication.session.faveRemovePage(null, GroupActivity.this.group_id, callback, GroupActivity.this);
}
}.start();
}
private String getCoverUrl() {
Display defaultDisplay = getWindowManager().getDefaultDisplay();
return (KApplication.isTablet ? Math.max(defaultDisplay.getWidth(), defaultDisplay.getHeight()) : Math.min(defaultDisplay.getWidth(), defaultDisplay.getHeight())) / 3 > 400 ? this.g.cover_800 : this.g.cover_400;
}
private void getIsSuggest() {
Integer num = this.g.type;
if (num == null || 1 != num.intValue() || KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue())) {
return;
}
this.is_suggest = true;
}
public static String getStringTypeGroup(Activity activity, Integer num, Integer num2) {
return num == null ? "" : num.intValue() == 1 ? activity.getString(R.string.label_public) : num.intValue() == 2 ? (num2 == null || num2.intValue() != 0) ? (num2 == null || num2.intValue() != 1) ? activity.getString(R.string.label_event) : activity.getString(R.string.label_closed_event) : activity.getString(R.string.label_open_event) : (num2 == null || num2.intValue() != 0) ? (num2 == null || num2.intValue() != 1) ? (num2 == null || num2.intValue() != 2) ? activity.getString(R.string.group) : activity.getString(R.string.label_private_group) : activity.getString(R.string.label_closed_group) : activity.getString(R.string.label_open_group);
}
private void groupsInvite(final ArrayList arrayList) {
final Callback callback = new Callback(this) {
@Override
public void error(Throwable th) {
if (arrayList.size() == 1) {
super.error(th);
} else {
GroupActivity.this.displayToast(R.string.toast_invite_sent);
}
}
@Override
public void ready(Object obj) {
GroupActivity.this.displayToast(R.string.toast_invite_sent);
}
};
showProgressBar(true);
new Thread() {
@Override
public void run() {
KApplication.session.groupsInvite(GroupActivity.this.group_id.longValue(), arrayList, callback, GroupActivity.this);
GroupActivity.this.showProgressBar(false);
}
}.start();
}
static boolean isOldUI() {
return PreferenceManager.getDefaultSharedPreferences(KApplication.current).getBoolean("old_group_1", false);
}
public void joinGroup() {
showProgressBar(true);
new Thread() {
@Override
public void run() {
KApplication.session.joinGroup(GroupActivity.this.group_id, null, GroupActivity.this.join_callback, GroupActivity.this);
}
}.start();
}
public void lambda$copyGroupLink$1(DialogInterface dialogInterface, int i) {
if (i == 0) {
Helper.copyGroupLink(this.group_id.longValue(), this.screen_name, this);
}
if (i == 1) {
Helper.copyGroupLink(this.group_id.longValue(), null, this);
}
}
public void lambda$new$0(View view) {
Intent intent = new Intent(this, StoriesActivity.class);
intent.putExtra("owner_id", -this.group_id.longValue());
startActivity(intent);
}
public void leaveGroup() {
showProgressBar(true);
new Thread() {
@Override
public void run() {
KApplication.session.leaveGroup(GroupActivity.this.group_id, GroupActivity.this.leave_callback, GroupActivity.this);
}
}.start();
}
public void refresh() {
showProgressBar(true);
ArrayList arrayList = new ArrayList();
arrayList.add(this.group_id);
KApplication.session.getGroups(arrayList, "description,wiki_page,can_see_all_posts,contacts,members_count,links,start_date,status,counters,is_favorite,ban_info,verified,can_message,market,cover,is_messages_blocked", this.callback, this);
if (KApplication.session == null) {
return;
}
KApplication.session.getWallCount(this.group_id.longValue() * (-1), this.group_id.longValue() == 26062647, this.callback_wall_count, this);
}
public void refreshInThread() {
showProgressBar(true);
new Thread() {
@Override
public void run() {
GroupActivity.this.refresh();
}
}.start();
}
public void showAvatarImage(ArrayList arrayList) {
if (isFinishing()) {
return;
}
Intent intent = new Intent();
intent.setClass(this, PhotoViewerActrivity.class);
if (arrayList == null) {
arrayList = new ArrayList();
}
if (arrayList.size() == 0) {
Photo photo = new Photo();
Group group = this.g;
String str = group.photo_big;
if (str != null) {
photo.src_big = str;
} else {
photo.src_big = group.photo_medium;
}
arrayList.add(photo);
}
intent.putExtra("com.perm.kate.photos", arrayList);
startActivity(intent);
}
private void showEditOptionsDialog() {
Integer num;
final ArrayList arrayList = new ArrayList();
if (KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue())) {
arrayList.add(new MenuItemDetails((int) R.string.edit_avatar, 11));
}
if (KApplication.db.isAdminInGroup(this.user_id, this.group_id.longValue())) {
arrayList.add(new MenuItemDetails((int) R.string.title_community_settings, 12));
arrayList.add(new MenuItemDetails((int) R.string.title_management, 18));
}
if (KApplication.db.isModerInGroup(this.user_id, this.group_id.longValue())) {
Group group = this.g;
if (group != null && (((num = group.type) == null || num.intValue() == 0) && this.g.is_closed.intValue() != 0)) {
arrayList.add(new MenuItemDetails((int) R.string.label_requests, 17));
}
arrayList.add(new MenuItemDetails((int) R.string.label_black_list, 8));
}
if (KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue())) {
arrayList.add(new MenuItemDetails((int) R.string.label_menu_status, 19));
}
AlertDialog create = new AlertDialog.Builder(this).setTitle(R.string.label_my_groups).setItems(MenuItemDetails.toArray(arrayList), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
int i2 = ((MenuItemDetails) arrayList.get(i)).code;
if (i2 == 8) {
GroupActivity.this.showGroupBlackList();
} else if (i2 == 11) {
PhotoChooser.requestPhoto(GroupActivity.this, null, false, false, false, null);
} else if (i2 == 12) {
GroupActivity.this.showGroupSettingsActivity();
} else {
switch (i2) {
case 17:
GroupActivity.this.showRequestsToGroupActivity();
return;
case 18:
GroupActivity.this.showManagementActivity();
return;
case 19:
GroupActivity.this.showStatusAcivity();
return;
default:
return;
}
}
}
}).create();
create.setCanceledOnTouchOutside(true);
create.show();
}
public void showGroupBlackList() {
Intent intent = new Intent();
intent.setClass(this, GroupBannedActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
startActivity(intent);
}
public void showGroupContacts() {
Intent intent = new Intent();
intent.setClass(this, GroupContactsActivity.class);
intent.putExtra("com.perm.kate.contacts", this.contacts);
startActivity(intent);
}
public void showGroupLinks() {
Intent intent = new Intent();
intent.setClass(this, GroupLinksActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
intent.putExtra("com.perm.kate.links", this.links);
if (KApplication.db.isAdminInGroup(this.user_id, this.group_id.longValue())) {
startActivityForResult(intent, 4);
} else {
startActivity(intent);
}
}
public void showGroupMembers() {
Integer num;
Intent intent = new Intent();
intent.setClass(this, GroupMembersActivity.class);
intent.putExtra("com.perm.kate.gid", this.group_id);
Group group = this.g;
if (group != null && (num = group.type) != null && num.intValue() == 2) {
intent.putExtra("com.perm.kate.is_event", true);
}
startActivity(intent);
}
public void showGroupSettingsActivity() {
Integer num;
Intent intent = new Intent(this, EditGroupActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
Group group = this.g;
if (group != null && (num = group.type) != null) {
intent.putExtra("com.perm.kate.group_type", num.intValue());
}
startActivityForResult(intent, 2);
}
public void showGroupTokenDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.group_messages);
View inflate = LayoutInflater.from(this).inflate(R.layout.group_messages_token, (ViewGroup) null);
final EditText editText = (EditText) inflate.findViewById(R.id.token);
builder.setView(inflate);
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
String obj = editText.getText().toString();
if (obj.length() < 50) {
return;
}
KApplication.addGroupToken(obj, GroupActivity.this.group_id.longValue());
GroupActivity.this.startDialogs();
}
});
builder.setNegativeButton(R.string.label_cancel, (DialogInterface.OnClickListener) null);
AlertDialog create = builder.create();
create.setCanceledOnTouchOutside(true);
create.show();
}
public void showJoinDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.join_group_confirm).setTitle(R.string.label_join_group).setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
GroupActivity.this.joinGroup();
}
}).setNegativeButton(R.string.no, (DialogInterface.OnClickListener) null);
builder.create().show();
}
private void showLeaveDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.leave_group_confirm).setTitle(R.string.label_leave_group).setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
GroupActivity.this.leaveGroup();
}
}).setNegativeButton(R.string.no, (DialogInterface.OnClickListener) null);
builder.create().show();
}
public void showManagementActivity() {
Intent intent = new Intent();
intent.setClass(this, GroupManagementActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
if (this.contacts != null) {
ArrayList arrayList = new ArrayList();
Iterator it = this.contacts.iterator();
while (it.hasNext()) {
Contact contact = (Contact) it.next();
if (contact.user_id != null) {
arrayList.add(contact);
}
}
intent.putExtra("com.perm.kate.contacts", arrayList);
}
startActivity(intent);
}
private void showMembersActivity() {
Intent intent = new Intent();
intent.setClass(this, CheckMembersActivity.class);
intent.putExtra("com.perm.kate.friends_invite", true);
startActivityForResult(intent, 1);
}
public void showPodcasts() {
Intent intent = new Intent();
intent.setClass(this, PodcastsActivity.class);
intent.putExtra("com.perm.kate.owner_id", this.group_id.longValue() * (-1));
startActivity(intent);
}
public void showRequestsToGroupActivity() {
Intent intent = new Intent(this, RequestsToGroupActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
startActivity(intent);
}
private void showStatsActivity() {
Intent intent = new Intent();
intent.setClass(this, StatsActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
startActivity(intent);
}
public void showStatusAcivity() {
Intent intent = new Intent();
intent.setClass(this, StatusActivity.class);
intent.putExtra("com.perm.kate.group_id", this.group_id);
startActivityForResult(intent, 3);
}
public void showStatusDialog() {
AlertDialog create = new AlertDialog.Builder(this).setMessage(this.g.status).setPositiveButton(R.string.close, (DialogInterface.OnClickListener) null).setNegativeButton(R.string.label_copy, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Helper.copyText(GroupActivity.this.g.status, GroupActivity.this);
}
}).create();
create.setCanceledOnTouchOutside(true);
create.show();
}
public void startDialogs() {
Intent intent = new Intent();
intent.setClass(this, DialogsActivity.class);
intent.putExtra("group_id", this.group_id);
startActivity(intent);
}
public void subscribe(int i) {
WallSubscriptions.getInstance().subscribe(-this.group_id.longValue(), i);
WallSubscriptions.ensureRegularRefreshEnabled();
displayToast(R.string.wall_notifications_enabled);
}
private void updateLabelStatus(String str) {
if (!Helper.isNotEmpty(str)) {
this.label_status.setVisibility(8);
return;
}
this.label_status.setVisibility(0);
if (this.status_audio != null) {
str = "📢 " + str;
}
this.label_status.setText(SmileHelper.getSmiledText(this, str));
}
@Override
protected boolean fillMenuItems(Menu menu) {
Boolean bool;
Integer num;
Long l;
menu.add(0, 3, 1001, R.string.refresh);
menu.add(0, 4, 1002, R.string.label_copy_video_link);
if (this.is_join_group) {
menu.add(0, 2, 1003, R.string.label_leave_group);
}
menu.add(0, 1000, 1005, R.string.label_open_profile_web);
if (this.is_join_group && ((this.g.type.intValue() == 0 || (this.g.type.intValue() == 2 && (l = this.g.start_date) != null && l.longValue() > System.currentTimeMillis() / 1000)) && (KApplication.db.isModerInGroup(this.user_id, this.group_id.longValue()) || !this.is_closed))) {
menu.add(0, 14, 1015, R.string.label_invite_friends);
}
if (KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue())) {
menu.add(0, 16, 1017, R.string.title_community_statistics);
}
if (KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue()) || KApplication.db.isModerInGroup(this.user_id, this.group_id.longValue())) {
menu.add(0, 10, 1111, R.string.label_my_groups);
}
Integer num2 = this.is_favorite;
if (num2 != null) {
if (num2.intValue() == 1) {
menu.add(0, 1024, 7023, R.string.label_remove_from_bookmarks);
} else {
menu.add(0, 1023, 7023, R.string.label_add_to_bookmarks);
}
}
if (WallSubscriptions.getInstance().subscribed(-this.group_id.longValue()) && UpdateService.regularRefreshEnabled()) {
menu.add(0, 1026, 7024, R.string.wall_notify_disable);
} else {
menu.add(0, 1025, 7024, R.string.wall_notify_enable);
}
Group group = this.g;
if (group != null && (bool = group.can_message) != null && bool.booleanValue() && (num = this.is_messages_blocked) != null) {
if (num.intValue() == 1) {
menu.add(0, 1027, 7030, R.string.allow_messages);
} else {
menu.add(0, 1028, 7030, R.string.deny_messages);
}
}
menu.add(0, 1029, 7040, R.string.add_shortcut_for_group);
menu.add(0, 1030, 8000, R.string.cover).setCheckable(true).setChecked(getCoverEnabled());
return true;
}
boolean getCoverEnabled() {
return PreferenceManager.getDefaultSharedPreferences(KApplication.current).getBoolean("group_cover_en", true);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
PhotoChooser.onActivityResult(this, i, i2, intent, this.photoChooserCallback);
if (i == 0 && i2 == -1) {
new AvatarUploader(this, (Uri) ((ArrayList) intent.getSerializableExtra("uris")).get(0), intent.getIntExtra("resize_option", 2), this.uploadCallback, intent.getIntExtra("rotate", 0)).upload(Long.valueOf(-this.group_id.longValue()));
} else if (i == 2 && i2 == -1) {
refreshInThread();
}
if (i == 1 && i2 == -1 && intent != null) {
ArrayList<String> stringArrayListExtra = intent.getStringArrayListExtra("com.perm.kate.user_ids");
ArrayList arrayList = new ArrayList();
if (stringArrayListExtra != null) {
Iterator<String> it = stringArrayListExtra.iterator();
while (it.hasNext()) {
arrayList.add(Long.valueOf(Long.parseLong(it.next())));
}
groupsInvite(arrayList);
}
}
if (i == 3 && i2 == -1 && intent != null) {
this.g.status = intent.getStringExtra("new_status");
updateLabelStatus(this.g.status);
if (Helper.isNotEmpty(this.g.status)) {
Helper.showPublishStatusDialog(this, this.group_id.longValue() * (-1), this.g.status, true);
}
}
if (i == 4 && i2 == -1) {
if (intent != null) {
ArrayList arrayList2 = (ArrayList) intent.getSerializableExtra("links");
if (arrayList2 != null) {
this.links = arrayList2;
this.tv_links_count.setText(String.valueOf(arrayList2.size()));
}
} else {
refreshInThread();
}
}
if (i == 5 && i2 == -1) {
KApplication.addGroupToken(intent.getStringExtra("access_token"), this.group_id.longValue());
startDialogs();
}
super.onActivityResult(i, i2, intent);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (KApplication.session == null) {
finish();
return;
}
setContentView(isOldUI() ? R.layout.group_old : R.layout.group);
setHeaderTitle(R.string.group);
setupMenuButton();
setupRefreshButton();
this.group_id = Long.valueOf(getIntent().getLongExtra("com.perm.kate.group_id", 0L));
this.user_id = Long.valueOf(Long.parseLong(KApplication.session.getMid()));
findViewById(R.id.topic).setOnClickListener(this.topicClickListener);
findViewById(R.id.goods).setOnClickListener(this.goodsClickListener);
findViewById(R.id.wall).setOnClickListener(this.wallClickListener);
findViewById(R.id.audio).setOnClickListener(this.audioClickListener);
findViewById(R.id.albums).setOnClickListener(this.albumsClickListener);
findViewById(R.id.all_photos).setOnClickListener(this.allPhotosClickListener);
findViewById(R.id.video).setOnClickListener(this.videoClickListener);
findViewById(R.id.join_group_text).setOnClickListener(this.joinClickListener);
findViewById(R.id.ll_members).setOnClickListener(this.membersClickListener);
findViewById(R.id.ll_contacts).setOnClickListener(this.contactsClickListener);
findViewById(R.id.ll_links).setOnClickListener(this.linksClickListener);
findViewById(R.id.podcasts).setOnClickListener(this.podcastsClickListener);
View findViewById = findViewById(R.id.docs);
this.docs = findViewById;
findViewById.setOnClickListener(this.docsClickListener);
this.docs_separator = findViewById(R.id.docs_separator);
findViewById(R.id.group_menu).setOnClickListener(this.groupMenuClickListener);
ImageView imageView = (ImageView) findViewById(R.id.photo);
this.photo = imageView;
imageView.setOnClickListener(this.photoClickListener);
this.tv_members_count = (TextView) findViewById(R.id.tv_members_count);
this.tv_contacts_count = (TextView) findViewById(R.id.tv_contacts_count);
this.tv_links_count = (TextView) findViewById(R.id.tv_links_count);
TextView textView = (TextView) findViewById(R.id.label_status);
this.label_status = textView;
textView.setOnClickListener(this.statusClickListener);
this.tv_videos_count = (TextView) findViewById(R.id.tv_videos_count);
this.tv_topics_count = (TextView) findViewById(R.id.tv_topics_count);
this.tv_photos_count = (TextView) findViewById(R.id.tv_photos_count);
this.tv_albums_count = (TextView) findViewById(R.id.tv_albums_count);
this.tv_audios_count = (TextView) findViewById(R.id.tv_audios_count);
this.tv_docs_count = (TextView) findViewById(R.id.tv_docs_count);
this.tv_wall_count = (TextView) findViewById(R.id.tv_wall_count);
this.tv_podcasts_count = (TextView) findViewById(R.id.tv_podcasts_count);
this.coverView = (ImageView) findViewById(R.id.cover);
View findViewById2 = findViewById(R.id.stories);
if (findViewById2 != null) {
findViewById2.setOnClickListener(this.storiesClickListener);
}
adjustCoverViewSize();
displayData();
refreshInThread();
setButtonsBg();
History.addGroup(this.g);
this.coverView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
GroupActivity.this.coverClick();
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
Integer num;
int itemId = menuItem.getItemId();
if (itemId == 2) {
showLeaveDialog();
return true;
} else if (itemId == 3) {
refreshInThread();
return true;
} else if (itemId == 4) {
copyGroupLink();
return true;
} else if (itemId == 10) {
showEditOptionsDialog();
return true;
} else if (itemId == 14) {
showMembersActivity();
return true;
} else if (itemId == 16) {
showStatsActivity();
return true;
} else if (itemId == 1000) {
Helper.openUrlInBrowser("http://vk.com/club" + this.group_id, this);
return true;
} else {
int i = 0;
switch (itemId) {
case 1023:
faveAddGroup();
return true;
case 1024:
faveRemoveGroup();
return true;
case 1025:
if (KApplication.db.isAdminOrEditorInGroup(this.user_id, this.group_id.longValue()) && (num = this.g.type) != null && num.intValue() == 1) {
choseSubscriptionType();
} else {
subscribe(0);
}
return true;
case 1026:
WallSubscriptions.getInstance().unsubscribe(-this.group_id.longValue());
WallSubscriptions.disableRegularRefreshIfRequired();
displayToast(R.string.wal_notifications_disabled);
return true;
case 1027:
allowMessages();
return true;
case 1028:
denyMessages();
return true;
case 1029:
ShortcutHelper.createGroupShortcutIcon(this, this.group_id.longValue());
break;
case 1030:
setCoverEnabled(!getCoverEnabled());
this.coverView.setVisibility((!getCoverEnabled() || TextUtils.isEmpty(getCoverUrl())) ? 8 : 8);
return true;
}
return super.onOptionsItemSelected(menuItem);
}
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
menu.clear();
fillMenuItems(menu);
return super.onPrepareOptionsMenu(menu);
}
@Override
protected void onRefreshButton() {
refreshInThread();
}
void setCoverEnabled(boolean z) {
PreferenceManager.getDefaultSharedPreferences(KApplication.current).edit().putBoolean("group_cover_en", z).apply();
}
protected void showMessageThread() {
Intent intent = new Intent();
intent.setClass(this, MessageThreadActivity.class);
intent.putExtra("com.perm.kate.message_uid", User.groupIdToVirtualUserId(this.group_id.longValue()));
startActivity(intent);
}
}