mirror of
https://github.com/android-password-store/Android-Password-Store.git
synced 2025-09-07 16:09:38 +02:00
Stop relying on parent activties in subsettings
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
be0d89958a
commit
3b758928ff
|
@ -47,9 +47,7 @@
|
||||||
android:value="com.zeapo.pwdstore.PasswordStore" />
|
android:value="com.zeapo.pwdstore.PasswordStore" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity android:name=".SshKeyGen">
|
||||||
android:name=".SshKeyGen"
|
|
||||||
android:parentActivityName=".PasswordStore">
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.zeapo.pwdstore.PasswordStore" />
|
android:value="com.zeapo.pwdstore.PasswordStore" />
|
||||||
|
@ -77,9 +75,7 @@
|
||||||
android:value="com.zeapo.pwdstore.PasswordStore" />
|
android:value="com.zeapo.pwdstore.PasswordStore" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity android:name=".autofill.AutofillPreferenceActivity">
|
||||||
android:name=".autofill.AutofillPreferenceActivity"
|
|
||||||
android:parentActivityName=".PasswordStore">
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="com.zeapo.pwdstore.PasswordStore" />
|
android:value="com.zeapo.pwdstore.PasswordStore" />
|
||||||
|
|
|
@ -16,6 +16,7 @@ import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
@ -61,6 +62,16 @@ public class SshKeyGen extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
if (item.getItemId() == android.R.id.home) {
|
||||||
|
// The back arrow in the action bar should act the same as the back button.
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
// Invoked when 'Generate' button of SshKeyGenFragment clicked. Generates a
|
// Invoked when 'Generate' button of SshKeyGenFragment clicked. Generates a
|
||||||
// private and public key, then replaces the SshKeyGenFragment with a
|
// private and public key, then replaces the SshKeyGenFragment with a
|
||||||
// ShowSshKeyFragment which displays the public key.
|
// ShowSshKeyFragment which displays the public key.
|
||||||
|
|
|
@ -14,8 +14,6 @@ import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import androidx.core.app.NavUtils
|
|
||||||
import androidx.core.app.TaskStackBuilder
|
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
@ -86,18 +84,10 @@ class AutofillPreferenceActivity : AppCompatActivity() {
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
// in service, we CLEAR_TASK. then we set the recreate flag.
|
// in service, we CLEAR_TASK. then we set the recreate flag.
|
||||||
// something of a hack, but w/o CLEAR_TASK, behaviour was unpredictable
|
// something of a hack, but w/o CLEAR_TASK, behaviour was unpredictable
|
||||||
if (item.itemId == android.R.id.home) {
|
return if (item.itemId == android.R.id.home) {
|
||||||
val upIntent = NavUtils.getParentActivityIntent(this)
|
onBackPressed()
|
||||||
if (recreate) {
|
true
|
||||||
TaskStackBuilder.create(this)
|
} else super.onOptionsItemSelected(item)
|
||||||
.addNextIntentWithParentStack(upIntent!!)
|
|
||||||
.startActivities()
|
|
||||||
} else {
|
|
||||||
NavUtils.navigateUpTo(this, upIntent!!)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun showDialog(packageName: String?, appName: String?, isWeb: Boolean) {
|
fun showDialog(packageName: String?, appName: String?, isWeb: Boolean) {
|
||||||
|
|
Loading…
Reference in a new issue