Skip to content

Commit 091854a

Browse files
committed
Fixed problem with color in the list of mount points (#1018)
1 parent 00035cd commit 091854a

File tree

14 files changed

+40
-33
lines changed

14 files changed

+40
-33
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [2.2.2] - 2018-11-25
10+
### Changed
11+
- Have separate source/target inputs for mounts (issue #1019)
12+
- Replaced by dbus-run-session to dbus-launch
13+
14+
### Fixed
15+
- Problem with running "am" via unchroot (issue #987)
16+
- Problem with color in the list of mount points (issue #1018)
17+
918
## [2.2.1] - 2018-10-29
1019
### Changed
1120
- Updated built-in busybox to v1.29.3

app/build.gradle

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
applicationId 'ru.meefik.linuxdeploy'
99
minSdkVersion 15
1010
targetSdkVersion 27
11-
versionCode 243
12-
versionName "2.2.1"
11+
versionCode 244
12+
versionName "2.2.2"
1313
}
1414
buildTypes {
1515
release {
@@ -24,6 +24,7 @@ android {
2424
}
2525

2626
dependencies {
27+
implementation 'com.android.support:appcompat-v7:27.1.1'
2728
implementation 'com.android.support:design:27.1.1'
2829
implementation 'com.android.support:customtabs:27.1.1'
2930
}

app/src/main/java/ru/meefik/linuxdeploy/MountsActivity.java

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ru.meefik.linuxdeploy;
22

3-
import android.content.Context;
43
import android.content.DialogInterface;
54
import android.os.Bundle;
65
import android.support.v7.app.AlertDialog;
@@ -12,6 +11,7 @@
1211
import android.view.ViewGroup;
1312
import android.widget.AdapterView;
1413
import android.widget.ArrayAdapter;
14+
import android.widget.Button;
1515
import android.widget.EditText;
1616
import android.widget.ListView;
1717
import android.widget.TextView;
@@ -77,7 +77,7 @@ private void editDialog(final int position) {
7777

7878
inputTarget.setText(arr[1]);
7979
inputTarget.setSelection(arr[1].length());
80-
} catch (IndexOutOfBoundsException e) {}
80+
} catch (IndexOutOfBoundsException ignored) {}
8181

8282
new AlertDialog.Builder(this)
8383
.setTitle(R.string.edit_mount_title)
@@ -147,27 +147,25 @@ protected void onCreate(Bundle savedInstanceState) {
147147
setContentView(R.layout.activity_mounts);
148148

149149
// ListView Adapter
150-
ListView listView = (ListView) findViewById(R.id.mountsView);
151-
adapter = new ArrayAdapter<String>(this, R.layout.mounts_row, listItems) {
150+
ListView listView = findViewById(R.id.mountsView);
151+
adapter = new ArrayAdapter<String>(this, R.layout.mounts_row, R.id.mount_point, listItems) {
152152
@Override
153-
public View getView(final int position, View view, final ViewGroup parent) {
154-
if (view == null) {
155-
LayoutInflater inflater = (LayoutInflater) getApplicationContext().
156-
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
157-
view = inflater.inflate(R.layout.mounts_row, null);
158-
}
159-
String item = getItem(position);
153+
public View getView(final int position, View convertView, final ViewGroup parent) {
154+
View view = super.getView(position, convertView, parent);
155+
TextView tv = view.findViewById(R.id.mount_point);
156+
Button btn = view.findViewById(R.id.delete_mount);
160157

161-
((TextView) view.findViewById(R.id.mount_point)).setText(item);
158+
String item = getItem(position);
159+
tv.setText(item);
162160

163-
view.findViewById(R.id.mount_point).setOnClickListener(new View.OnClickListener() {
161+
tv.setOnClickListener(new View.OnClickListener() {
164162
@Override
165163
public void onClick(View v) {
166164
((ListView) parent).performItemClick(v, position, 0); // Let the event be handled in onItemClick()
167165
}
168166
});
169167

170-
view.findViewById(R.id.delete_mount).setOnClickListener(new View.OnClickListener() {
168+
btn.setOnClickListener(new View.OnClickListener() {
171169
@Override
172170
public void onClick(View v) {
173171
((ListView) parent).performItemClick(v, position, 0); // Let the event be handled in onItemClick()

app/src/main/java/ru/meefik/linuxdeploy/ProfilesActivity.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package ru.meefik.linuxdeploy;
22

3+
import android.annotation.SuppressLint;
34
import android.content.Context;
45
import android.content.DialogInterface;
56
import android.os.Bundle;
@@ -91,6 +92,7 @@ public static List<String> getProfiles(Context c) {
9192
return profiles;
9293
}
9394

95+
@SuppressLint("RestrictedApi")
9496
private void addDialog() {
9597
final EditText input = new EditText(this);
9698
new AlertDialog.Builder(this)
@@ -116,6 +118,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
116118
}).show();
117119
}
118120

121+
@SuppressLint("RestrictedApi")
119122
private void editDialog() {
120123
final EditText input = new EditText(this);
121124
final int pos = listView.getCheckedItemPosition();
@@ -183,14 +186,15 @@ public void onClick(DialogInterface dialog, int whichButton) {
183186
}
184187
}
185188

189+
@SuppressLint("ClickableViewAccessibility")
186190
@Override
187191
public void onCreate(Bundle savedInstanceState) {
188192
super.onCreate(savedInstanceState);
189193
PrefStore.setLocale(this);
190194
setContentView(R.layout.activity_profiles);
191195

192196
// ListView Adapter
193-
listView = (ListView) findViewById(R.id.profilesView);
197+
listView = findViewById(R.id.profilesView);
194198
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_single_choice, listItems);
195199
listView.setAdapter(adapter);
196200

@@ -257,6 +261,7 @@ public void onResume() {
257261
listView.setItemChecked(getPosition(profile), true);
258262
}
259263

264+
@SuppressLint("ClickableViewAccessibility")
260265
@Override
261266
public boolean onTouch(View v, MotionEvent event) {
262267
gd.onTouchEvent(event);

app/src/main/java/ru/meefik/linuxdeploy/RepositoryActivity.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,15 @@ protected void onCreate(Bundle savedInstanceState) {
256256
setContentView(R.layout.activity_repository);
257257

258258
// ListView Adapter
259-
ListView listView = (ListView) findViewById(R.id.repositoryView);
259+
ListView listView = findViewById(R.id.repositoryView);
260260
adapter = new ArrayAdapter<Map<String, String>>(this,
261261
R.layout.repository_row, R.id.repo_entry_title, profiles) {
262262
@Override
263263
public View getView(int position, View convertView, ViewGroup parent) {
264264
View view = super.getView(position, convertView, parent);
265-
TextView title = (TextView) view.findViewById(R.id.repo_entry_title);
266-
TextView subTitle = (TextView) view.findViewById(R.id.repo_entry_subtitle);
267-
ImageView icon = (ImageView) view.findViewById(R.id.repo_entry_icon);
265+
TextView title = view.findViewById(R.id.repo_entry_title);
266+
TextView subTitle = view.findViewById(R.id.repo_entry_subtitle);
267+
ImageView icon = view.findViewById(R.id.repo_entry_icon);
268268
String name = profiles.get(position).get("PROFILE");
269269
String desc = profiles.get(position).get("DESC");
270270
String type = profiles.get(position).get("TYPE");

app/src/main/res/layout/mounts_row.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
android:layout_width="0dp"
1515
android:layout_height="wrap_content"
1616
android:layout_weight="1"
17-
android:paddingRight="4dp"
1817
android:paddingLeft="4dp"
19-
android:textAppearance="@android:style/TextAppearance.Medium" />
18+
android:paddingRight="4dp"
19+
android:textSize="18sp" />
2020

2121
<Button
2222
android:id="@+id/delete_mount"

app/src/main/res/values-in/strings.xml

-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
<string name="toast_import_profile_error">"Kesalahan mengimpor profil!"</string>
4646
<string name="toast_export_profile_success">"Profil telah berhasil diekspor."</string>
4747
<string name="toast_export_profile_error">"Kesalahan mengekspor profil!"</string>
48-
<string name="toast_terminal_error">"Kesalahan saat memulai terminal!"</string>
4948
<string name="toast_loading_error">"Terjadi kesalahan saat memuat data!"</string>
5049
<string name="toast_updating_env_error">"Kesalahan memperbarui lingkungan pengoperasian!"</string>
5150
<string name="confirm_profile_discard_title">"Hapus profil"</string>
@@ -88,8 +87,6 @@
8887
<string name="dialog_title_autostart_delay_preference">"Tunda (detik)"</string>
8988
<string name="title_nettrack_preference">"Pemicu jaringan"</string>
9089
<string name="summary_nettrack_preference">"Melacak perubahan jaringan dan memperbarui container"</string>
91-
<string name="title_terminalcmd_preference">"Perintah terminal"</string>
92-
<string name="dialog_title_terminalcmd_preference">"Perintah terminal"</string>
9390

9491
<string name="env_preferences">"Environment"</string>
9592

app/src/main/res/values-ko/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
<string name="toast_import_profile_error">프로파일을 불러오는 데 오류가 발생했습니다!</string>
4343
<string name="toast_export_profile_success">프로파일 내보내기 성공.</string>
4444
<string name="toast_export_profile_error">프로파일을 내보내기 하는데 오류가 발생했습니다!</string>
45-
<string name="toast_terminal_error">터미널로 시작하는 데 오류가 발생했습니다.</string>
4645
<string name="toast_loading_error">데이터 불러오기 오류</string>
4746
<string name="confirm_profile_discard_title">프로파일 삭제</string>
4847
<string name="confirm_profile_discard_message">선택된 프로파일을 삭제하시겠습니까?</string>

app/src/main/res/values-pl/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<string name="toast_import_profile_error">Błąd przy importowaniu profilu!</string>
3333
<string name="toast_export_profile_success">Profil został pomyślnie eksportowany.</string>
3434
<string name="toast_export_profile_error">Błąd przy eksportowaniu profilu!</string>
35-
<string name="toast_terminal_error">Błąd podczas uruchamiania terminala!</string>
3635
<string name="confirm_profile_discard_title">Usuń profil</string>
3736
<string name="confirm_profile_discard_message">Usunąć wybrany profil?</string>
3837
<string name="new_mount_title">Punkt montowania</string>

app/src/main/res/values-pt/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<string name="toast_import_profile_error">Erro ao importar perfil!</string>
3333
<string name="toast_export_profile_success">Perfil exportado com sucesso.</string>
3434
<string name="toast_export_profile_error">Erro ao exportar perfil!</string>
35-
<string name="toast_terminal_error">Error when starting the terminal!</string>
3635
<string name="confirm_profile_discard_title">Remover perfil</string>
3736
<string name="confirm_profile_discard_message">Remover o perfil selecionado?</string>
3837
<string name="new_mount_title">Ponto de montagem</string>
@@ -173,5 +172,6 @@
173172
<string name="title_configure_dialog">Configurar</string>
174173
<string name="gui_preferences">GUI</string>
175174
<string name="repository_purchase_button">Comprar</string>
175+
<string name="nav_profiles">Perfis</string>
176176

177177
</resources>

app/src/main/res/values-ru/strings.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
<string name="title_x11_display_preference">Номер дисплея</string>
9898
<string name="title_x11_host_preference">Адрес X-сервера</string>
9999
<string name="title_x11_sdl_preference">XServer XSDL</string>
100-
<string name="toast_terminal_error">Ошибка при запуске терминала!</string>
101100
<string name="x11_preferences">X11</string>
102101
<string name="title_vnc_args_preference">Опции VNC-сервера</string>
103102
<string name="title_vnc_depth_preference">Глубина цвета (бит)</string>
@@ -244,5 +243,7 @@
244243
<string name="dialog_title_pulse_port_preference">PulseAudio: порт</string>
245244
<string name="title_pulse_host_preference">Адрес сервера</string>
246245
<string name="dialog_title_pulse_host_preference">PulseAudio: адрес сервера</string>
246+
<string name="hint_mounts_source">Исходная</string>
247+
<string name="hint_mounts_target">Целевая (опционально)</string>
247248

248249
</resources>

app/src/main/res/values-zh/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
<string name="toast_import_profile_error">导入配置文件出错!</string>
4646
<string name="toast_export_profile_success">配置文件已成功导出。</string>
4747
<string name="toast_export_profile_error">导出配置文件出错!</string>
48-
<string name="toast_terminal_error">启动终端时出错!</string>
4948
<string name="toast_loading_error">加载数据时出错!</string>
5049
<string name="toast_updating_env_error">操作环境更新错误!</string>
5150
<string name="confirm_profile_discard_title">删除配置文件</string>

app/src/main/res/values/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<string name="toast_import_profile_error">Error importing profile!</string>
4848
<string name="toast_export_profile_success">Profile has been successfully exported.</string>
4949
<string name="toast_export_profile_error">Error exporting profile!</string>
50-
<string name="toast_terminal_error">Error when starting the terminal!</string>
5150
<string name="toast_loading_error">Error loading data!</string>
5251
<string name="toast_updating_env_error">Error updating of operating environment!</string>
5352
<string name="confirm_profile_discard_title">Remove profile</string>

0 commit comments

Comments
 (0)