mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-03-01 09:51:51 -05:00
deactive search until it is reimplemented, syntax improvements in Compatibility class
This commit is contained in:
parent
b56326aec8
commit
8abfb5a6f4
@ -157,8 +157,9 @@ public class KeyListActivity extends SherlockFragmentActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
super.onCreateOptionsMenu(menu);
|
super.onCreateOptionsMenu(menu);
|
||||||
menu.add(3, Id.menu.option.search, 0, R.string.menu_search)
|
// TODO: reimplement!
|
||||||
.setIcon(R.drawable.ic_menu_search).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
// menu.add(3, Id.menu.option.search, 0, R.string.menu_search)
|
||||||
|
// .setIcon(R.drawable.ic_menu_search).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
|
||||||
menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys).setShowAsAction(
|
menu.add(0, Id.menu.option.import_keys, 2, R.string.menu_importKeys).setShowAsAction(
|
||||||
MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
MenuItem.SHOW_AS_ACTION_NEVER | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys).setShowAsAction(
|
menu.add(0, Id.menu.option.export_keys, 3, R.string.menu_exportKeys).setShowAsAction(
|
||||||
@ -322,8 +323,8 @@ public class KeyListActivity extends SherlockFragmentActivity {
|
|||||||
intent.putExtra(ApgIntentService.EXTRA_DATA, data);
|
intent.putExtra(ApgIntentService.EXTRA_DATA, data);
|
||||||
|
|
||||||
// Message is received after importing is done in ApgService
|
// Message is received after importing is done in ApgService
|
||||||
ApgIntentServiceHandler saveHandler = new ApgIntentServiceHandler(this, R.string.progress_importing,
|
ApgIntentServiceHandler saveHandler = new ApgIntentServiceHandler(this,
|
||||||
ProgressDialog.STYLE_HORIZONTAL) {
|
R.string.progress_importing, ProgressDialog.STYLE_HORIZONTAL) {
|
||||||
public void handleMessage(Message message) {
|
public void handleMessage(Message message) {
|
||||||
// handle messages by standard ApgHandler first
|
// handle messages by standard ApgHandler first
|
||||||
super.handleMessage(message);
|
super.handleMessage(message);
|
||||||
@ -414,8 +415,8 @@ public class KeyListActivity extends SherlockFragmentActivity {
|
|||||||
intent.putExtra(ApgIntentService.EXTRA_DATA, data);
|
intent.putExtra(ApgIntentService.EXTRA_DATA, data);
|
||||||
|
|
||||||
// Message is received after exporting is done in ApgService
|
// Message is received after exporting is done in ApgService
|
||||||
ApgIntentServiceHandler exportHandler = new ApgIntentServiceHandler(this, R.string.progress_exporting,
|
ApgIntentServiceHandler exportHandler = new ApgIntentServiceHandler(this,
|
||||||
ProgressDialog.STYLE_HORIZONTAL) {
|
R.string.progress_exporting, ProgressDialog.STYLE_HORIZONTAL) {
|
||||||
public void handleMessage(Message message) {
|
public void handleMessage(Message message) {
|
||||||
// handle messages by standard ApgHandler first
|
// handle messages by standard ApgHandler first
|
||||||
super.handleMessage(message);
|
super.handleMessage(message);
|
||||||
|
@ -60,7 +60,7 @@ public class SelectPublicKeyActivity extends SherlockFragmentActivity {
|
|||||||
mSelectFragment = (SelectPublicKeyFragment) getSupportFragmentManager().findFragmentById(
|
mSelectFragment = (SelectPublicKeyFragment) getSupportFragmentManager().findFragmentById(
|
||||||
R.id.select_public_key_fragment);
|
R.id.select_public_key_fragment);
|
||||||
|
|
||||||
//
|
// TODO: reimplement!
|
||||||
// mFilterLayout = findViewById(R.id.layout_filter);
|
// mFilterLayout = findViewById(R.id.layout_filter);
|
||||||
// mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo);
|
// mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo);
|
||||||
// mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear);
|
// mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear);
|
||||||
@ -81,6 +81,8 @@ public class SelectPublicKeyActivity extends SherlockFragmentActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleIntent(Intent intent) {
|
private void handleIntent(Intent intent) {
|
||||||
|
// TODO: reimplement!
|
||||||
|
|
||||||
// String searchString = null;
|
// String searchString = null;
|
||||||
// if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
|
// if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
|
||||||
// searchString = intent.getStringExtra(SearchManager.QUERY);
|
// searchString = intent.getStringExtra(SearchManager.QUERY);
|
||||||
@ -124,8 +126,9 @@ public class SelectPublicKeyActivity extends SherlockFragmentActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
menu.add(0, Id.menu.option.search, 0, R.string.menu_search).setIcon(
|
// TODO: reimplement!
|
||||||
android.R.drawable.ic_menu_search);
|
// menu.add(0, Id.menu.option.search, 0, R.string.menu_search).setIcon(
|
||||||
|
// android.R.drawable.ic_menu_search);
|
||||||
menu.add(1, Id.menu.option.cancel, 0, R.string.btn_doNotSave).setShowAsAction(
|
menu.add(1, Id.menu.option.cancel, 0, R.string.btn_doNotSave).setShowAsAction(
|
||||||
MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
menu.add(1, Id.menu.option.okay, 1, R.string.btn_okay).setShowAsAction(
|
menu.add(1, Id.menu.option.okay, 1, R.string.btn_okay).setShowAsAction(
|
||||||
|
@ -51,6 +51,7 @@ public class SelectSecretKeyActivity extends SherlockFragmentActivity {
|
|||||||
|
|
||||||
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
|
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
|
||||||
|
|
||||||
|
// TODO: reimplement!
|
||||||
// mFilterLayout = findViewById(R.id.layout_filter);
|
// mFilterLayout = findViewById(R.id.layout_filter);
|
||||||
// mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo);
|
// mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo);
|
||||||
// mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear);
|
// mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear);
|
||||||
@ -85,6 +86,8 @@ public class SelectSecretKeyActivity extends SherlockFragmentActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleIntent(Intent intent) {
|
private void handleIntent(Intent intent) {
|
||||||
|
// TODO: reimplement!
|
||||||
|
|
||||||
// String searchString = null;
|
// String searchString = null;
|
||||||
// if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
|
// if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
|
||||||
// searchString = intent.getStringExtra(SearchManager.QUERY);
|
// searchString = intent.getStringExtra(SearchManager.QUERY);
|
||||||
@ -103,8 +106,9 @@ public class SelectSecretKeyActivity extends SherlockFragmentActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
menu.add(0, Id.menu.option.search, 0, R.string.menu_search).setIcon(
|
// TODO: reimplement!
|
||||||
android.R.drawable.ic_menu_search);
|
// menu.add(0, Id.menu.option.search, 0, R.string.menu_search).setIcon(
|
||||||
|
// android.R.drawable.ic_menu_search);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,15 +35,17 @@ public class Compatibility {
|
|||||||
Object clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE);
|
Object clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
try {
|
try {
|
||||||
if ("android.text.ClipboardManager".equals(clipboard.getClass().getName())) {
|
if ("android.text.ClipboardManager".equals(clipboard.getClass().getName())) {
|
||||||
Method method = clipboard.getClass().getMethod("setText", CharSequence.class);
|
Method methodSetText = clipboard.getClass()
|
||||||
method.invoke(clipboard, text);
|
.getMethod("setText", CharSequence.class);
|
||||||
|
methodSetText.invoke(clipboard, text);
|
||||||
} else if ("android.content.ClipboardManager".equals(clipboard.getClass().getName())) {
|
} else if ("android.content.ClipboardManager".equals(clipboard.getClass().getName())) {
|
||||||
Class<?> clazz = Class.forName("android.content.ClipData");
|
Class<?> classClipData = Class.forName("android.content.ClipData");
|
||||||
Method method = clazz.getMethod("newPlainText", CharSequence.class,
|
Method methodNewPlainText = classClipData.getMethod("newPlainText",
|
||||||
CharSequence.class);
|
CharSequence.class, CharSequence.class);
|
||||||
Object clip = method.invoke(null, clipboardLabel, text);
|
Object clip = methodNewPlainText.invoke(null, clipboardLabel, text);
|
||||||
method = clipboard.getClass().getMethod("setPrimaryClip", clazz);
|
methodNewPlainText = clipboard.getClass()
|
||||||
method.invoke(clipboard, clip);
|
.getMethod("setPrimaryClip", classClipData);
|
||||||
|
methodNewPlainText.invoke(clipboard, clip);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("ProjectsException", "There was and error copying the text to the clipboard: "
|
Log.e("ProjectsException", "There was and error copying the text to the clipboard: "
|
||||||
@ -62,8 +64,8 @@ public class Compatibility {
|
|||||||
try {
|
try {
|
||||||
if ("android.text.ClipboardManager".equals(clipboard.getClass().getName())) {
|
if ("android.text.ClipboardManager".equals(clipboard.getClass().getName())) {
|
||||||
// CharSequence text = clipboard.getText();
|
// CharSequence text = clipboard.getText();
|
||||||
Method method = clipboard.getClass().getMethod("getText");
|
Method methodGetText = clipboard.getClass().getMethod("getText");
|
||||||
Object text = method.invoke(clipboard);
|
Object text = methodGetText.invoke(clipboard);
|
||||||
|
|
||||||
return (CharSequence) text;
|
return (CharSequence) text;
|
||||||
} else if ("android.content.ClipboardManager".equals(clipboard.getClass().getName())) {
|
} else if ("android.content.ClipboardManager".equals(clipboard.getClass().getName())) {
|
||||||
@ -72,7 +74,7 @@ public class Compatibility {
|
|||||||
Object clipData = methodGetPrimaryClip.invoke(clipboard);
|
Object clipData = methodGetPrimaryClip.invoke(clipboard);
|
||||||
|
|
||||||
// ClipData.Item clipDataItem = clipData.getItemAt(0);
|
// ClipData.Item clipDataItem = clipData.getItemAt(0);
|
||||||
Method methodGetItemAt = clipData.getClass().getMethod("getItemAt", Integer.TYPE);
|
Method methodGetItemAt = clipData.getClass().getMethod("getItemAt", int.class);
|
||||||
Object clipDataItem = methodGetItemAt.invoke(clipData, 0);
|
Object clipDataItem = methodGetItemAt.invoke(clipData, 0);
|
||||||
|
|
||||||
// CharSequence text = clipDataItem.coerceToText(context);
|
// CharSequence text = clipDataItem.coerceToText(context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user