mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 13:57:47 +00:00
some refactoring and improved the creation so that it happens on the visible dir
This commit is contained in:
11
.idea/libraries/support_v4_19_1_0.xml
generated
11
.idea/libraries/support_v4_19_1_0.xml
generated
@@ -1,11 +0,0 @@
|
|||||||
<component name="libraryTable">
|
|
||||||
<library name="support-v4-19.1.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/19.1.0/support-v4-19.1.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar:///opt/android-sdk/extras/android/m2repository/com/android/support/support-v4/19.1.0/support-v4-19.1.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
@@ -63,7 +63,6 @@
|
|||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" exported="" name="JavaEWAH-0.7.9" level="project" />
|
<orderEntry type="library" exported="" name="JavaEWAH-0.7.9" level="project" />
|
||||||
<orderEntry type="library" exported="" name="jsch-0.1.50" level="project" />
|
<orderEntry type="library" exported="" name="jsch-0.1.50" level="project" />
|
||||||
<orderEntry type="library" exported="" name="support-v4-19.1.0" level="project" />
|
|
||||||
<orderEntry type="library" exported="" name="commons-io-1.3.2" level="project" />
|
<orderEntry type="library" exported="" name="commons-io-1.3.2" level="project" />
|
||||||
<orderEntry type="library" exported="" name="org.eclipse.jgit-3.4.1.201406201815-r" level="project" />
|
<orderEntry type="library" exported="" name="org.eclipse.jgit-3.4.1.201406201815-r" level="project" />
|
||||||
<orderEntry type="module" module-name="openpgp-api-lib" exported="" />
|
<orderEntry type="module" module-name="openpgp-api-lib" exported="" />
|
||||||
|
@@ -24,6 +24,4 @@ dependencies {
|
|||||||
compile project(':libraries:openpgp-api-lib')
|
compile project(':libraries:openpgp-api-lib')
|
||||||
compile 'org.eclipse.jgit:org.eclipse.jgit:3.4.+'
|
compile 'org.eclipse.jgit:org.eclipse.jgit:3.4.+'
|
||||||
compile 'org.apache.commons:commons-io:1.3.2'
|
compile 'org.apache.commons:commons-io:1.3.2'
|
||||||
// You must install or update the Support Repository through the SDK manager to use this dependency.
|
|
||||||
compile 'com.android.support:support-v4:19.+'
|
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ import android.content.Intent;
|
|||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -53,7 +54,6 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
this.leftActivity = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,11 +88,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.referesh:
|
case R.id.referesh:
|
||||||
PasswordFragment plist;
|
refreshListAdapter();
|
||||||
if (null !=
|
|
||||||
(plist = (PasswordFragment) getFragmentManager().findFragmentByTag("PasswordsList"))) {
|
|
||||||
plist.updateAdapter();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
@@ -122,15 +118,17 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkLocalRepository(File localDir) {
|
private void checkLocalRepository(File localDir) {
|
||||||
// if we are coming back from gpg do not anything
|
|
||||||
if (this.leftActivity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int status = 0;
|
|
||||||
|
|
||||||
FragmentManager fragmentManager = getFragmentManager();
|
FragmentManager fragmentManager = getFragmentManager();
|
||||||
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
|
||||||
|
|
||||||
|
// if we are coming back from gpg do not anything
|
||||||
|
if (this.leftActivity) {
|
||||||
|
this.leftActivity = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int status = 0;
|
||||||
|
|
||||||
if (localDir.exists()) {
|
if (localDir.exists()) {
|
||||||
File[] folders = localDir.listFiles();
|
File[] folders = localDir.listFiles();
|
||||||
status = folders.length;
|
status = folders.length;
|
||||||
@@ -166,7 +164,6 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.leftActivity = false;
|
this.leftActivity = false;
|
||||||
this.currentDir = localDir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Stack the positions the different fragments were at */
|
/** Stack the positions the different fragments were at */
|
||||||
@@ -205,7 +202,8 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void createPassword(View v) {
|
public void createPassword(View v) {
|
||||||
System.out.println("Adding file to : " + this.currentDir.getAbsolutePath());
|
this.currentDir = new File(((PasswordFragment) getFragmentManager().findFragmentByTag("PasswordsList")).getArguments().getString("Path"));
|
||||||
|
Log.i("PWDSTR", "Adding file to : " + this.currentDir.getAbsolutePath());
|
||||||
this.leftActivity = true;
|
this.leftActivity = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -220,10 +218,18 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void refreshListAdapter() {
|
||||||
|
PasswordFragment plist;
|
||||||
|
if (null !=
|
||||||
|
(plist = (PasswordFragment) getFragmentManager().findFragmentByTag("PasswordsList"))) {
|
||||||
|
plist.updateAdapter();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode,
|
protected void onActivityResult(int requestCode, int resultCode,
|
||||||
Intent data) {
|
Intent data) {
|
||||||
System.out.println(resultCode);
|
if (resultCode == RESULT_OK) {
|
||||||
if (resultCode == RESULT_OK)
|
refreshListAdapter();
|
||||||
checkLocalRepository(this.currentDir);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user