mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 06:25:14 +01:00
Fixed incorrect messages drawing
This commit is contained in:
parent
3316f25e35
commit
6e63dee546
6 changed files with 15 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.telegram.messenger"
|
package="org.telegram.messenger"
|
||||||
android:versionCode="177"
|
android:versionCode="179"
|
||||||
android:versionName="1.3.26">
|
android:versionName="1.3.26">
|
||||||
|
|
||||||
<supports-screens android:anyDensity="true"
|
<supports-screens android:anyDensity="true"
|
||||||
|
|
|
@ -369,7 +369,7 @@ public class ContactsController {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
boolean disableDeletion = false;
|
boolean disableDeletion = true; //disable contacts deletion, because phone numbers can't be compared due to different numbers format
|
||||||
if (schedule) {
|
if (schedule) {
|
||||||
try {
|
try {
|
||||||
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
|
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
|
||||||
|
@ -385,7 +385,6 @@ public class ContactsController {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
disableDeletion = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class MessagesStorage {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
database = new SQLiteDatabase(cacheFile.getPath());
|
database = new SQLiteDatabase(cacheFile.getPath());
|
||||||
database.execute("PRAGMA secure_delete = ON");
|
database.executeFast("PRAGMA secure_delete = ON").stepThis().dispose();
|
||||||
if (createTable) {
|
if (createTable) {
|
||||||
database.executeFast("CREATE TABLE users(uid INTEGER PRIMARY KEY, name TEXT, status INTEGER, data BLOB)").stepThis().dispose();
|
database.executeFast("CREATE TABLE users(uid INTEGER PRIMARY KEY, name TEXT, status INTEGER, data BLOB)").stepThis().dispose();
|
||||||
database.executeFast("CREATE TABLE messages(mid INTEGER PRIMARY KEY, uid INTEGER, read_state INTEGER, send_state INTEGER, date INTEGER, data BLOB, out INTEGER, ttl INTEGER)").stepThis().dispose();
|
database.executeFast("CREATE TABLE messages(mid INTEGER PRIMARY KEY, uid INTEGER, read_state INTEGER, send_state INTEGER, date INTEGER, data BLOB, out INTEGER, ttl INTEGER)").stepThis().dispose();
|
||||||
|
|
|
@ -187,11 +187,11 @@ public class ChatMessageCell extends ChatBaseCell {
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw(Canvas canvas) {
|
protected void onDraw(Canvas canvas) {
|
||||||
super.onDraw(canvas);
|
super.onDraw(canvas);
|
||||||
if (currentMessageObject == null || currentMessageObject.textLayoutBlocks == null || currentMessageObject.textLayoutBlocks.isEmpty()) {
|
if (currentMessageObject == null || currentMessageObject.textLayoutBlocks == null || currentMessageObject.textLayoutBlocks.isEmpty() || firstVisibleBlockNum < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int a = Math.max(0, (visibleY - textY) / currentMessageObject.blockHeight); a < currentMessageObject.textLayoutBlocks.size(); a++) {
|
for (int a = firstVisibleBlockNum; a <= lastVisibleBlockNum; a++) {
|
||||||
MessageObject.TextLayoutBlock block = currentMessageObject.textLayoutBlocks.get(a);
|
MessageObject.TextLayoutBlock block = currentMessageObject.textLayoutBlocks.get(a);
|
||||||
float y = textY + block.textYOffset;
|
float y = textY + block.textYOffset;
|
||||||
if (intersect(y, y + currentMessageObject.blockHeight, visibleY, visibleY + visibleHeight)) {
|
if (intersect(y, y + currentMessageObject.blockHeight, visibleY, visibleY + visibleHeight)) {
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:id="@+id/intro_view_pager"/>
|
android:id="@+id/intro_view_pager"/>
|
||||||
|
|
||||||
<TextView android:layout_width="192dp"
|
<TextView android:layout_width="wrap_content"
|
||||||
android:layout_height="44dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="336dp"
|
android:layout_marginTop="336dp"
|
||||||
android:background="@drawable/regbtn_states"
|
android:background="@drawable/regbtn_states"
|
||||||
android:text="@string/StartMessaging"
|
android:text="@string/StartMessaging"
|
||||||
|
@ -44,8 +44,13 @@
|
||||||
android:textSize="18dp"
|
android:textSize="18dp"
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:id="@+id/start_messaging_button"
|
android:paddingLeft="20dp"
|
||||||
android:paddingBottom="2dp"/>
|
android:paddingRight="20dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:id="@+id/start_messaging_button"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
<string name="YouLeft">Du hast die Gruppe verlassen</string>
|
<string name="YouLeft">Du hast die Gruppe verlassen</string>
|
||||||
<string name="DeleteThisGroup">Diese Gruppe löschen</string>
|
<string name="DeleteThisGroup">Diese Gruppe löschen</string>
|
||||||
<string name="SlideToCancel">WISCHEN UM ABZUBRECHEN</string>
|
<string name="SlideToCancel">WISCHEN UM ABZUBRECHEN</string>
|
||||||
|
|
||||||
<!--notification-->
|
<!--notification-->
|
||||||
<string name="EncryptedChatRequested">Geheimen Chat angefordert</string>
|
<string name="EncryptedChatRequested">Geheimen Chat angefordert</string>
|
||||||
<string name="EncryptedChatAccepted">Geheimen Chat angenommen</string>
|
<string name="EncryptedChatAccepted">Geheimen Chat angenommen</string>
|
||||||
|
|
Loading…
Reference in a new issue