diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e05d8a..6119bdc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 (issue #1019) +- Replaced by dbus-run-session to dbus-launch + +### Fixed +- Problem with running "am" via unchroot (issue #987) +- Problem with color in the list of mount points (issue #1018) + ## [2.2.1] - 2018-10-29 ### Changed - Updated built-in busybox to v1.29.3 diff --git a/app/build.gradle b/app/build.gradle index dd83dd67..d593e978 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 { @@ -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' } diff --git a/app/src/main/assets/env b/app/src/main/assets/env index c5b0ec7d..f8beb2a3 160000 --- a/app/src/main/assets/env +++ b/app/src/main/assets/env @@ -1 +1 @@ -Subproject commit c5b0ec7de870f4ba47ae73e058a6afb767b11c62 +Subproject commit f8beb2a337367e938e1f75ada6575e621169b0f5 diff --git a/app/src/main/java/ru/meefik/linuxdeploy/MountsActivity.java b/app/src/main/java/ru/meefik/linuxdeploy/MountsActivity.java index 79cc2651..29b3f953 100644 --- a/app/src/main/java/ru/meefik/linuxdeploy/MountsActivity.java +++ b/app/src/main/java/ru/meefik/linuxdeploy/MountsActivity.java @@ -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; @@ -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; @@ -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) @@ -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(this, R.layout.mounts_row, listItems) { + ListView listView = findViewById(R.id.mountsView); + adapter = new ArrayAdapter(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() diff --git a/app/src/main/java/ru/meefik/linuxdeploy/ProfilesActivity.java b/app/src/main/java/ru/meefik/linuxdeploy/ProfilesActivity.java index f5664021..999509e1 100644 --- a/app/src/main/java/ru/meefik/linuxdeploy/ProfilesActivity.java +++ b/app/src/main/java/ru/meefik/linuxdeploy/ProfilesActivity.java @@ -1,5 +1,6 @@ package ru.meefik.linuxdeploy; +import android.annotation.SuppressLint; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; @@ -91,6 +92,7 @@ public static List getProfiles(Context c) { return profiles; } + @SuppressLint("RestrictedApi") private void addDialog() { final EditText input = new EditText(this); new AlertDialog.Builder(this) @@ -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(); @@ -183,6 +186,7 @@ public void onClick(DialogInterface dialog, int whichButton) { } } + @SuppressLint("ClickableViewAccessibility") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -190,7 +194,7 @@ public void onCreate(Bundle savedInstanceState) { 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); @@ -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); diff --git a/app/src/main/java/ru/meefik/linuxdeploy/RepositoryActivity.java b/app/src/main/java/ru/meefik/linuxdeploy/RepositoryActivity.java index b11909d1..c39c94ce 100644 --- a/app/src/main/java/ru/meefik/linuxdeploy/RepositoryActivity.java +++ b/app/src/main/java/ru/meefik/linuxdeploy/RepositoryActivity.java @@ -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>(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"); diff --git a/app/src/main/res/layout/mounts_row.xml b/app/src/main/res/layout/mounts_row.xml index 5f9772ff..412d329a 100644 --- a/app/src/main/res/layout/mounts_row.xml +++ b/app/src/main/res/layout/mounts_row.xml @@ -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" />