Skip to content

Commit b26db6a

Browse files
committed
Donation link added
1 parent 0108aec commit b26db6a

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
minSdk 21
1111
targetSdk 33
1212
multiDexEnabled true
13-
versionCode 15
14-
versionName "2.4.0"
13+
versionCode 16
14+
versionName "2.5.0"
1515

1616

1717
}

app/src/main/java/github/umer0586/fragments/ServerFragment.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.Intent;
66
import android.content.ServiceConnection;
7+
import android.net.Uri;
78
import android.net.wifi.WifiManager;
89
import android.os.Bundle;
910
import android.os.IBinder;
@@ -16,6 +17,7 @@
1617

1718
import androidx.annotation.NonNull;
1819
import androidx.annotation.Nullable;
20+
import androidx.appcompat.widget.AppCompatTextView;
1921
import androidx.cardview.widget.CardView;
2022
import androidx.core.content.ContextCompat;
2123
import androidx.fragment.app.Fragment;
@@ -80,6 +82,20 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
8082

8183
appSettings = new AppSettings(getContext());
8284

85+
AppCompatTextView donationText = view.findViewById(R.id.donationText);
86+
donationText.setOnClickListener(v->{
87+
Intent intent = new Intent(Intent.ACTION_VIEW);
88+
if(intent.resolveActivity(getContext().getPackageManager()) != null)
89+
{
90+
intent.setData(Uri.parse("http://www.buymeacoffee.com/umerfarooq"));
91+
startActivity(Intent.createChooser(intent,"Select Browser"));
92+
}
93+
else
94+
{
95+
Toast.makeText(getContext(),"Browser app not found",Toast.LENGTH_SHORT).show();
96+
}
97+
});
98+
8399
serviceBindHelper = new ServiceBindHelper(
84100
getContext(),
85101
this,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="96.59dp"
3+
android:height="122.88dp"
4+
android:viewportWidth="96.59"
5+
android:viewportHeight="122.88">
6+
<path
7+
android:fillColor="#FF000000"
8+
android:pathData="M42.65,7.68A26.83,26.83 0,0 1,46.83 0a43.57,43.57 0,0 0,-1.44 10.6C45.54,17.07 48.57,20.05 53,28c6.4,11.52 3.3,22.66 -5.21,31.85C50.85,49.59 52.29,43 50,35.47a34,34 0,0 0,-2.74 -6.22c-2.86,-5.21 -6,-9.51 -5.69,-15.8a20.81,20.81 0,0 1,1.13 -5.77ZM10.89,54.6a2.43,2.43 0,0 1,0.54 -1.06c1.57,-2.46 5.24,-4.54 10.36,-6A73.09,73.09 0,0 1,36.34 45,26.9 26.9,0 0,1 36,49.35a65.37,65.37 0,0 0,-12.66 2.24c-4.17,1.22 -7,2.63 -7.69,4l-0.15,0.92c0.28,1.52 3.22,3.1 7.84,4.45a82.84,82.84 0,0 0,22.28 2.68A82.89,82.89 0,0 0,67.85 61c4.63,-1.35 7.58,-2.94 7.85,-4.46l-0.09,-0.74c-0.56,-1.44 -3.42,-2.91 -7.76,-4.18a60.51,60.51 0,0 0,-7.74 -1.65,28 28,0 0,0 1.2,-4.18 63.87,63.87 0,0 1,8 1.74c5.48,1.61 9.31,3.87 10.67,6.56a2.41,2.41 0,0 1,0.33 0.83,4.7 4.7,0 0,1 0.22,1.39c0,0.12 0,0.23 0,0.34 0.18,1.71 0.3,3.39 0.38,5 5,-1.58 8.79,-1 11.46,0.93a10.42,10.42 0,0 1,4.14 7.65,17.1 17.1,0 0,1 -1.86,9.27c-3.09,6.2 -9.92,11.7 -20.42,11.72 -0.37,0.66 -0.76,1.3 -1.16,1.92a44.38,44.38 0,0 1,11.74 4.64c3.94,2.42 6.17,5.35 6.17,8.64 0,5 -5.46,9.35 -14.29,12.22 -8,2.62 -19.06,4.24 -31.2,4.24s-23.19,-1.62 -31.21,-4.24C5.46,115.77 0,111.46 0,106.42c0,-3.29 2.23,-6.22 6.17,-8.64a44.62,44.62 0,0 1,12.06 -4.72,53 53,0 0,1 -7.1,-17.67A50.69,50.69 0,0 1,10 65.22a55.22,55.22 0,0 1,0.58 -8.75v-0.19a4.89,4.89 0,0 1,0.31 -1.68ZM14.89,62.15c0,1 -0.07,2 -0.06,3a47.1,47.1 0,0 0,1 9.22c2.76,12.66 8.86,21.3 16.2,26a25,25 0,0 0,27.63 -0.13c7.2,-4.69 13.11,-13.28 15.65,-25.76a47.39,47.39 0,0 0,0.88 -8.81v-0.35a1.22,1.22 0,0 1,0 -0.27c0,-0.91 0,-1.84 -0.06,-2.78a29.17,29.17 0,0 1,-6.79 2.82A88.4,88.4 0,0 1,45.57 68a88.53,88.53 0,0 1,-23.78 -2.9,28.94 28.94,0 0,1 -6.93,-2.91ZM81,66.74A49.81,49.81 0,0 1,80 75.41a57.12,57.12 0,0 1,-3.33 10.88c7,-0.75 11.53,-4.62 13.68,-8.93a12.39,12.39 0,0 0,1.38 -6.66,5.7 5.7,0 0,0 -2.14,-4.2c-1.73,-1.23 -4.58,-1.4 -8.64,0.24ZM70,97.33a35.47,35.47 0,0 1,-7.74 6.91,29.83 29.83,0 0,1 -32.82,0.16 35.43,35.43 0,0 1,-8.12 -7.15,43.56 43.56,0 0,0 -12.65,4.64c-2.46,1.51 -3.85,3.06 -3.85,4.53 0,2.71 4.18,5.44 11,7.64 7.56,2.47 18.07,4 29.72,4s22.15,-1.52 29.71,-4c6.77,-2.2 11,-4.93 11,-7.64 0,-1.47 -1.39,-3 -3.85,-4.53A42.93,42.93 0,0 0,70 97.33ZM38,15.27c-1.06,7 -0.13,9.16 2.17,12.45 2.55,3.64 4.7,6.48 5.33,10.05 0.88,5 -1.41,10.36 -4.45,14.22 4.76,-23.42 -13.36,-17.91 -3.05,-36.72Z"
9+
android:fillType="evenOdd"/>
10+
</vector>

app/src/main/res/layout/fragment_server.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,31 @@
5757
app:SpinKit_Color="?attr/colorSecondary"
5858
app:SpinKit_Style="PulseRing" />
5959

60+
<androidx.appcompat.widget.LinearLayoutCompat
61+
android:layout_width="match_parent"
62+
android:layout_height="match_parent"
63+
android:gravity="center"
64+
android:layout_below="@id/start_button">
65+
66+
<androidx.appcompat.widget.AppCompatTextView
67+
android:id="@+id/donationText"
68+
android:layout_width="wrap_content"
69+
android:layout_height="wrap_content"
70+
android:gravity="center"
71+
android:textStyle="italic|bold"
72+
android:textColor="?attr/colorPrimary"
73+
android:text="Buy me a coffee"/>
74+
75+
<androidx.appcompat.widget.AppCompatImageView
76+
android:layout_width="30dp"
77+
android:layout_height="30dp"
78+
app:srcCompat="@drawable/coffee_icon"
79+
android:tint="?attr/colorPrimary"
80+
android:tooltipText="@string/app_name"
81+
android:layout_centerHorizontal="true"/>
82+
83+
</androidx.appcompat.widget.LinearLayoutCompat>
84+
6085

6186

6287

0 commit comments

Comments
 (0)