Add link to liberapay.com in the main drawer.

/cc #14
master
Daniele Gobbetti 2017-08-18 21:51:12 +02:00
parent b19cf85a12
commit c05e5f15ab
5 changed files with 57 additions and 2 deletions

View File

@ -22,3 +22,6 @@ Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0):
Creative Commons Attribution 3.0 Unported license (CC BY-3.0):
ic_notification_battery_low.png by Picol.org. Source: https://commons.wikimedia.org/wiki/File:Battery_1_Picol_icon.svg
Creative Commons Attribution 3.0 United States (CC BY-3.0 US):
ic_donate by Peter van Driel https://thenounproject.com/term/donate/239009/

View File

@ -25,6 +25,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
@ -61,8 +62,6 @@ import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
import static de.cketti.library.changelog.ChangeLog.DEFAULT_CSS;
//TODO: extend GBActivity, but it requires actionbar that is not available
public class ControlCenterv2 extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@ -250,6 +249,11 @@ public class ControlCenterv2 extends AppCompatActivity
case R.id.action_quit:
GBApplication.quit();
return true;
case R.id.donation_link:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/Gadgetbridge")); //TODO: centralize if ever used somewhere else
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
return true;
case R.id.external_changelog:
ChangeLog cl = createChangeLog();
cl.getFullLogDialog().show();

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<group android:scaleY="-1">
<group android:translateY="-48">
<path
android:fillColor="#000000"
android:strokeWidth="0.75"
android:strokeMiterLimit="79.8403193612775"
android:strokeLineCap="round"
android:pathData="M 17.266,14.156 C 17.266,16.557 18.748,18.614 20.847,19.466 L 20.749,19.461 C
18.032,21.925 18.249,23.288 18.202,24.301 L 18.202,24.812 C 13.398,21.976
8.006,18.283 6.316,19.973 L 5.892,20.99 C 11.546,24.893 17.202,28.796
21.852,32.704 C 22.249,33.138 22.902,33.403 23.974,33.385 C 28.907,33.336
33.583,32.949 38.07,32.451 L 43.588,34.829 L 43.417,27.782 C 38.887,23.557
32.161,21.394 27.091,18.166 C 28.105,17.132 28.732,15.715 28.732,14.156 C
28.732,10.992 26.164,8.423 22.998,8.423 C 19.835,8.423 17.266,10.992
17.266,14.156 Z M 27.246,14.156 C 27.246,16.496 25.341,18.399 22.998,18.399 C
20.655,18.399 18.752,16.496 18.752,14.156 C 18.752,11.813 20.655,9.911
22.998,9.911 C 25.341,9.911 27.246,11.813 27.246,14.156 Z M 21.197,11.848 C
20.842,12.223 20.608,12.689 20.497,13.249 L 19.885,13.249 L 20.018,13.888 L
20.423,13.888 C 20.42,13.954 20.415,14.027 20.415,14.101 C 20.415,14.229
20.42,14.338 20.426,14.434 L 19.885,14.434 L 20.018,15.075 L 20.509,15.075 C
20.625,15.625 20.854,16.084 21.198,16.452 C 21.721,17.009 22.403,17.285
23.253,17.285 C 23.716,17.285 24.118,17.202 24.458,17.036 L 24.216,15.889 C
23.98,16.124 23.64,16.24 23.19,16.24 C 22.74,16.24 22.378,16.079 22.101,15.756 C
21.943,15.576 21.832,15.347 21.766,15.075 L 24.04,15.075 L 23.905,14.434 L
21.683,14.434 C 21.68,14.373 21.679,14.291 21.679,14.192 C 21.679,14.096
21.68,13.994 21.686,13.888 L 23.791,13.888 L 23.659,13.249 L 21.772,13.249 C
21.842,12.953 21.946,12.721 22.093,12.556 C 22.367,12.23 22.728,12.067
23.166,12.067 C 23.694,12.067 24.117,12.23 24.431,12.556 L 24.431,11.29 C
24.073,11.11 23.656,11.021 23.179,11.021 C 22.375,11.021 21.713,11.298
21.197,11.848 Z M 29.494,23.708 C 30.203,25.42 30.088,27.919 24.739,26.679 C
21.778,25.437 21.126,24.068 22.192,22.603 C 22.787,21.692 23.124,20.787
23.329,19.878 C 23.931,19.843 24.507,19.716 25.047,19.508 C 26.476,21.08
28.884,22.241 29.494,23.708 Z" />
</group>
</group>
</vector>

View File

@ -21,6 +21,10 @@
<group
android:checkableBehavior="single"
android:id="@+id/further_options">
<item
android:id="@+id/donation_link"
android:title="@string/action_donate"
android:icon="@drawable/ic_donate" />
<item
android:id="@+id/external_changelog"
android:title="@string/changelog_full_title" />

View File

@ -6,6 +6,7 @@
<string name="action_settings">Settings</string>
<string name="action_debug">Debug</string>
<string name="action_quit">Quit</string>
<string name="action_donate">Donate</string>
<string name="controlcenter_fetch_activity_data">Synchronize</string>
<string name="controlcenter_start_sleepmonitor">Sleep Monitor (ALPHA)</string>
<string name="controlcenter_find_device">Find lost Device…</string>