From a683a48f7b289c7a5f01721eb2506d05bbb6e1fd Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Dec 2014 19:49:11 +0100 Subject: [PATCH] Prevent accident clicks Refs #2095 --- src/biz/bokhorst/xprivacy/ActivityMain.java | 27 ++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/biz/bokhorst/xprivacy/ActivityMain.java b/src/biz/bokhorst/xprivacy/ActivityMain.java index f3cdfc538..28a4ce4d9 100644 --- a/src/biz/bokhorst/xprivacy/ActivityMain.java +++ b/src/biz/bokhorst/xprivacy/ActivityMain.java @@ -2034,6 +2034,17 @@ else if (state == ApplicationInfoEx.STATE_SHARED) else holder.row.setBackgroundColor(Color.TRANSPARENT); + // Handle details click + holder.imgIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent intentSettings = new Intent(ActivityMain.this, ActivityApp.class); + intentSettings.putExtra(ActivityApp.cUid, xAppInfo.getUid()); + intentSettings.putExtra(ActivityApp.cRestrictionName, mRestrictionName); + ActivityMain.this.startActivity(intentSettings); + } + }); + // Listen for multiple select holder.llName.setOnLongClickListener(new View.OnLongClickListener() { @Override @@ -2243,17 +2254,6 @@ public View getView(int position, View convertView, ViewGroup parent) { // Get info final ApplicationInfoEx xAppInfo = getItem(holder.position); - // Handle details click - holder.imgIcon.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - Intent intentSettings = new Intent(ActivityMain.this, ActivityApp.class); - intentSettings.putExtra(ActivityApp.cUid, xAppInfo.getUid()); - intentSettings.putExtra(ActivityApp.cRestrictionName, mRestrictionName); - ActivityMain.this.startActivity(intentSettings); - } - }); - // Set data holder.row.setBackgroundColor(Color.TRANSPARENT); holder.vwState.setBackgroundColor(Color.TRANSPARENT); @@ -2271,6 +2271,11 @@ public void onClick(View view) { holder.tvName.setEnabled(false); holder.imgCbRestricted.setEnabled(false); + holder.imgIcon.setClickable(false); + holder.llName.setClickable(false); + holder.imgCbRestricted.setClickable(false); + holder.imgCbAsk.setClickable(false); + // Async update new HolderTask(position, holder, xAppInfo).executeOnExecutor(mExecutor, (Object) null);