Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Prevent accident clicks
Browse files Browse the repository at this point in the history
Refs #2095
  • Loading branch information
M66B committed Dec 24, 2014
1 parent d0d3834 commit a683a48
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit a683a48

Please sign in to comment.