mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
Merge pull request #319 from Emantor/lint_fix
Fix Lint ScrollViewSize, DefaultLocale Warnings and NewApi errors
This commit is contained in:
commit
3acbefa98b
@ -33,6 +33,7 @@ import se.emilsjolander.stickylistheaders.ApiLevelTooLowException;
|
|||||||
import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
|
import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.annotation.TargetApi;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -276,7 +277,8 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte
|
|||||||
viewIntent.setData(KeychainContract.KeyRings.buildPublicKeyRingsUri(Long.toString(id)));
|
viewIntent.setData(KeychainContract.KeyRings.buildPublicKeyRingsUri(Long.toString(id)));
|
||||||
startActivity(viewIntent);
|
startActivity(viewIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TargetApi(11)
|
||||||
public void encrypt(ActionMode mode, long[] keyRingRowIds) {
|
public void encrypt(ActionMode mode, long[] keyRingRowIds) {
|
||||||
// get master key ids from row ids
|
// get master key ids from row ids
|
||||||
long[] keyRingIds = new long[keyRingRowIds.length];
|
long[] keyRingIds = new long[keyRingRowIds.length];
|
||||||
@ -298,6 +300,7 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte
|
|||||||
*
|
*
|
||||||
* @param keyRingRowIds
|
* @param keyRingRowIds
|
||||||
*/
|
*/
|
||||||
|
@TargetApi(11)
|
||||||
public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) {
|
public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) {
|
||||||
// Message is received after key is deleted
|
// Message is received after key is deleted
|
||||||
Handler returnHandler = new Handler() {
|
Handler returnHandler = new Handler() {
|
||||||
@ -332,4 +335,4 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte
|
|||||||
deleteKeyDialog.show(getActivity().getSupportFragmentManager(), "deleteKeyDialog");
|
deleteKeyDialog.show(getActivity().getSupportFragmentManager(), "deleteKeyDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.ui.adapter.KeyListSecretAdapter;
|
|||||||
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.annotation.TargetApi;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -209,6 +210,7 @@ public class KeyListSecretFragment extends ListFragment implements
|
|||||||
*
|
*
|
||||||
* @param keyRingRowIds
|
* @param keyRingRowIds
|
||||||
*/
|
*/
|
||||||
|
@TargetApi(11)
|
||||||
public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) {
|
public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) {
|
||||||
// Message is received after key is deleted
|
// Message is received after key is deleted
|
||||||
Handler returnHandler = new Handler() {
|
Handler returnHandler = new Handler() {
|
||||||
|
@ -32,6 +32,7 @@ import java.util.List;
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
@ -172,11 +173,11 @@ public class HkpKeyServer extends KeyServer {
|
|||||||
if (e.getCode() == 404) {
|
if (e.getCode() == 404) {
|
||||||
return results;
|
return results;
|
||||||
} else {
|
} else {
|
||||||
if (e.getData().toLowerCase().contains("no keys found")) {
|
if (e.getData().toLowerCase(Locale.US).contains("no keys found")) {
|
||||||
return results;
|
return results;
|
||||||
} else if (e.getData().toLowerCase().contains("too many")) {
|
} else if (e.getData().toLowerCase(Locale.US).contains("too many")) {
|
||||||
throw new TooManyResponses();
|
throw new TooManyResponses();
|
||||||
} else if (e.getData().toLowerCase().contains("insufficient")) {
|
} else if (e.getData().toLowerCase(Locale.US).contains("insufficient")) {
|
||||||
throw new InsufficientQuery();
|
throw new InsufficientQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@ -26,4 +26,4 @@
|
|||||||
tools:layout="@layout/api_app_settings_fragment" />
|
tools:layout="@layout/api_app_settings_fragment" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@ -18,4 +18,4 @@
|
|||||||
tools:layout="@layout/api_app_settings_fragment" />
|
tools:layout="@layout/api_app_settings_fragment" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -71,8 +71,8 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/editors"
|
android:id="@+id/editors"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical" />
|
android:orientation="vertical" />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user