mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-24 01:32:16 -05:00
Fix onTouchEvent delegation, with workaround for Android bug
This commit is contained in:
parent
4aec28c237
commit
717d66961b
@ -28,7 +28,6 @@ import android.os.Bundle;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Messenger;
|
import android.os.Messenger;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@ -88,8 +87,6 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
// view
|
// view
|
||||||
private ImportKeysListFragment mListFragment;
|
private ImportKeysListFragment mListFragment;
|
||||||
private String[] mNavigationStrings;
|
|
||||||
private Fragment mCurrentFragment;
|
|
||||||
private View mImportButton;
|
private View mImportButton;
|
||||||
private ViewPager mViewPager;
|
private ViewPager mViewPager;
|
||||||
private SlidingTabLayout mSlidingTabLayout;
|
private SlidingTabLayout mSlidingTabLayout;
|
||||||
@ -121,8 +118,6 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mNavigationStrings = getResources().getStringArray(R.array.import_action_list);
|
|
||||||
|
|
||||||
// TODO: add actionbar button for this action?
|
// TODO: add actionbar button for this action?
|
||||||
// if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN.equals(getIntent().getAction())) {
|
// if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN.equals(getIntent().getAction())) {
|
||||||
// }
|
// }
|
||||||
@ -373,7 +368,13 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
boolean result = super.onTouchEvent(event);
|
boolean result = super.onTouchEvent(event);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
try {
|
||||||
mViewPager.onTouchEvent(event);
|
mViewPager.onTouchEvent(event);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
// workaround for Android bug?
|
||||||
|
// http://stackoverflow.com/q/16459196
|
||||||
|
Log.d(Constants.TAG, "Workaround: Catched IllegalArgumentException");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -48,13 +48,5 @@
|
|||||||
<item>@string/key_size_1024</item>
|
<item>@string/key_size_1024</item>
|
||||||
<item>@string/key_size_custom</item>
|
<item>@string/key_size_custom</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="import_action_list" translatable="false">
|
|
||||||
<item>@string/menu_import_from_key_server</item>
|
|
||||||
<item>@string/menu_import_from_file</item>
|
|
||||||
<item>@string/menu_import_from_qr_code</item>
|
|
||||||
<item>@string/import_from_clipboard</item>
|
|
||||||
<item>@string/menu_import_from_nfc</item>
|
|
||||||
<item>@string/menu_import_from_keybase</item>
|
|
||||||
</string-array>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user