Merge pull request #678 from mfietz/feature/setting_number_parallel_downloads

Inverse background of EditTextPreference for older android versions
This commit is contained in:
Tom Hennen 2015-03-17 17:19:25 -04:00
commit ab2c75d4b1
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,33 @@
package de.danoeh.antennapod.preferences;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Build;
import android.preference.EditTextPreference;
import android.util.AttributeSet;
import de.danoeh.antennapod.R;
public class CustomEditTextPreference extends EditTextPreference {
public CustomEditTextPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public CustomEditTextPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomEditTextPreference(Context context) {
super(context);
}
@Override
protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
builder.setInverseBackgroundForced(true);
getEditText().setTextColor(getContext().getResources().getColor(R.color.black));
}
}
}

View File

@ -88,14 +88,13 @@
android:key="prefAutoUpdateIntervall" android:key="prefAutoUpdateIntervall"
android:summary="@string/pref_autoUpdateIntervall_sum" android:summary="@string/pref_autoUpdateIntervall_sum"
android:title="@string/pref_autoUpdateIntervall_title"/> android:title="@string/pref_autoUpdateIntervall_title"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:enabled="true" android:enabled="true"
android:key="prefMobileUpdate" android:key="prefMobileUpdate"
android:summary="@string/pref_mobileUpdate_sum" android:summary="@string/pref_mobileUpdate_sum"
android:title="@string/pref_mobileUpdate_title"/> android:title="@string/pref_mobileUpdate_title"/>
<EditTextPreference <de.danoeh.antennapod.preferences.CustomEditTextPreference
android:defaultValue="6" android:defaultValue="6"
android:inputType="number" android:inputType="number"
android:key="prefParallelDownloads" android:key="prefParallelDownloads"