Fixed Alert EditText background on 2.x

This commit is contained in:
DrKLO 2014-07-13 14:50:31 +04:00
parent 1122ab85d1
commit 1a9632e042
3 changed files with 16 additions and 2 deletions

View File

@ -83,7 +83,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 19 targetSdkVersion 19
versionCode 278 versionCode 279
versionName "1.6.0" versionName "1.6.0"
} }
} }

View File

@ -946,8 +946,14 @@ public class FileLoader {
} }
} }
}; };
boolean isLocalFile = false;
if (httpUrl != null && !httpUrl.startsWith("http")) {
isLocalFile = true;
}
img.loadOperation = loadOperation; img.loadOperation = loadOperation;
if (runningOperation.size() < maxConcurentLoadingOpertaionsCount) { if (runningOperation.size() < maxConcurentLoadingOpertaionsCount || isLocalFile) {
loadOperation.start(); loadOperation.start();
runningOperation.add(loadOperation); runningOperation.add(loadOperation);
} else { } else {

View File

@ -24,6 +24,7 @@ import android.view.inputmethod.EditorInfo;
import android.widget.AbsListView; import android.widget.AbsListView;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView; import android.widget.TextView;
import org.telegram.android.AndroidUtilities; import org.telegram.android.AndroidUtilities;
@ -350,6 +351,9 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(LocaleController.formatStringSimple(selectAlertString, Utilities.formatName(user.first_name, user.last_name))); builder.setMessage(LocaleController.formatStringSimple(selectAlertString, Utilities.formatName(user.first_name, user.last_name)));
final EditText editText = new EditText(getParentActivity()); final EditText editText = new EditText(getParentActivity());
if (android.os.Build.VERSION.SDK_INT < 11) {
editText.setBackgroundResource(android.R.drawable.editbox_background_normal);
}
editText.setTextSize(18); editText.setTextSize(18);
editText.setText("50"); editText.setText("50");
editText.setGravity(Gravity.CENTER); editText.setGravity(Gravity.CENTER);
@ -366,9 +370,13 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
showAlertDialog(builder); showAlertDialog(builder);
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams)editText.getLayoutParams(); ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams)editText.getLayoutParams();
if (layoutParams != null) { if (layoutParams != null) {
if (layoutParams instanceof FrameLayout.LayoutParams) {
((FrameLayout.LayoutParams)layoutParams).gravity = Gravity.CENTER_HORIZONTAL;
}
layoutParams.rightMargin = layoutParams.leftMargin = AndroidUtilities.dp(10); layoutParams.rightMargin = layoutParams.leftMargin = AndroidUtilities.dp(10);
editText.setLayoutParams(layoutParams); editText.setLayoutParams(layoutParams);
} }
editText.setSelection(editText.getText().length());
} else { } else {
if (delegate != null) { if (delegate != null) {
delegate.didSelectContact(user, param); delegate.didSelectContact(user, param);