|
@ -0,0 +1,51 @@
|
|||
package com.zeapo.pwdstore;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||
|
||||
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
|
||||
|
||||
private Drawable mDivider;
|
||||
|
||||
/**
|
||||
* Default divider will be used
|
||||
*/
|
||||
public DividerItemDecoration(Context context) {
|
||||
final TypedArray styledAttributes = context.obtainStyledAttributes(ATTRS);
|
||||
mDivider = styledAttributes.getDrawable(0);
|
||||
styledAttributes.recycle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom divider will be used
|
||||
*/
|
||||
public DividerItemDecoration(Context context, int resId) {
|
||||
mDivider = ContextCompat.getDrawable(context, resId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
int left = parent.getPaddingLeft();
|
||||
int right = parent.getWidth() - parent.getPaddingRight();
|
||||
|
||||
int childCount = parent.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
View child = parent.getChildAt(i);
|
||||
|
||||
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||
|
||||
int top = child.getBottom() + params.bottomMargin;
|
||||
int bottom = top + mDivider.getIntrinsicHeight();
|
||||
|
||||
mDivider.setBounds(left, top, right, bottom);
|
||||
mDivider.draw(c);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -74,8 +74,11 @@ public class PasswordFragment extends Fragment{
|
|||
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.pass_recycler);
|
||||
recyclerView.setLayoutManager(mLayoutManager);
|
||||
//
|
||||
// // Set the adapter
|
||||
|
||||
// use divider
|
||||
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), R.drawable.divider));
|
||||
|
||||
// Set the adapter
|
||||
recyclerView.setAdapter(recyclerAdapter);
|
||||
|
||||
final FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.fab);
|
||||
|
|
|
@ -156,7 +156,7 @@ public class UserPreference extends AppCompatActivity {
|
|||
});
|
||||
|
||||
final Preference externalRepo = findPreference("pref_select_external");
|
||||
externalRepo.setSummary(getPreferenceManager().getSharedPreferences().getString("git_external_repo", "No external repository selected"));
|
||||
externalRepo.setSummary(getPreferenceManager().getSharedPreferences().getString("git_external_repo", callingActivity.getString(R.string.no_repo_selected)));
|
||||
externalRepo.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
|
@ -217,7 +217,7 @@ public class UserPreference extends AppCompatActivity {
|
|||
public void onStart() {
|
||||
super.onStart();
|
||||
final SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();
|
||||
findPreference("pref_select_external").setSummary(getPreferenceManager().getSharedPreferences().getString("git_external_repo", "No external repository selected"));
|
||||
findPreference("pref_select_external").setSummary(getPreferenceManager().getSharedPreferences().getString("git_external_repo", getString(R.string.no_repo_selected)));
|
||||
findPreference("ssh_see_key").setEnabled(sharedPreferences.getBoolean("use_generated_key", false));
|
||||
findPreference("git_delete_repo").setEnabled(!sharedPreferences.getBoolean("git_external", false));
|
||||
Preference keyPref = findPreference("openpgp_key_id_pref");
|
||||
|
|
|
@ -81,6 +81,10 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||
this.activity = this;
|
||||
this.clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||
|
||||
if (getIntent().getStringExtra("Operation").equals("ENCRYPT")) {
|
||||
setTitle("New password");
|
||||
}
|
||||
|
||||
// some persistance
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String providerPackageName = settings.getString("openpgp_provider_list", "");
|
||||
|
@ -121,7 +125,11 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.pgp_handler, menu);
|
||||
if (getIntent().getStringExtra("Operation").equals("ENCRYPT")) {
|
||||
getMenuInflater().inflate(R.menu.pgp_handler_new_password, menu);
|
||||
} else {
|
||||
getMenuInflater().inflate(R.menu.pgp_handler, menu);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -141,6 +149,13 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||
break;
|
||||
case R.id.edit_password:
|
||||
editPassword();
|
||||
case R.id.crypto_confirm_add:
|
||||
encrypt(new Intent());
|
||||
break;
|
||||
case R.id.crypto_cancel_add:
|
||||
setResult(RESULT_CANCELED);
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
@ -205,12 +220,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||
case R.id.crypto_show_button:
|
||||
decryptAndVerify(new Intent());
|
||||
break;
|
||||
case R.id.crypto_confirm_add:
|
||||
encrypt(new Intent());
|
||||
break;
|
||||
case R.id.crypto_cancel_add:
|
||||
finish();
|
||||
break;
|
||||
case R.id.crypto_delete_button:
|
||||
// deletePassword();
|
||||
break;
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
package com.zeapo.pwdstore.utils;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.support.v7.view.ActionMode;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.zeapo.pwdstore.PasswordFragment;
|
||||
|
@ -33,16 +35,16 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter<PasswordRecycl
|
|||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
// each data item is just a string in this case
|
||||
public View view;
|
||||
public CardView card;
|
||||
public TextView name;
|
||||
public TextView type;
|
||||
public ImageView typeImage;
|
||||
|
||||
public ViewHolder(View v) {
|
||||
super(v);
|
||||
view = v;
|
||||
card = (CardView) view.findViewById(R.id.password_card);
|
||||
name = (TextView) view.findViewById(R.id.label);
|
||||
type = (TextView) view.findViewById(R.id.type);
|
||||
typeImage = (ImageView) view.findViewById(R.id.type_image);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,21 +71,28 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter<PasswordRecycl
|
|||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
final PasswordItem pass = values.get(position);
|
||||
holder.name.setText(pass.toString());
|
||||
int sdk = android.os.Build.VERSION.SDK_INT;
|
||||
|
||||
if (pass.getType() == PasswordItem.TYPE_CATEGORY) {
|
||||
holder.type.setText(pass.getFullPathName());
|
||||
holder.card.setCardBackgroundColor(activity.getResources().getColor(R.color.deep_orange_400));
|
||||
holder.typeImage.setImageResource(R.drawable.ic_folder_grey600_24dp);
|
||||
holder.name.setText(pass.toString() + "/");
|
||||
} else {
|
||||
holder.type.setText(pass.getFullPathName());
|
||||
holder.card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_400));
|
||||
holder.typeImage.setImageResource(R.drawable.ic_action_secure);
|
||||
holder.name.setText(pass.toString());
|
||||
}
|
||||
int sdk = Build.VERSION.SDK_INT;
|
||||
|
||||
holder.type.setText(pass.getFullPathName());
|
||||
if (pass.getType() == PasswordItem.TYPE_CATEGORY) {
|
||||
// holder.card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_200));
|
||||
} else {
|
||||
// holder.card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_50));
|
||||
}
|
||||
|
||||
holder.view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mActionMode != null) {
|
||||
toggleSelection(holder.getAdapterPosition(), holder.card, pass.getType());
|
||||
toggleSelection(holder.getAdapterPosition());
|
||||
mActionMode.setTitle("" + selectedItems.size());
|
||||
if (selectedItems.isEmpty()) {
|
||||
mActionMode.finish();
|
||||
} else if (selectedItems.size() == 1 && !canEdit) {
|
||||
|
@ -98,6 +107,7 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter<PasswordRecycl
|
|||
} else {
|
||||
listener.onFragmentInteraction(pass);
|
||||
}
|
||||
notifyItemChanged(holder.getAdapterPosition());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -107,17 +117,27 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter<PasswordRecycl
|
|||
if (mActionMode != null) {
|
||||
return false;
|
||||
}
|
||||
toggleSelection(holder.getAdapterPosition(), holder.card, pass.getType());
|
||||
toggleSelection(holder.getAdapterPosition());
|
||||
canEdit = pass.getType() == PasswordItem.TYPE_PASSWORD;
|
||||
// Start the CAB using the ActionMode.Callback
|
||||
mActionMode = activity.startSupportActionMode(mActionModeCallback);
|
||||
mActionMode.setTitle("" + selectedItems.size());
|
||||
mActionMode.invalidate();
|
||||
notifyItemChanged(holder.getAdapterPosition());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// after removal, everything is rebound for some reason; views are shuffled?
|
||||
holder.view.setSelected(selectedItems.contains(position));
|
||||
boolean selected = selectedItems.contains(position);
|
||||
holder.view.setSelected(selected);
|
||||
if (selected) {
|
||||
holder.itemView.setBackgroundResource(R.color.deep_orange_200);
|
||||
holder.type.setTextColor(Color.BLACK);
|
||||
} else {
|
||||
holder.itemView.setBackgroundResource(Color.alpha(1));
|
||||
holder.type.setTextColor(activity.getColor(R.color.grey_500));
|
||||
}
|
||||
}
|
||||
|
||||
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {
|
||||
|
@ -205,22 +225,9 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter<PasswordRecycl
|
|||
updateSelectedItems(position, selectedItems);
|
||||
}
|
||||
|
||||
public void toggleSelection(int position, CardView card, char type) {
|
||||
public void toggleSelection(int position) {
|
||||
if (!selectedItems.remove(position)) {
|
||||
selectedItems.add(position);
|
||||
if (type == PasswordItem.TYPE_CATEGORY) {
|
||||
card.setCardBackgroundColor(activity.getResources().getColor(R.color.deep_orange_200));
|
||||
}
|
||||
else {
|
||||
card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_200));
|
||||
}
|
||||
} else {
|
||||
if (type == PasswordItem.TYPE_CATEGORY) {
|
||||
card.setCardBackgroundColor(activity.getResources().getColor(R.color.deep_orange_400));
|
||||
}
|
||||
else {
|
||||
card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_400));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 650 B |
BIN
app/src/main/res/drawable-hdpi/ic_action_secure.png
Normal file
After Width: | Height: | Size: 394 B |
BIN
app/src/main/res/drawable-hdpi/ic_add_white_48dp.png
Normal file
After Width: | Height: | Size: 97 B |
BIN
app/src/main/res/drawable-hdpi/ic_clear_white_24dp.png
Normal file
After Width: | Height: | Size: 221 B |
BIN
app/src/main/res/drawable-hdpi/ic_content_copy_white_24dp.png
Normal file
After Width: | Height: | Size: 203 B |
BIN
app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png
Normal file
After Width: | Height: | Size: 161 B |
BIN
app/src/main/res/drawable-hdpi/ic_done_white_24dp.png
Normal file
After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
BIN
app/src/main/res/drawable-hdpi/ic_folder_grey600_24dp.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
app/src/main/res/drawable-hdpi/ic_refresh_white_24dp.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
app/src/main/res/drawable-hdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 396 B |
Before Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 449 B |
BIN
app/src/main/res/drawable-mdpi/ic_action_secure.png
Normal file
After Width: | Height: | Size: 317 B |
BIN
app/src/main/res/drawable-mdpi/ic_add_white_48dp.png
Normal file
After Width: | Height: | Size: 97 B |
BIN
app/src/main/res/drawable-mdpi/ic_clear_white_24dp.png
Normal file
After Width: | Height: | Size: 175 B |
BIN
app/src/main/res/drawable-mdpi/ic_content_copy_white_24dp.png
Normal file
After Width: | Height: | Size: 134 B |
BIN
app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png
Normal file
After Width: | Height: | Size: 115 B |
BIN
app/src/main/res/drawable-mdpi/ic_done_white_24dp.png
Normal file
After Width: | Height: | Size: 139 B |
BIN
app/src/main/res/drawable-mdpi/ic_edit_white_24dp.png
Normal file
After Width: | Height: | Size: 165 B |
BIN
app/src/main/res/drawable-mdpi/ic_folder_grey600_24dp.png
Normal file
After Width: | Height: | Size: 123 B |
BIN
app/src/main/res/drawable-mdpi/ic_refresh_white_24dp.png
Normal file
After Width: | Height: | Size: 254 B |
BIN
app/src/main/res/drawable-mdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 415 B |
Before Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 895 B |
Before Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 827 B |
BIN
app/src/main/res/drawable-xhdpi/ic_action_secure.png
Normal file
After Width: | Height: | Size: 510 B |
BIN
app/src/main/res/drawable-xhdpi/ic_add_white_48dp.png
Normal file
After Width: | Height: | Size: 102 B |
BIN
app/src/main/res/drawable-xhdpi/ic_clear_white_24dp.png
Normal file
After Width: | Height: | Size: 257 B |
BIN
app/src/main/res/drawable-xhdpi/ic_content_copy_white_24dp.png
Normal file
After Width: | Height: | Size: 188 B |
BIN
app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png
Normal file
After Width: | Height: | Size: 151 B |
BIN
app/src/main/res/drawable-xhdpi/ic_done_white_24dp.png
Normal file
After Width: | Height: | Size: 199 B |
BIN
app/src/main/res/drawable-xhdpi/ic_edit_white_24dp.png
Normal file
After Width: | Height: | Size: 239 B |
BIN
app/src/main/res/drawable-xhdpi/ic_folder_grey600_24dp.png
Normal file
After Width: | Height: | Size: 194 B |
BIN
app/src/main/res/drawable-xhdpi/ic_refresh_white_24dp.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
app/src/main/res/drawable-xhdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 465 B |
Before Width: | Height: | Size: 619 B |
Before Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 304 B |
Before Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 495 B |
Before Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_action_secure.png
Normal file
After Width: | Height: | Size: 624 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_add_white_48dp.png
Normal file
After Width: | Height: | Size: 113 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_clear_white_24dp.png
Normal file
After Width: | Height: | Size: 347 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_content_copy_white_24dp.png
Normal file
After Width: | Height: | Size: 266 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png
Normal file
After Width: | Height: | Size: 194 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_done_white_24dp.png
Normal file
After Width: | Height: | Size: 255 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_edit_white_24dp.png
Normal file
After Width: | Height: | Size: 302 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_folder_grey600_24dp.png
Normal file
After Width: | Height: | Size: 259 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_refresh_white_24dp.png
Normal file
After Width: | Height: | Size: 734 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 728 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_add_white_48dp.png
Normal file
After Width: | Height: | Size: 116 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_clear_white_24dp.png
Normal file
After Width: | Height: | Size: 436 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_content_copy_white_24dp.png
Normal file
After Width: | Height: | Size: 329 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_done_white_24dp.png
Normal file
After Width: | Height: | Size: 308 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_edit_white_24dp.png
Normal file
After Width: | Height: | Size: 355 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_refresh_white_24dp.png
Normal file
After Width: | Height: | Size: 967 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_search_white_24dp.png
Normal file
After Width: | Height: | Size: 915 B |
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle" android:dither="true">
|
||||
<corners android:topLeftRadius="2dp" android:bottomLeftRadius="2dp"/>
|
||||
<solid android:color="@color/deep_orange_500" />
|
||||
|
||||
<padding android:bottom="16dp"
|
||||
android:left="16dp"
|
||||
android:right="16dp"
|
||||
android:top="16dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
6
app/src/main/res/drawable/divider.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<size android:height="1dp" />
|
||||
<solid android:color="@color/grey_300" />
|
||||
</shape>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle"
|
||||
android:dither="true">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#ccc" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:bottom="2dp">
|
||||
<shape android:shape="rectangle" android:dither="true">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@android:color/darker_gray" />
|
||||
|
||||
<padding android:bottom="8dp"
|
||||
android:left="8dp"
|
||||
android:right="8dp"
|
||||
android:top="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item>
|
||||
<shape android:shape="oval" android:dither="true">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#eee" />
|
||||
<gradient
|
||||
android:startColor="#aaa"
|
||||
android:centerColor="#aaa"
|
||||
android:endColor="@android:color/transparent"
|
||||
android:gradientRadius="55"
|
||||
android:type="radial"
|
||||
/>
|
||||
|
||||
<padding android:bottom="5dp"
|
||||
android:left="5dp"
|
||||
android:right="5dp"
|
||||
android:top="5dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape android:shape="oval" android:dither="true">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<padding android:bottom="8dp"
|
||||
android:left="8dp"
|
||||
android:right="8dp"
|
||||
android:top="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
|
||||
</layer-list>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle" android:dither="true">
|
||||
<corners android:topLeftRadius="2dp" android:bottomLeftRadius="2dp"/>
|
||||
<solid android:color="@color/blue_grey_500" />
|
||||
|
||||
<padding android:bottom="16dp"
|
||||
android:left="16dp"
|
||||
android:right="16dp"
|
||||
android:top="16dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:drawable="@drawable/selected_rectangle" />
|
||||
<item android:drawable="@drawable/rectangle" />
|
||||
</selector>
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle"
|
||||
android:dither="true">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="@color/blue_grey_200" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:bottom="2dp" android:left="1dp" android:right="1dp">
|
||||
<shape android:shape="rectangle" android:dither="true">
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="@color/blue_grey_100" />
|
||||
|
||||
<padding android:bottom="2dp" android:left="1dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -13,7 +13,6 @@
|
|||
<GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rectangle"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:src="@drawable/ic_action_new"
|
||||
android:src="@drawable/ic_add_white_48dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
|
|
|
@ -10,35 +10,44 @@
|
|||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rectangle"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/holo_blue_light"
|
||||
android:textColor="@color/grey_500"
|
||||
android:text="CATEGORY HERE"
|
||||
android:id="@+id/crypto_password_category"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"/>
|
||||
android:textSize="18dp"
|
||||
android:textIsSelectable="false"
|
||||
android:layout_marginLeft="16dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/holo_orange_dark"
|
||||
android:textColor="@color/accent"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:text="PASSWORD FILE NAME HERE"
|
||||
android:id="@+id/crypto_password_file"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"/>
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
||||
android:textSize="24dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/divider"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -61,12 +70,7 @@
|
|||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rectangle"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:visibility="invisible">
|
||||
|
||||
<GridLayout
|
||||
|
|
|
@ -5,25 +5,24 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="com.zeapo.pwdstore.crypto.PgpHandler"
|
||||
android:background="#eee">
|
||||
android:background="#eee"
|
||||
android:padding="@dimen/activity_horizontal_margin">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/rectangle"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/crypto_password_category"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/holo_blue_dark"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:text="CATEGORY/"/>
|
||||
android:textColor="@color/grey_500"
|
||||
android:text="CATEGORY HERE"
|
||||
android:id="@+id/crypto_password_category"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textSize="18dp"
|
||||
android:textIsSelectable="false"
|
||||
android:layout_marginLeft="@dimen/activity_horizontal_margin" />
|
||||
|
||||
<EditText
|
||||
android:layout_gravity="center_vertical"
|
||||
|
@ -31,27 +30,24 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:id="@+id/crypto_password_file_edit"
|
||||
android:hint="@string/crypto_name_hint"
|
||||
android:textColor="@android:color/holo_orange_dark"/>
|
||||
|
||||
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
|
||||
android:textSize="24dp"
|
||||
android:textColor="@color/accent" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<ScrollView android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||
android:background="@drawable/rectangle"
|
||||
android:layout_weight="1">
|
||||
<LinearLayout
|
||||
android:id="@+id/crypto_container"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
@ -59,20 +55,29 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/crypto_pass_label"/>
|
||||
<EditText
|
||||
android:id="@+id/crypto_password_edit"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:typeface="monospace"
|
||||
android:layout_weight="1"/>
|
||||
<Button
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/generate_password"
|
||||
android:text="@string/pwd_generate_button"
|
||||
android:onClick="handleClick"/>
|
||||
</LinearLayout>
|
||||
android:text="@string/crypto_pass_label"
|
||||
android:id="@+id/textView2"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/crypto_password_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:typeface="monospace"
|
||||
android:layout_weight="1"
|
||||
android:layout_toRightOf="@+id/textView2"
|
||||
android:layout_toEndOf="@+id/textView2" />
|
||||
|
||||
<Button
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/generate_password"
|
||||
android:text="@string/pwd_generate_button"
|
||||
android:onClick="handleClick"
|
||||
android:layout_gravity="right" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -92,37 +97,4 @@
|
|||
|
||||
</ScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:layout_weight="0">
|
||||
<ImageButton
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/ic_action_save"
|
||||
android:background="@drawable/blue_rectangle"
|
||||
android:id="@+id/crypto_confirm_add"
|
||||
android:onClick="handleClick"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
<ImageButton
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/ic_action_cancel"
|
||||
android:background="@drawable/red_rectangle"
|
||||
android:id="@+id/crypto_cancel_add"
|
||||
android:onClick="handleClick"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -11,21 +11,17 @@
|
|||
android:id="@+id/pass_recycler"
|
||||
android:scrollbars="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"/>
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:src="@drawable/ic_action_new"
|
||||
android:src="@drawable/ic_add_white_48dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
app:elevation="6dp"
|
||||
app:pressedTranslationZ="12dp"
|
||||
app:backgroundTint="@color/blue_grey_500"
|
||||
app:backgroundTint="@color/accent"
|
||||
app:rippleColor="@color/blue_grey_50"
|
||||
app:borderWidth="0dp"
|
||||
android:layout_margin="@dimen/fab_compat_margin"
|
||||
|
|
|
@ -1,40 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="4dp">
|
||||
android:background="?android:attr/activatedBackgroundIndicator">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/password_card"
|
||||
android:layout_gravity="center"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
card_view:contentPaddingTop="4dp"
|
||||
card_view:contentPaddingLeft="4dp"
|
||||
card_view:cardCornerRadius="4dp"
|
||||
card_view:cardElevation="3dp"
|
||||
card_view:cardBackgroundColor="@color/light_blue_50">
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:gravity="left">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="32dp"
|
||||
android:id="@+id/type_image"
|
||||
android:src="@drawable/ic_folder_grey600_24dp"
|
||||
android:alpha="0.5"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:paddingRight="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/type"
|
||||
android:text="TYPE"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="italic"
|
||||
android:maxLines="1" />
|
||||
android:maxLines="1"
|
||||
android:ellipsize="start"
|
||||
android:text="TYPE"
|
||||
android:textSize="14dp"
|
||||
android:textColor="@color/grey_500"
|
||||
android:layout_alignTop="@+id/type_image"
|
||||
android:layout_toRightOf="@+id/type_image"
|
||||
android:layout_toEndOf="@+id/type_image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/label"
|
||||
android:text="FILE_NAME"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:padding="8dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold" />
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
android:text="FILE_NAME"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18dp"
|
||||
android:layout_below="@+id/type"
|
||||
android:layout_alignLeft="@+id/type"
|
||||
android:layout_alignStart="@+id/type" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -4,7 +4,7 @@
|
|||
tools:context=".pwdstore.autofill.AutofillPreferenceActivity">
|
||||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:icon="@drawable/ic_action_search"
|
||||
android:icon="@drawable/ic_search_white_24dp"
|
||||
android:title="@string/action_search"
|
||||
pwstore:actionViewClass="android.support.v7.widget.SearchView"
|
||||
pwstore:showAsAction="ifRoom|collapseActionView"/>
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
tools:context=".pwdstore">
|
||||
|
||||
<item android:id="@+id/menu_edit_password"
|
||||
android:icon="@drawable/ic_action_edit"
|
||||
android:icon="@drawable/ic_edit_white_24dp"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="Edit"/>
|
||||
|
||||
<item android:id="@+id/menu_delete_password"
|
||||
android:icon="@drawable/ic_action_discard"
|
||||
android:icon="@drawable/ic_delete_white_24dp"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="Delete"/>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<item android:id="@+id/action_search"
|
||||
android:title="@string/action_search"
|
||||
android:icon="@drawable/ic_action_search"
|
||||
android:icon="@drawable/ic_search_white_24dp"
|
||||
pwstore:showAsAction="ifRoom|collapseActionView"
|
||||
pwstore:actionViewClass="android.support.v7.widget.SearchView" />
|
||||
|
||||
|
@ -20,12 +20,12 @@
|
|||
android:title="@string/git_push"/>
|
||||
|
||||
<item android:id="@+id/refresh"
|
||||
android:title="Refresh list"
|
||||
android:title="@string/refresh_list"
|
||||
pwstore:showAsAction="never"
|
||||
android:icon="@drawable/ic_action_refresh"/>
|
||||
android:icon="@drawable/ic_refresh_white_24dp"/>
|
||||
|
||||
<item android:id="@+id/user_pref"
|
||||
android:title="Settings"
|
||||
android:title="@string/action_settings"
|
||||
android:orderInCategory="100"/>
|
||||
</menu>
|
||||
|
||||
|
|