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 {
minSdkVersion 8
targetSdkVersion 19
versionCode 278
versionCode 279
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;
if (runningOperation.size() < maxConcurentLoadingOpertaionsCount) {
if (runningOperation.size() < maxConcurentLoadingOpertaionsCount || isLocalFile) {
loadOperation.start();
runningOperation.add(loadOperation);
} else {

View file

@ -24,6 +24,7 @@ import android.view.inputmethod.EditorInfo;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;
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.setMessage(LocaleController.formatStringSimple(selectAlertString, Utilities.formatName(user.first_name, user.last_name)));
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.setText("50");
editText.setGravity(Gravity.CENTER);
@ -366,9 +370,13 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
showAlertDialog(builder);
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams)editText.getLayoutParams();
if (layoutParams != null) {
if (layoutParams instanceof FrameLayout.LayoutParams) {
((FrameLayout.LayoutParams)layoutParams).gravity = Gravity.CENTER_HORIZONTAL;
}
layoutParams.rightMargin = layoutParams.leftMargin = AndroidUtilities.dp(10);
editText.setLayoutParams(layoutParams);
}
editText.setSelection(editText.getText().length());
} else {
if (delegate != null) {
delegate.didSelectContact(user, param);