From 1ceb41acb69f8cd780d44b438ff8db3410cbe225 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Sun, 9 Aug 2015 22:05:20 -0400 Subject: Handle click events as well (useful when password field is the only focusable view) --- .../java/com/zeapo/pwdstore/autofill/AutofillFragment.java | 13 +++++++++++++ .../java/com/zeapo/pwdstore/autofill/AutofillService.java | 2 +- app/src/main/res/xml/autofill_config.xml | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java index e9aa86f0..c1d75acd 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java @@ -1,6 +1,7 @@ package com.zeapo.pwdstore.autofill; import android.content.DialogInterface; +import android.content.Intent; import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; @@ -13,6 +14,7 @@ import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; +import com.zeapo.pwdstore.PasswordStore; import com.zeapo.pwdstore.R; public class AutofillFragment extends DialogFragment { @@ -50,6 +52,17 @@ public class AutofillFragment extends DialogFragment { ((EditText) view.findViewById(R.id.matched)).setText(preference); } + View.OnClickListener matchPassword = new View.OnClickListener() { + @Override + public void onClick(View v) { + // TODO figure out UI for this + Intent intent = new Intent(getActivity(), PasswordStore.class); + startActivity(intent); + } + }; + view.findViewById(R.id.match).setOnClickListener(matchPassword); + view.findViewById(R.id.matched).setOnClickListener(matchPassword); + final SharedPreferences.Editor editor = prefs.edit(); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java index dbd018b6..4731f1d4 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java @@ -60,7 +60,7 @@ public class AutofillService extends AccessibilityService { serviceConnection.bindToService(); settings = PreferenceManager.getDefaultSharedPreferences(this); } - // TODO handle CLICKS and change search/search results (just use first result) + // TODO change search/search results (just use first result) @Override public void onAccessibilityEvent(AccessibilityEvent event) { // if returning to the source app from a successful AutofillActivity diff --git a/app/src/main/res/xml/autofill_config.xml b/app/src/main/res/xml/autofill_config.xml index 93125a51..36ef5aaa 100644 --- a/app/src/main/res/xml/autofill_config.xml +++ b/app/src/main/res/xml/autofill_config.xml @@ -1,6 +1,6 @@