|
23 | 23 | import java.util.Comparator;
|
24 | 24 | import java.util.List;
|
25 | 25 |
|
26 |
| - |
27 | 26 | public class FileDialogSelectUtils {
|
28 | 27 | public interface FileSelectCallback {
|
29 | 28 | void onFileSelected(List<File> selectedFiles);
|
@@ -80,15 +79,15 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
|
80 | 79 | });
|
81 | 80 |
|
82 | 81 | AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
83 |
| - builder.setTitle("目录: " + currentDir.getAbsolutePath()) |
| 82 | + builder.setTitle(context.getString(R.string.iot_directory_title,currentDir.getAbsolutePath())) |
84 | 83 | .setView(listView)
|
85 |
| - .setPositiveButton("确定", new DialogInterface.OnClickListener() { |
| 84 | + .setPositiveButton(context.getString(R.string.iot_ok), new DialogInterface.OnClickListener() { |
86 | 85 | @Override
|
87 | 86 | public void onClick(DialogInterface dialog, int which) {
|
88 | 87 | callback.onFileSelected(new ArrayList<>(selectedFiles));
|
89 | 88 | }
|
90 | 89 | })
|
91 |
| - .setNegativeButton("取消", null); |
| 90 | + .setNegativeButton(context.getString(R.string.iot_cancel), null); |
92 | 91 | dialog = builder.create();
|
93 | 92 | dialog.show();
|
94 | 93 |
|
@@ -131,7 +130,7 @@ public int compare(File f1, File f2) {
|
131 | 130 | }
|
132 | 131 |
|
133 | 132 | if (dialog != null) {
|
134 |
| - dialog.setTitle("目录: " + currentDir.getAbsolutePath()); |
| 133 | + dialog.setTitle(context.getString(R.string.iot_directory_title,currentDir.getAbsolutePath())); |
135 | 134 | }
|
136 | 135 | }
|
137 | 136 |
|
@@ -162,7 +161,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
|
162 | 161 |
|
163 | 162 | TextView nameView = new TextView(context);
|
164 | 163 | nameView.setTextSize(20);
|
165 |
| - nameView.setText(file.getName().equals("..") ? "↩ 返回上一级" : file.getName()); |
| 164 | + nameView.setText(file.getName().equals("..") ? context.getString(R.string.iot_back_directory) : file.getName()); |
166 | 165 | nameView.setLayoutParams(new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1));
|
167 | 166 | layout.addView(nameView);
|
168 | 167 |
|
|
0 commit comments