mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
There were 2 issues combined into one: (#3643)
1. The languages were shown with the characters of the given language (i.e. Mandarin was displayed with Chinese characters). 2. The languages were not sorted How I fixed them: 1. I changed the list that was called from AppLanguageLookUpTable from localized to cannonical. 2. I imported List and Collections and I sorted said list in lexicographical order.
This commit is contained in:
parent
1fea1bbf49
commit
95372f33b5
1 changed files with 7 additions and 2 deletions
|
|
@ -16,6 +16,10 @@ import android.widget.LinearLayout;
|
|||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.wikipedia.util.StringUtil;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
|
@ -136,14 +140,15 @@ public class AboutActivity extends NavigationBaseActivity {
|
|||
|
||||
@OnClick(R.id.about_translate)
|
||||
public void launchTranslate(View view) {
|
||||
@NonNull List<String> sortedLocalizedNamesRef = CommonsApplication.getInstance().getLanguageLookUpTable().getCanonicalNames();
|
||||
Collections.sort(sortedLocalizedNamesRef);
|
||||
final ArrayAdapter<String> languageAdapter = new ArrayAdapter<>(AboutActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, CommonsApplication.getInstance().getLanguageLookUpTable().getLocalizedNames());
|
||||
android.R.layout.simple_spinner_dropdown_item, sortedLocalizedNamesRef);
|
||||
final Spinner spinner = new Spinner(AboutActivity.this);
|
||||
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
spinner.setAdapter(languageAdapter);
|
||||
spinner.setGravity(17);
|
||||
spinner.setPadding(50,0,0,0);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(AboutActivity.this);
|
||||
builder.setView(spinner);
|
||||
builder.setTitle(R.string.about_translate_title)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue