Skip to content

Commit

Permalink
Fixed problem with color in the list of mount points (#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
meefik committed Nov 25, 2018
1 parent 00035cd commit abd0ed8
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 33 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.2.2] - 2018-11-25
### Changed
- Have separate source/target inputs for mounts (#1019)
- Replaced by dbus-run-session to dbus-launch

### Fixed
- Problem with running "am" via unchroot (#987)
- Problem with color in the list of mount points (#1018)

## [2.2.1] - 2018-10-29
### Changed
- Updated built-in busybox to v1.29.3
Expand Down
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId 'ru.meefik.linuxdeploy'
minSdkVersion 15
targetSdkVersion 27
versionCode 243
versionName "2.2.1"
versionCode 244
versionName "2.2.2"
}
buildTypes {
release {
Expand All @@ -24,6 +24,7 @@ android {
}

dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
}
2 changes: 1 addition & 1 deletion app/src/main/assets/env
26 changes: 12 additions & 14 deletions app/src/main/java/ru/meefik/linuxdeploy/MountsActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ru.meefik.linuxdeploy;

import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
Expand All @@ -12,6 +11,7 @@
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
Expand Down Expand Up @@ -77,7 +77,7 @@ private void editDialog(final int position) {

inputTarget.setText(arr[1]);
inputTarget.setSelection(arr[1].length());
} catch (IndexOutOfBoundsException e) {}
} catch (IndexOutOfBoundsException ignored) {}

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

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

((TextView) view.findViewById(R.id.mount_point)).setText(item);
String item = getItem(position);
tv.setText(item);

view.findViewById(R.id.mount_point).setOnClickListener(new View.OnClickListener() {
tv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((ListView) parent).performItemClick(v, position, 0); // Let the event be handled in onItemClick()
}
});

view.findViewById(R.id.delete_mount).setOnClickListener(new View.OnClickListener() {
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((ListView) parent).performItemClick(v, position, 0); // Let the event be handled in onItemClick()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.meefik.linuxdeploy;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
Expand Down Expand Up @@ -91,6 +92,7 @@ public static List<String> getProfiles(Context c) {
return profiles;
}

@SuppressLint("RestrictedApi")
private void addDialog() {
final EditText input = new EditText(this);
new AlertDialog.Builder(this)
Expand All @@ -116,6 +118,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
}).show();
}

@SuppressLint("RestrictedApi")
private void editDialog() {
final EditText input = new EditText(this);
final int pos = listView.getCheckedItemPosition();
Expand Down Expand Up @@ -183,14 +186,15 @@ public void onClick(DialogInterface dialog, int whichButton) {
}
}

@SuppressLint("ClickableViewAccessibility")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PrefStore.setLocale(this);
setContentView(R.layout.activity_profiles);

// ListView Adapter
listView = (ListView) findViewById(R.id.profilesView);
listView = findViewById(R.id.profilesView);
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_single_choice, listItems);
listView.setAdapter(adapter);

Expand Down Expand Up @@ -257,6 +261,7 @@ public void onResume() {
listView.setItemChecked(getPosition(profile), true);
}

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
gd.onTouchEvent(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_repository);

// ListView Adapter
ListView listView = (ListView) findViewById(R.id.repositoryView);
ListView listView = findViewById(R.id.repositoryView);
adapter = new ArrayAdapter<Map<String, String>>(this,
R.layout.repository_row, R.id.repo_entry_title, profiles) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
TextView title = (TextView) view.findViewById(R.id.repo_entry_title);
TextView subTitle = (TextView) view.findViewById(R.id.repo_entry_subtitle);
ImageView icon = (ImageView) view.findViewById(R.id.repo_entry_icon);
TextView title = view.findViewById(R.id.repo_entry_title);
TextView subTitle = view.findViewById(R.id.repo_entry_subtitle);
ImageView icon = view.findViewById(R.id.repo_entry_icon);
String name = profiles.get(position).get("PROFILE");
String desc = profiles.get(position).get("DESC");
String type = profiles.get(position).get("TYPE");
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/mounts_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="4dp"
android:paddingLeft="4dp"
android:textAppearance="@android:style/TextAppearance.Medium" />
android:paddingRight="4dp"
android:textSize="18sp" />

<Button
android:id="@+id/delete_mount"
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<string name="toast_import_profile_error">"Kesalahan mengimpor profil!"</string>
<string name="toast_export_profile_success">"Profil telah berhasil diekspor."</string>
<string name="toast_export_profile_error">"Kesalahan mengekspor profil!"</string>
<string name="toast_terminal_error">"Kesalahan saat memulai terminal!"</string>
<string name="toast_loading_error">"Terjadi kesalahan saat memuat data!"</string>
<string name="toast_updating_env_error">"Kesalahan memperbarui lingkungan pengoperasian!"</string>
<string name="confirm_profile_discard_title">"Hapus profil"</string>
Expand Down Expand Up @@ -88,8 +87,6 @@
<string name="dialog_title_autostart_delay_preference">"Tunda (detik)"</string>
<string name="title_nettrack_preference">"Pemicu jaringan"</string>
<string name="summary_nettrack_preference">"Melacak perubahan jaringan dan memperbarui container"</string>
<string name="title_terminalcmd_preference">"Perintah terminal"</string>
<string name="dialog_title_terminalcmd_preference">"Perintah terminal"</string>

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

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
<string name="toast_import_profile_error">프로파일을 불러오는 데 오류가 발생했습니다!</string>
<string name="toast_export_profile_success">프로파일 내보내기 성공.</string>
<string name="toast_export_profile_error">프로파일을 내보내기 하는데 오류가 발생했습니다!</string>
<string name="toast_terminal_error">터미널로 시작하는 데 오류가 발생했습니다.</string>
<string name="toast_loading_error">데이터 불러오기 오류</string>
<string name="confirm_profile_discard_title">프로파일 삭제</string>
<string name="confirm_profile_discard_message">선택된 프로파일을 삭제하시겠습니까?</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<string name="toast_import_profile_error">Błąd przy importowaniu profilu!</string>
<string name="toast_export_profile_success">Profil został pomyślnie eksportowany.</string>
<string name="toast_export_profile_error">Błąd przy eksportowaniu profilu!</string>
<string name="toast_terminal_error">Błąd podczas uruchamiania terminala!</string>
<string name="confirm_profile_discard_title">Usuń profil</string>
<string name="confirm_profile_discard_message">Usunąć wybrany profil?</string>
<string name="new_mount_title">Punkt montowania</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<string name="toast_import_profile_error">Erro ao importar perfil!</string>
<string name="toast_export_profile_success">Perfil exportado com sucesso.</string>
<string name="toast_export_profile_error">Erro ao exportar perfil!</string>
<string name="toast_terminal_error">Error when starting the terminal!</string>
<string name="confirm_profile_discard_title">Remover perfil</string>
<string name="confirm_profile_discard_message">Remover o perfil selecionado?</string>
<string name="new_mount_title">Ponto de montagem</string>
Expand Down Expand Up @@ -173,5 +172,6 @@
<string name="title_configure_dialog">Configurar</string>
<string name="gui_preferences">GUI</string>
<string name="repository_purchase_button">Comprar</string>
<string name="nav_profiles">Perfis</string>

</resources>
3 changes: 2 additions & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
<string name="title_x11_display_preference">Номер дисплея</string>
<string name="title_x11_host_preference">Адрес X-сервера</string>
<string name="title_x11_sdl_preference">XServer XSDL</string>
<string name="toast_terminal_error">Ошибка при запуске терминала!</string>
<string name="x11_preferences">X11</string>
<string name="title_vnc_args_preference">Опции VNC-сервера</string>
<string name="title_vnc_depth_preference">Глубина цвета (бит)</string>
Expand Down Expand Up @@ -244,5 +243,7 @@
<string name="dialog_title_pulse_port_preference">PulseAudio: порт</string>
<string name="title_pulse_host_preference">Адрес сервера</string>
<string name="dialog_title_pulse_host_preference">PulseAudio: адрес сервера</string>
<string name="hint_mounts_source">Исходная</string>
<string name="hint_mounts_target">Целевая (опционально)</string>

</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<string name="toast_import_profile_error">导入配置文件出错!</string>
<string name="toast_export_profile_success">配置文件已成功导出。</string>
<string name="toast_export_profile_error">导出配置文件出错!</string>
<string name="toast_terminal_error">启动终端时出错!</string>
<string name="toast_loading_error">加载数据时出错!</string>
<string name="toast_updating_env_error">操作环境更新错误!</string>
<string name="confirm_profile_discard_title">删除配置文件</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<string name="toast_import_profile_error">Error importing profile!</string>
<string name="toast_export_profile_success">Profile has been successfully exported.</string>
<string name="toast_export_profile_error">Error exporting profile!</string>
<string name="toast_terminal_error">Error when starting the terminal!</string>
<string name="toast_loading_error">Error loading data!</string>
<string name="toast_updating_env_error">Error updating of operating environment!</string>
<string name="confirm_profile_discard_title">Remove profile</string>
Expand Down

0 comments on commit abd0ed8

Please sign in to comment.