mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-05-05 07:20:38 +00:00
Bug fixes
This commit is contained in:
parent
5faa453835
commit
7fcd94d5c9
7 changed files with 59 additions and 69 deletions
|
|
@ -39,6 +39,7 @@ import org.telegram.tgnet.TLRPC;
|
|||
import org.telegram.ui.LaunchActivity;
|
||||
import org.telegram.ui.PopupNotificationActivity;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -1826,12 +1827,15 @@ public class NotificationsController {
|
|||
mBuilder.setLargeIcon(img.getBitmap());
|
||||
} else {
|
||||
try {
|
||||
float scaleFactor = 160.0f / AndroidUtilities.dp(50);
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = scaleFactor < 1 ? 1 : (int) scaleFactor;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(FileLoader.getPathToAttach(photoPath, true).toString(), options);
|
||||
if (bitmap != null) {
|
||||
mBuilder.setLargeIcon(bitmap);
|
||||
File file = FileLoader.getPathToAttach(photoPath, true);
|
||||
if (file.exists()) {
|
||||
float scaleFactor = 160.0f / AndroidUtilities.dp(50);
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = scaleFactor < 1 ? 1 : (int) scaleFactor;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), options);
|
||||
if (bitmap != null) {
|
||||
mBuilder.setLargeIcon(bitmap);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
//ignore
|
||||
|
|
@ -2085,12 +2089,15 @@ public class NotificationsController {
|
|||
builder.setLargeIcon(img.getBitmap());
|
||||
} else {
|
||||
try {
|
||||
float scaleFactor = 160.0f / AndroidUtilities.dp(50);
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = scaleFactor < 1 ? 1 : (int) scaleFactor;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(FileLoader.getPathToAttach(photoPath, true).toString(), options);
|
||||
if (bitmap != null) {
|
||||
builder.setLargeIcon(bitmap);
|
||||
File file = FileLoader.getPathToAttach(photoPath, true);
|
||||
if (file.exists()) {
|
||||
float scaleFactor = 160.0f / AndroidUtilities.dp(50);
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inSampleSize = scaleFactor < 1 ? 1 : (int) scaleFactor;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), options);
|
||||
if (bitmap != null) {
|
||||
builder.setLargeIcon(bitmap);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
//ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue