Skip to content

Commit

Permalink
Cherrygram ver. 8.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arsLan4k1390 committed Jul 1, 2024
1 parent b80c13a commit d907f83
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 54 deletions.
65 changes: 14 additions & 51 deletions TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.TextUtils;
Expand Down Expand Up @@ -8671,64 +8670,28 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final ChatActivity[] chatActivity = new ChatActivity[1];
previewMenu[0] = new ActionBarPopupWindow.ActionBarPopupWindowLayout(getParentActivity(), R.drawable.popup_fixed_alert2, getResourceProvider(), flags);

final ProfileActivity[] profileActivity = new ProfileActivity[1];
previewMenu1[0] = new ActionBarPopupWindow.ActionBarPopupWindowLayout(getParentActivity(), R.drawable.popup_fixed_alert2, getResourceProvider(), flags);

if (!UserObject.isUserSelf(getMessagesController().getUser(dialogId))) {
ActionBarMenuSubItem openProfileItem = new ActionBarMenuSubItem(getParentActivity(), false, false);
openProfileItem.setTextAndIcon(LocaleController.getString("OpenProfile", R.string.OpenProfile), R.drawable.msg_openprofile);
openProfileItem.setOnClickListener(v -> new CountDownTimer(700, 100) {
@Override
public void onTick(long millisUntilFinished) {
finishPreviewFragment();
}

@Override
public void onFinish() {
Bundle args1 = new Bundle();
args1.putBoolean("expandPhoto", false);
if (DialogObject.isChatDialog(dialogId)) {
args1.putLong("chat_id", -dialogId);
} else {
args1.putLong("user_id", dialogId);
}

if (getMessagesController().checkCanOpenChat(args1, DialogsActivity.this)) {
if (searchString != null) {
getNotificationCenter().postNotificationName(NotificationCenter.closeChats);
}
prepareBlurBitmap();
parentLayout.setHighlightActionButtons(true);
presentFragmentAsPreviewWithMenu(profileActivity[0] = new ProfileActivity(args1), previewMenu1[0]);
}
}
}.start());
previewMenu[0].addView(openProfileItem);
openProfileItem.setOnClickListener(v -> {
finishPreviewFragment();

ActionBarMenuSubItem openChat = new ActionBarMenuSubItem(getParentActivity(), false, false);
openChat.setTextAndIcon(LocaleController.getString("AccDescrOpenChat", R.string.AccDescrOpenChat), R.drawable.msg_discussion);
openChat.setMinimumWidth(160);
openChat.setOnClickListener(e -> new CountDownTimer(700, 100) {
@Override
public void onTick(long millisUntilFinished) {
finishPreviewFragment();
Bundle args1 = new Bundle();
args1.putBoolean("expandPhoto", false);
if (DialogObject.isChatDialog(dialogId)) {
args1.putLong("chat_id", -dialogId);
} else {
args1.putLong("user_id", dialogId);
}

@Override
public void onFinish() {
Bundle args2 = new Bundle();
if (DialogObject.isChatDialog(dialogId)) {
args2.putLong("chat_id", -dialogId);
} else {
args2.putLong("user_id", dialogId);
}

if (getMessagesController().checkCanOpenChat(args2, DialogsActivity.this)) {
presentFragment(new ChatActivity(args2));
if (getMessagesController().checkCanOpenChat(args1, DialogsActivity.this)) {
if (searchString != null) {
getNotificationCenter().postNotificationName(NotificationCenter.closeChats);
}
presentFragment(new ProfileActivity(args1));
}
}.start());
previewMenu1[0].addView(openChat);
});
previewMenu[0].addView(openProfileItem);
}

if (hasFolders) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static String getReportMessage() {
"Details:\n"+
"• Cherrygram Version: " + Constants.INSTANCE.getCG_VERSION() + " (" + CherrygramExtras.INSTANCE.getAbiCode() + ")\n" +
"• Telegram Version: " + BuildVars.BUILD_VERSION_STRING + "\n" +
"• Build Type: " + Constants.INSTANCE.getBuildType() + "\n" +
"• Device: " + AndroidUtilities.capitalize(Build.MANUFACTURER) + " " + Build.MODEL + "\n" +
"• OS Version: " + Build.VERSION.RELEASE + "\n" +
"• Camera: " + CGFeatureHooks.getCameraName() + "\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ object Constants {
return LocaleController.getString("CG_AppName", R.string.CG_AppName)
}

fun getBuildType(): String {
if (CherrygramConfig.isStableBuild()) {
return LocaleController.getString("UP_BTRelease", R.string.UP_BTRelease)
} else if (CherrygramConfig.isPlayStoreBuild()) {
return "Play Store"
} else if (CherrygramConfig.isBetaBuild()) {
return LocaleController.getString("UP_BTBeta", R.string.UP_BTBeta)
} else if (CherrygramConfig.isPremiumBuild()) {
return "Premium"
} else if (CherrygramConfig.isDevBuild()) {
return "Dev"
}
return "Unknown"
}

const val Cherrygram_Owner = 282287840L // Cherrygram Owner (Arslan)
const val Cherrygram_Channel = 1776033848L // Cherrygram Channel
const val Cherrygram_Support = 1554776538L // Cherrygram Support Group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ protected void onDraw(Canvas canvas) {
});
linearLayout.addView(scheduleButton, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 48, 0, 16, 1, 16, 0));
} else {
final String btype = CherrygramConfig.INSTANCE.isBetaBuild() ? LocaleController.getString("UP_BTBeta", R.string.UP_BTBeta) + " | " + CherrygramExtras.INSTANCE.getAbiCode() : LocaleController.getString("UP_BTRelease", R.string.UP_BTRelease) + " | " + CherrygramExtras.INSTANCE.getAbiCode();
final String bType = Constants.INSTANCE.getBuildType() + " | " + CherrygramExtras.INSTANCE.getAbiCode();
TextCell buildType = new TextCell(context);
buildType.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_listSelector), 100, 0));
buildType.setTextAndValueAndIcon(LocaleController.getString("UP_BuildType", R.string.UP_BuildType), btype, R.drawable.msg_customize, true);
buildType.setTextAndValueAndIcon(LocaleController.getString("UP_BuildType", R.string.UP_BuildType), bType, R.drawable.msg_customize, true);
buildType.setOnClickListener(v -> copyText(buildType.getTextView().getText() + ": " + buildType.getValueTextView().getText()));
linearLayout.addView(buildType);

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+UseParallelGC
APP_VERSION_CODE=4911
APP_VERSION_NAME=10.14.2
APP_PACKAGE=uz.unnarsx.cherrygram
APP_VERSION_NAME_CHERRY=8.2.1
APP_VERSION_NAME_CHERRY=8.3.0
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=false
Expand Down

0 comments on commit d907f83

Please sign in to comment.