1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-23 16:18:50 -05:00

Change appearance of unread widget

* New icon
* Fix 2x2 bug on Nexus 4
* Add preview image
This commit is contained in:
cketti 2013-03-16 01:15:33 +01:00
parent 520801f03d
commit 6b6f73dfd3
19 changed files with 319 additions and 20 deletions

View File

@ -0,0 +1,110 @@
<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="38"
id="svg3870"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="ic_unread_widget.svg">
<defs
id="defs3872">
<filter
inkscape:collect="always"
id="filter4805"
x="-0.083621454"
width="1.1672429"
y="-0.21568472"
height="1.4313694">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.53306"
id="feGaussianBlur4807" />
</filter>
<filter
inkscape:collect="always"
id="filter4809"
x="-0.083621454"
width="1.1672429"
y="-0.15985958"
height="1.3197192">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.53306"
id="feGaussianBlur4811" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.9195959"
inkscape:cx="63.783801"
inkscape:cy="9.0204493"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1138"
inkscape:window-x="1592"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata3875">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1014.3622)">
<g
id="g5353">
<path
transform="matrix(0.89636602,0,0,0.89636602,2.4872183,107.09144)"
d="m 1.9999969,1026.6726 0,23.0161 44.0000001,0 0,-23.0161 -22.000665,10.9382 -21.9993351,-10.9382 z"
style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;filter:url(#filter4809)"
id="path1198"
inkscape:connector-curvature="0" />
<path
transform="matrix(0.89636602,0,0,0.89636602,2.4872183,107.09144)"
d="m 1.9999969,1017.0357 0,6.1241 21.9993351,10.9348 22.000665,-10.9348 0,-6.1241 -44.0000001,0 z"
style="fill:#4d4d4d;fill-opacity:1;fill-rule:evenodd;stroke:none;filter:url(#filter4805)"
id="path1202"
inkscape:connector-curvature="0" />
<g
transform="matrix(0.89636602,0,0,0.89636602,-52.511912,113.82897)"
id="g4763">
<path
inkscape:connector-curvature="0"
id="path1198-3"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 63.35789,1019.1561 0,23.0161 44,0 0,-23.0161 -22.000664,10.9382 -21.999336,-10.9382 z" />
<path
inkscape:connector-curvature="0"
id="path1202-1"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 63.35789,1009.5192 0,6.1241 21.999336,10.9348 22.000664,-10.9348 0,-6.1241 -44,0 z" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,97 @@
<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="38"
id="svg3870"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="ic_unread_widget_selected.svg">
<defs
id="defs3872">
<filter
inkscape:collect="always"
id="filter3775"
x="-0.041810727"
width="1.0836215"
y="-0.10784236"
height="1.2156847">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.76653"
id="feGaussianBlur3777" />
</filter>
<filter
inkscape:collect="always"
id="filter3779">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.76653"
id="feGaussianBlur3781" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="15.839192"
inkscape:cx="29.198815"
inkscape:cy="15.550022"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1138"
inkscape:window-x="1592"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata3875">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1014.3622)">
<path
inkscape:connector-curvature="0"
id="path1198-3-7"
style="fill:none;stroke:#33b5e5;stroke-width:4;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 4.2799479,1027.3659 0,20.6308 39.4401051,0 0,-20.6308 -19.720648,9.8046 -19.7194571,-9.8046 z" />
<path
inkscape:connector-curvature="0"
id="path1202-1-1"
style="fill:none;fill-opacity:0;fill-rule:evenodd;stroke:#33b5e5;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 4.2799477,1018.7277 0,5.4894 19.7194573,9.8016 19.720648,-9.8016 0,-5.4894 -39.4401053,0 z" />
<path
inkscape:connector-curvature="0"
id="path1198-3"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 4.2799477,1027.3659 0,20.6308 39.4401053,0 0,-20.6308 -19.720648,9.8046 -19.7194573,-9.8046 z" />
<path
inkscape:connector-curvature="0"
id="path1202-1"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
d="m 4.2799477,1018.7277 0,5.4894 19.7194573,9.8016 19.720648,-9.8016 0,-5.4894 -39.4401053,0 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_unread_widget_selected" android:state_pressed="true" />
<item android:drawable="@drawable/ic_unread_widget_selected" android:state_focused="true" />
<item android:drawable="@drawable/ic_unread_widget_selected" android:state_selected="true" />
<item android:drawable="@drawable/ic_unread_widget" />
</selector>

View File

@ -1,30 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/UnreadWidgetContainer"
android:id="@+id/unread_widget_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:background="@drawable/unread_widget_background"
android:gravity="bottom|center_horizontal">
android:focusable="true">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@drawable/icon" />
android:src="@drawable/unread_widget_icon" />
<TextView
android:id="@+id/unread_count"
android:visibility="gone"
android:textSize="10dp"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
@ -38,10 +36,10 @@
</FrameLayout>
<TextView
style="@style/UnreadWidgetTextView"
android:id="@+id/account_name"
android:text="@string/app_name"
android:ellipsize="marquee"
android:textSize="12dp"
android:singleLine="true"
android:paddingTop="1dp"
android:paddingBottom="1dp"
@ -50,10 +48,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:background="@drawable/rounded_corners"
android:textColor="#ffffff"
android:shadowColor="#000000"
android:shadowRadius="2.0"/>
android:layout_marginTop="3dp" />
</LinearLayout>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="UnreadWidgetContainer">
<item name="android:paddingTop">2dp</item>
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingRight">2dp</item>
<item name="android:paddingBottom">0dp</item>
<item name="android:background">@drawable/unread_widget_background</item>
<item name="android:gravity">bottom|center_horizontal</item>
</style>
<style name="UnreadWidgetTextView">
<item name="android:textSize">13dp</item>
<item name="android:background">@drawable/rounded_corners</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowRadius">2.0</item>
<item name="android:layout_marginBottom">0dp</item>
</style>
</resources>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="UnreadWidgetTextView">
<item name="android:textSize">12sp</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">4.0</item>
<item name="android:paddingBottom">0dp</item>
</style>
</resources>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="UnreadWidgetContainer">
<item name="android:background">@null</item>
<item name="android:paddingTop">0dp</item>
<item name="android:paddingLeft">0dp</item>
<item name="android:paddingRight">0dp</item>
<item name="android:paddingBottom">0dp</item>
<item name="android:gravity">bottom|center_horizontal</item>
</style>
<style name="UnreadWidgetTextView">
<item name="android:textSize">13sp</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">4.0</item>
</style>
</resources>

View File

@ -1,9 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="TextAppearance.StatusBar.EventContent.Emphasized" parent="@android:style/TextAppearance.StatusBar.EventContent">
<item name="android:textColor">#cccccc</item>
</style>
</resources>
<style name="UnreadWidgetContainer">
<item name="android:paddingTop">0dp</item>
<item name="android:paddingLeft">0dp</item>
<item name="android:paddingRight">0dp</item>
<item name="android:paddingBottom">0dp</item>
<item name="android:background">@null</item>
<item name="android:gravity">center</item>
</style>
<style name="UnreadWidgetTextView">
<item name="android:textSize">12sp</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowDy">1</item>
<item name="android:shadowRadius">4.0</item>
</style>
</resources>

View File

@ -21,5 +21,23 @@
<style name="TextAppearance.StatusBar.EventContent.Emphasized" parent="@android:style/TextAppearance.StatusBar.EventContent">
<item name="android:textStyle">bold</item>
</style>
<style name="UnreadWidgetContainer">
<item name="android:paddingTop">2dp</item>
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingRight">2dp</item>
<item name="android:paddingBottom">8.5dp</item>
<item name="android:background">@drawable/unread_widget_background</item>
<item name="android:gravity">bottom|center_horizontal</item>
</style>
<style name="UnreadWidgetTextView">
<item name="android:textSize">13dp</item>
<item name="android:background">@drawable/rounded_corners</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>
<item name="android:shadowRadius">2.0</item>
</style>
</resources>

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/unread_widget_layout"
android:minHeight="72dp"
android:minWidth="72dp"
android:previewImage="@drawable/preview_unread_widget"
android:minHeight="60dp"
android:minWidth="60dp"
android:configure="com.fsck.k9.activity.UnreadWidgetConfiguration"
android:updatePeriodMillis="0">
</appwidget-provider>