Remove old pattern lib, add new pattern lib

This commit is contained in:
Dominik Schürmann 2015-02-23 00:28:26 +01:00
parent 6b57afc350
commit 7bddd5be1d
6 changed files with 62 additions and 98 deletions

View file

@ -19,9 +19,9 @@ dependencies {
compile project(':extern:KeybaseLib:Lib')
compile project(':extern:TokenAutoComplete:library')
compile project(':extern:safeslinger-exchange')
compile project(':extern:android-lockpattern:code')
// TODO: include as submodule?:
// TODO: Pin!
compile 'com.eftimoff:android-patternview:1.0.0@aar'
compile 'com.journeyapps:zxing-android-embedded:2.0.1@aar'
compile 'com.journeyapps:zxing-android-integration:2.0.1@aar'
compile 'com.google.zxing:core:3.0.1'

View file

@ -67,8 +67,10 @@
<uses-permission android:name="android.permission.READ_PROFILE" />
<!-- android:allowBackup="false": Don't allow backup over adb backup or other apps! -->
<!-- tools:replace="android:allowBackup" is a workaround for https://github.com/geftimov/android-patternview/pull/2 -->
<application
android:name=".KeychainApplication"
tools:replace="android:allowBackup"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
@ -653,12 +655,6 @@
<activity
android:name=".ui.PassphraseDialogActivity"
android:theme="@android:style/Theme.NoDisplay" />
<activity
android:name="com.haibison.android.lockpattern.LockPatternActivity"
android:label="@string/title_unlock"
android:configChanges="orientation|screenSize|keyboard|keyboardHidden"
android:screenOrientation="user"
android:theme="@style/Alp.42447968.Theme.Dialog.Light" />
<activity android:name=".ui.PassphraseWizardActivity" />
<!--
NOTE: singleTop is set to get NFC foreground dispatch to work.

View file

@ -41,8 +41,6 @@ import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.haibison.android.lockpattern.LockPatternActivity;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
@ -108,20 +106,20 @@ public class PassphraseDialogActivity extends FragmentActivity {
case RESULT_CANCELED:
// The user cancelled the task
break;
case LockPatternActivity.RESULT_FAILED:
// The user failed to enter the pattern
break;
case LockPatternActivity.RESULT_FORGOT_PATTERN:
// The user forgot the pattern and invoked your recovery Activity.
break;
// case LockPatternActivity.RESULT_FAILED:
// // The user failed to enter the pattern
// break;
// case LockPatternActivity.RESULT_FORGOT_PATTERN:
// // The user forgot the pattern and invoked your recovery Activity.
// break;
}
/*
* In any case, there's always a key EXTRA_RETRY_COUNT, which holds
* the number of tries that the user did.
*/
int retryCount = data.getIntExtra(
LockPatternActivity.EXTRA_RETRY_COUNT, 0);
// int retryCount = data.getIntExtra(
// LockPatternActivity.EXTRA_RETRY_COUNT, 0);
break;
}
@ -253,9 +251,9 @@ public class PassphraseDialogActivity extends FragmentActivity {
if (keyType == CanonicalizedSecretKey.SecretKeyType.PATTERN) {
// start pattern dialog and show progress circle here...
Intent patternActivity = new Intent(getActivity(), LockPatternActivity.class);
patternActivity.putExtra(LockPatternActivity.EXTRA_PATTERN, "123");
startActivityForResult(patternActivity, REQUEST_CODE_ENTER_PATTERN);
// Intent patternActivity = new Intent(getActivity(), LockPatternActivity.class);
// patternActivity.putExtra(LockPatternActivity.EXTRA_PATTERN, "123");
// startActivityForResult(patternActivity, REQUEST_CODE_ENTER_PATTERN);
mInput.setVisibility(View.GONE);
mProgress.setVisibility(View.VISIBLE);
} else {

View file

@ -43,10 +43,6 @@ import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.haibison.android.lockpattern.LockPatternFragment;
import com.haibison.android.lockpattern.LockPatternFragmentOld;
import com.haibison.android.lockpattern.widget.LockPatternView;
import org.sufficientlysecure.keychain.R;
import java.io.IOException;
@ -56,7 +52,8 @@ import java.util.Arrays;
import java.util.List;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class PassphraseWizardActivity extends FragmentActivity implements LockPatternView.OnPatternListener {
public class PassphraseWizardActivity extends FragmentActivity {
//public class PassphraseWizardActivity extends FragmentActivity implements LockPatternView.OnPatternListener {
//create or authenticate
public String selectedAction;
//for lockpattern
@ -117,10 +114,10 @@ public class PassphraseWizardActivity extends FragmentActivity implements LockPa
getActionBar().setTitle(R.string.draw_lockpattern);
}
// LockPatternFragmentOld lpf = LockPatternFragmentOld.newInstance(selectedAction);
LockPatternFragment lpf = LockPatternFragment.newInstance("asd");
// LockPatternFragment lpf = LockPatternFragment.newInstance("asd");
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
// FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
}
public void cancel(View view) {
@ -205,9 +202,9 @@ public class PassphraseWizardActivity extends FragmentActivity implements LockPa
writeNFC = false; //just write once
Toast.makeText(this, R.string.nfc_write_succesful, Toast.LENGTH_SHORT).show();
//advance to lockpattern
LockPatternFragmentOld lpf = LockPatternFragmentOld.newInstance(selectedAction);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
// LockPatternFragmentOld lpf = LockPatternFragmentOld.newInstance(selectedAction);
// FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
}
} catch (IOException | FormatException e) {
e.printStackTrace();
@ -224,9 +221,9 @@ public class PassphraseWizardActivity extends FragmentActivity implements LockPa
//passwort matches, go to next view
Toast.makeText(this, R.string.passphrases_match + "!", Toast.LENGTH_SHORT).show();
LockPatternFragmentOld lpf = LockPatternFragmentOld.newInstance(selectedAction);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
// LockPatternFragmentOld lpf = LockPatternFragmentOld.newInstance(selectedAction);
// FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// transaction.replace(R.id.fragmentContainer, lpf).addToBackStack(null).commit();
readNFC = false; //just once
} else {
//passwort doesnt match
@ -352,26 +349,6 @@ public class PassphraseWizardActivity extends FragmentActivity implements LockPa
adapter.disableForegroundDispatch(this);
}
@Override
public void onPatternStart() {
}
@Override
public void onPatternCleared() {
}
@Override
public void onPatternCellAdded(List<LockPatternView.Cell> pattern) {
}
@Override
public void onPatternDetected(List<LockPatternView.Cell> pattern) {
}
public static class SelectMethods extends Fragment {
// private OnFragmentInteractionListener mListener;

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<com.haibison.android.lockpattern.widget.LockPatternView_v14
android:id="@+id/lockPattern"
android:layout_width="@dimen/alp_42447968_separator_size"
android:layout_height="@dimen/alp_42447968_separator_size"
android:layout_marginTop="@dimen/alp_42447968_separator_size"
android:layout_marginBottom="@dimen/alp_42447968_separator_size"
android:layout_gravity="center_horizontal" />
</LinearLayout>

View file

@ -7,13 +7,12 @@
tools:context="pSontag.testopenkeychain.Passphrase">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_marginBottom="10dp">
<TableRow android:layout_marginBottom="10dp">
<TextView
android:id="@+id/passphraseText"
android:layout_width="match_parent"
@ -23,7 +22,7 @@
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/passphrase"
android:layout_weight="1"/>
android:layout_weight="1" />
</TableRow>
<View
@ -32,26 +31,29 @@
android:background="?android:attr/listDivider" />
<TableRow>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/passphrase"/>
android:text="@string/passphrase" />
<EditText
android:id="@+id/passphrase"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:padding="8dp"
android:layout_weight="6"/>
android:layout_weight="6" />
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
<TextView
android:id="@+id/passphraseTextAgain"
android:layout_width="wrap_content"
@ -59,7 +61,8 @@
android:padding="8dp"
android:text="@string/passphrase_again"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_weight="1"/>
android:layout_weight="1" />
<EditText
android:id="@+id/passphraseAgain"
android:layout_width="match_parent"
@ -67,10 +70,11 @@
android:inputType="textPassword"
android:imeOptions="actionDone"
android:padding="8dp"
android:layout_weight="6"/>
android:layout_weight="6" />
</TableRow>
</TableLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dip"
@ -80,28 +84,32 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:onClick="cancel"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
style="?attr/alp_42447968_button_bar_button_style"/>
<View
android:layout_width="1dip"
android:layout_height="50dip"
android:background="?android:attr/listDivider" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ok"
android:onClick="savePassphrase"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
style="?attr/alp_42447968_button_bar_button_style"/>
<!--<Button-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="Cancel"-->
<!--android:onClick="cancel"-->
<!--android:layout_weight="1"-->
<!--android:textAppearance="?android:attr/textAppearanceMedium"-->
<!--style="?attr/alp_42447968_button_bar_button_style" />-->
<!--<View-->
<!--android:layout_width="1dip"-->
<!--android:layout_height="50dip"-->
<!--android:background="?android:attr/listDivider" />-->
<!--<Button-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="Ok"-->
<!--android:onClick="savePassphrase"-->
<!--android:layout_weight="1"-->
<!--android:textAppearance="?android:attr/textAppearanceMedium"-->
<!--style="?attr/alp_42447968_button_bar_button_style" />-->
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dip"