Free as in Freedom: Codeberg.org. Create your repos and join us!
Join Donate
Browse Source

Add link to liberapay.com in the main drawer.

/cc #14
Daniele Gobbetti 1 year ago
parent
commit
c05e5f15ab

+ 3
- 0
LICENSE.artwork View File

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

+ 6
- 2
app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/ControlCenterv2.java View File

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

+ 43
- 0
app/src/main/res/drawable/ic_donate.xml View File

@@ -0,0 +1,43 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:width="48dp"
4
+    android:height="48dp"
5
+    android:viewportWidth="48"
6
+    android:viewportHeight="48">
7
+
8
+    <group android:scaleY="-1">
9
+        <group android:translateY="-48">
10
+            <path
11
+                android:fillColor="#000000"
12
+                android:strokeWidth="0.75"
13
+                android:strokeMiterLimit="79.8403193612775"
14
+                android:strokeLineCap="round"
15
+                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
16
+18.032,21.925 18.249,23.288 18.202,24.301 L 18.202,24.812 C 13.398,21.976
17
+8.006,18.283 6.316,19.973 L 5.892,20.99 C 11.546,24.893 17.202,28.796
18
+21.852,32.704 C 22.249,33.138 22.902,33.403 23.974,33.385 C 28.907,33.336
19
+33.583,32.949 38.07,32.451 L 43.588,34.829 L 43.417,27.782 C 38.887,23.557
20
+32.161,21.394 27.091,18.166 C 28.105,17.132 28.732,15.715 28.732,14.156 C
21
+28.732,10.992 26.164,8.423 22.998,8.423 C 19.835,8.423 17.266,10.992
22
+17.266,14.156 Z M 27.246,14.156 C 27.246,16.496 25.341,18.399 22.998,18.399 C
23
+20.655,18.399 18.752,16.496 18.752,14.156 C 18.752,11.813 20.655,9.911
24
+22.998,9.911 C 25.341,9.911 27.246,11.813 27.246,14.156 Z M 21.197,11.848 C
25
+20.842,12.223 20.608,12.689 20.497,13.249 L 19.885,13.249 L 20.018,13.888 L
26
+20.423,13.888 C 20.42,13.954 20.415,14.027 20.415,14.101 C 20.415,14.229
27
+20.42,14.338 20.426,14.434 L 19.885,14.434 L 20.018,15.075 L 20.509,15.075 C
28
+20.625,15.625 20.854,16.084 21.198,16.452 C 21.721,17.009 22.403,17.285
29
+23.253,17.285 C 23.716,17.285 24.118,17.202 24.458,17.036 L 24.216,15.889 C
30
+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
31
+21.943,15.576 21.832,15.347 21.766,15.075 L 24.04,15.075 L 23.905,14.434 L
32
+21.683,14.434 C 21.68,14.373 21.679,14.291 21.679,14.192 C 21.679,14.096
33
+21.68,13.994 21.686,13.888 L 23.791,13.888 L 23.659,13.249 L 21.772,13.249 C
34
+21.842,12.953 21.946,12.721 22.093,12.556 C 22.367,12.23 22.728,12.067
35
+23.166,12.067 C 23.694,12.067 24.117,12.23 24.431,12.556 L 24.431,11.29 C
36
+24.073,11.11 23.656,11.021 23.179,11.021 C 22.375,11.021 21.713,11.298
37
+21.197,11.848 Z M 29.494,23.708 C 30.203,25.42 30.088,27.919 24.739,26.679 C
38
+21.778,25.437 21.126,24.068 22.192,22.603 C 22.787,21.692 23.124,20.787
39
+23.329,19.878 C 23.931,19.843 24.507,19.716 25.047,19.508 C 26.476,21.08
40
+28.884,22.241 29.494,23.708 Z" />
41
+        </group>
42
+    </group>
43
+</vector>

+ 4
- 0
app/src/main/res/menu/activity_controlcenterv2_main_drawer.xml View File

@@ -21,6 +21,10 @@
21 21
     <group
22 22
         android:checkableBehavior="single"
23 23
         android:id="@+id/further_options">
24
+        <item
25
+            android:id="@+id/donation_link"
26
+            android:title="@string/action_donate"
27
+            android:icon="@drawable/ic_donate" />
24 28
         <item
25 29
             android:id="@+id/external_changelog"
26 30
             android:title="@string/changelog_full_title" />

+ 1
- 0
app/src/main/res/values/strings.xml View File

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

Loading…
Cancel
Save