Disable text selection as it didn't allow links.
Possible but wonky solution suggested in the source code comments.
This commit is contained in:
parent
9941e543ed
commit
35d30e148e
@ -303,12 +303,6 @@ public class AppDetails extends ListActivity {
|
|||||||
mInstalledSigID = old.mInstalledSigID;
|
mInstalledSigID = old.mInstalledSigID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the new textview select stuff only when available
|
|
||||||
private void setSelectable(TextView tv) {
|
|
||||||
if (Utils.hasApi(11))
|
|
||||||
tv.setTextIsSelectable(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the display and list contents. Used when entering the activity, and
|
// Reset the display and list contents. Used when entering the activity, and
|
||||||
// also when something has been installed/uninstalled.
|
// also when something has been installed/uninstalled.
|
||||||
// Return true if the app was found, false otherwise.
|
// Return true if the app was found, false otherwise.
|
||||||
@ -403,8 +397,27 @@ public class AppDetails extends ListActivity {
|
|||||||
tv = (TextView) findViewById(R.id.status);
|
tv = (TextView) findViewById(R.id.status);
|
||||||
|
|
||||||
tv = (TextView) infoView.findViewById(R.id.description);
|
tv = (TextView) infoView.findViewById(R.id.description);
|
||||||
|
|
||||||
|
/*
|
||||||
|
The following is a quick solution to enable both text selection and
|
||||||
|
links. Causes glitches and crashes:
|
||||||
|
java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0
|
||||||
|
|
||||||
|
class CustomMovementMethod extends LinkMovementMethod {
|
||||||
|
@Override
|
||||||
|
public boolean canSelectArbitrarily () {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Utils.hasApi(11))
|
||||||
|
tv.setTextIsSelectable(true);
|
||||||
|
tv.setMovementMethod(new CustomMovementMethod());
|
||||||
|
else
|
||||||
|
tv.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
*/
|
||||||
|
|
||||||
tv.setMovementMethod(LinkMovementMethod.getInstance());
|
tv.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
setSelectable(tv);
|
|
||||||
|
|
||||||
// Need this to add the unimplemented support for ordered and unordered
|
// Need this to add the unimplemented support for ordered and unordered
|
||||||
// lists to Html.fromHtml().
|
// lists to Html.fromHtml().
|
||||||
@ -441,7 +454,6 @@ public class AppDetails extends ListActivity {
|
|||||||
|
|
||||||
tv = (TextView) infoView.findViewById(R.id.summary);
|
tv = (TextView) infoView.findViewById(R.id.summary);
|
||||||
tv.setText(app.summary);
|
tv.setText(app.summary);
|
||||||
setSelectable(tv);
|
|
||||||
|
|
||||||
tv = (TextView) infoView.findViewById(R.id.permissions_list);
|
tv = (TextView) infoView.findViewById(R.id.permissions_list);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user