Remove non-functional end icon of country selector
This commit is contained in:
parent
4513711981
commit
ac4409bcf4
@ -1,6 +1,5 @@
|
|||||||
package de.danoeh.antennapod.fragment;
|
package de.danoeh.antennapod.fragment;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
@ -21,11 +20,11 @@ import androidx.appcompat.widget.Toolbar;
|
|||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.google.android.material.appbar.MaterialToolbar;
|
import com.google.android.material.appbar.MaterialToolbar;
|
||||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import com.google.android.material.textfield.MaterialAutoCompleteTextView;
|
import com.google.android.material.textfield.MaterialAutoCompleteTextView;
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import de.danoeh.antennapod.core.BuildConfig;
|
import de.danoeh.antennapod.core.BuildConfig;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -222,7 +221,7 @@ public class DiscoveryFragment extends Fragment implements Toolbar.OnMenuItemCli
|
|||||||
|
|
||||||
LayoutInflater inflater = getLayoutInflater();
|
LayoutInflater inflater = getLayoutInflater();
|
||||||
View selectCountryDialogView = inflater.inflate(R.layout.select_country_dialog, null);
|
View selectCountryDialogView = inflater.inflate(R.layout.select_country_dialog, null);
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
|
||||||
builder.setView(selectCountryDialogView);
|
builder.setView(selectCountryDialogView);
|
||||||
|
|
||||||
List<String> countryCodeArray = new ArrayList<>(Arrays.asList(Locale.getISOCountries()));
|
List<String> countryCodeArray = new ArrayList<>(Arrays.asList(Locale.getISOCountries()));
|
||||||
@ -245,11 +244,16 @@ public class DiscoveryFragment extends Fragment implements Toolbar.OnMenuItemCli
|
|||||||
editText.setAdapter(dataAdapter);
|
editText.setAdapter(dataAdapter);
|
||||||
editText.setText(countryCodeNames.get(countryCode));
|
editText.setText(countryCodeNames.get(countryCode));
|
||||||
editText.setOnClickListener(view -> {
|
editText.setOnClickListener(view -> {
|
||||||
if (StringUtils.isEmpty(editText.getText().toString())) {
|
if (editText.getText().length() != 0) {
|
||||||
return;
|
editText.setText("");
|
||||||
|
editText.postDelayed(editText::showDropDown, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
editText.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
editText.setText("");
|
||||||
|
editText.postDelayed(editText::showDropDown, 100);
|
||||||
}
|
}
|
||||||
editText.getText().clear();
|
|
||||||
editText.postDelayed(editText::showDropDown, 100);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> {
|
builder.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> {
|
||||||
@ -267,6 +271,7 @@ public class DiscoveryFragment extends Fragment implements Toolbar.OnMenuItemCli
|
|||||||
EventBus.getDefault().post(new DiscoveryDefaultUpdateEvent());
|
EventBus.getDefault().post(new DiscoveryDefaultUpdateEvent());
|
||||||
loadToplist(countryCode);
|
loadToplist(countryCode);
|
||||||
});
|
});
|
||||||
|
builder.setNegativeButton(R.string.cancel_label, null);
|
||||||
builder.show();
|
builder.show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@ -11,6 +12,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="20dp"
|
android:layout_margin="20dp"
|
||||||
android:hint="@string/country"
|
android:hint="@string/country"
|
||||||
|
app:endIconMode="none"
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
|
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<AutoCompleteTextView
|
||||||
|
Loading…
x
Reference in New Issue
Block a user