Fixed incorrect messages drawing

This commit is contained in:
DrKLO 2014-03-04 10:23:08 +04:00
parent 3316f25e35
commit 6e63dee546
6 changed files with 15 additions and 11 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.telegram.messenger"
android:versionCode="177"
android:versionCode="179"
android:versionName="1.3.26">
<supports-screens android:anyDensity="true"

View file

@ -369,7 +369,7 @@ public class ContactsController {
@Override
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) {
try {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
@ -385,7 +385,6 @@ public class ContactsController {
}
} catch (Exception e) {
FileLog.e("tmessages", e);
disableDeletion = true;
}
}

View file

@ -69,7 +69,7 @@ public class MessagesStorage {
}
try {
database = new SQLiteDatabase(cacheFile.getPath());
database.execute("PRAGMA secure_delete = ON");
database.executeFast("PRAGMA secure_delete = ON").stepThis().dispose();
if (createTable) {
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();

View file

@ -187,11 +187,11 @@ public class ChatMessageCell extends ChatBaseCell {
@Override
protected void onDraw(Canvas 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;
}
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);
float y = textY + block.textYOffset;
if (intersect(y, y + currentMessageObject.blockHeight, visibleY, visibleY + visibleHeight)) {

View file

@ -35,8 +35,8 @@
android:layout_height="fill_parent"
android:id="@+id/intro_view_pager"/>
<TextView android:layout_width="192dp"
android:layout_height="44dp"
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="336dp"
android:background="@drawable/regbtn_states"
android:text="@string/StartMessaging"
@ -44,8 +44,13 @@
android:textSize="18dp"
android:textColor="#ffffff"
android:gravity="center"
android:id="@+id/start_messaging_button"
android:paddingBottom="2dp"/>
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:id="@+id/start_messaging_button"/>
<LinearLayout
android:layout_width="wrap_content"