Rebuild classic icons (Add apple icon and remove numbers)

This commit is contained in:
J-Jamet 2018-04-07 15:41:52 +02:00
parent 9cb4d28ad8
commit aded8fab0a
7 changed files with 167 additions and 56 deletions

View file

@ -21,7 +21,6 @@ package com.kunzisoft.keepass.dialogs;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
@ -29,12 +28,9 @@ import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;
import com.kunzisoft.keepass.R;
import com.kunzisoft.keepass.icons.Icons;
@ -75,47 +71,39 @@ public class IconPickerDialogFragment extends DialogFragment {
View root = inflater.inflate(R.layout.icon_picker, null);
builder.setView(root);
GridView currIconGridView = (GridView) root.findViewById(R.id.IconGridView);
GridView currIconGridView = root.findViewById(R.id.IconGridView);
currIconGridView.setAdapter(new ImageAdapter(this.getContext()));
currIconGridView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Bundle bundle = new Bundle();
bundle.putInt(KEY_ICON_ID, position);
iconPickerListener.iconPicked(bundle);
dismiss();
}
});
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
IconPickerDialogFragment.this.getDialog().cancel();
}
currIconGridView.setOnItemClickListener((parent, v, position, id) -> {
Bundle bundle = new Bundle();
bundle.putInt(KEY_ICON_ID, position);
iconPickerListener.iconPicked(bundle);
dismiss();
});
builder.setNegativeButton(R.string.cancel, (dialog, id) ->
IconPickerDialogFragment.this.getDialog().cancel());
return builder.create();
}
public class ImageAdapter extends BaseAdapter {
private Context context;
public ImageAdapter(Context c) {
ImageAdapter(Context c) {
context = c;
}
public int getCount() {
public int getCount() {
/* Return number of KeePass icons */
return Icons.count();
}
public Object getItem(int position)
{
public Object getItem(int position) {
return null;
}
public long getItemId(int position)
{
public long getItemId(int position) {
return 0;
}
@ -123,15 +111,13 @@ public class IconPickerDialogFragment extends DialogFragment {
View currView;
if(convertView == null) {
LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
currView = li.inflate(R.layout.icon, parent, false);
assert li != null;
currView = li.inflate(R.layout.icon, parent, false);
}
else {
currView = convertView;
}
TextView tv = (TextView) currView.findViewById(R.id.icon_text);
tv.setText("" + position);
ImageView iv = (ImageView) currView.findViewById(R.id.icon_image);
ImageView iv = currView.findViewById(R.id.icon_image);
iv.setImageResource(Icons.iconToResId(position));
return currView;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 1 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

@ -17,27 +17,12 @@
You should have received a copy of the GNU General Public License
along with KeePass DX. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
<android.support.v7.widget.AppCompatImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/icon"
android:id="@+id/icon_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:minWidth="60dp"
android:minHeight="60dp"
android:padding="5dp">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/icon_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic99_blank">
</android.support.v7.widget.AppCompatImageView>
<android.support.v7.widget.AppCompatTextView
android:id="@+id/icon_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
style="@style/KeepassDXStyle.TextAppearance">
</android.support.v7.widget.AppCompatTextView>
</LinearLayout>
android:layout_gravity="center"
android:layout_margin="32dp"
android:src="@drawable/ic99_blank">
</android.support.v7.widget.AppCompatImageView>

View file

@ -19,11 +19,13 @@
-->
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/IconGridView"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:columnWidth="60dp"
android:verticalSpacing="32dp"
android:paddingTop="20dp"
android:gravity="center"
android:layout_gravity="center"
android:columnWidth="64dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth">
android:stretchMode="spacingWidthUniform">
</GridView>

View file

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg4830"
version="1.1"
inkscape:version="0.91 r13725"
inkscape:export-filename="/home/joker/Project/Scratcheck/TestExport.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
sodipodi:docname="ic64_classic_replacement.svg">
<defs
id="defs4832">
<linearGradient
id="linearGradient4148"
inkscape:collect="always">
<stop
id="stop4150"
offset="0"
style="stop-color:#fefefe;stop-opacity:1" />
<stop
id="stop4152"
offset="1"
style="stop-color:#b7b7b7;stop-opacity:1" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4148"
id="radialGradient4178"
cx="123.20961"
cy="31.69169"
fx="123.20961"
fy="31.69169"
r="5.061789"
gradientTransform="matrix(-0.46939348,1.1534553,-1.6669092,-0.65875753,232.55941,-95.016875)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4148"
id="linearGradient4192"
x1="122.70228"
y1="21.296877"
x2="122.70228"
y2="23.716484"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.1884484,0,0,1.1623786,-23.490346,-4.5062279)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="27.172685"
inkscape:cy="7.2801124"
inkscape:current-layer="g4770"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1920"
inkscape:window-height="1023"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<sodipodi:guide
position="3.9999947,27.999999"
orientation="24,0"
id="guide3000" />
<sodipodi:guide
position="3.9999947,3.9999989"
orientation="0,24"
id="guide3002" />
<sodipodi:guide
position="27.999995,3.9999989"
orientation="-24,0"
id="guide3004" />
<sodipodi:guide
position="27.999995,27.999999"
orientation="0,-24"
id="guide3006" />
<inkscape:grid
type="xygrid"
id="grid2990" />
</sodipodi:namedview>
<metadata
id="metadata4835">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g4770"
transform="matrix(1.7777778,0,0,1.7777778,-205.48441,-31.997877)">
<g
id="g2997" />
<path
style="fill:url(#radialGradient4178);fill-opacity:1;fill-rule:evenodd;stroke:#6f6f6f;stroke-width:0.55365163;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 124.62037,24.687632 c 0,0 1.56509,-1.221355 3.24673,-0.998084 1.41387,0.187723 2.42599,1.354844 2.65597,2.732135 0.51367,3.076372 -1.71325,6.112003 -3.05024,6.765843 -1.337,0.653837 -3.03156,-0.0523 -3.03156,-0.0523 0,0 -1.31917,0.638968 -2.54837,-0.0353 -2.59302,-1.422354 -3.63535,-4.253661 -3.02041,-7.098538 0.23048,-1.066163 1.32524,-2.110224 2.4234,-2.294208 1.58382,-0.265344 3.32448,0.980437 3.32448,0.980437 z"
id="path4166"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csszcsssc" />
<path
style="fill:#a6a6a6;fill-opacity:1;fill-rule:evenodd;stroke:#6f6f6f;stroke-width:0.55365163;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 125.10977,21.81562 c 0,0 -0.37746,0.714398 -0.45955,1.103312 -0.12333,0.584263 -0.0373,1.789392 -0.0373,1.789392 0,0 0.30552,-1.065063 0.49686,-1.585027 0.18804,-0.51099 0.63865,-1.504742 0.63865,-1.504742 z"
id="path4168"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cacacc" />
<path
style="fill:url(#linearGradient4192);fill-opacity:1.0;fill-rule:evenodd;stroke:#6f6f6f;stroke-width:0.55365163;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 119.40356,20.624724 c 0,0 0.99163,0.790528 1.54792,1.092725 1.19668,0.650083 3.80009,1.522627 3.80009,1.522627 0,0 -1.9961,-2.15342 -3.3425,-2.615352 -0.63082,-0.216425 -2.00551,0 -2.00551,0 z"
id="path4170"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscac" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB