Add Liberapay for donations

This commit is contained in:
Thomas 2020-02-17 17:32:28 +01:00
parent dd9cbac0f3
commit 93ecea35b5
4 changed files with 45 additions and 16 deletions

View File

@ -93,13 +93,16 @@ public class AboutActivity extends AppCompatActivity {
});
//Developer donation
Button donate = findViewById(R.id.donate);
donate.setOnClickListener(v -> {
Button donatePaypal = findViewById(R.id.donate_paypal);
donatePaypal.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.me/Mastalab"));
startActivity(browserIntent);
});
Button donateLiberapay = findViewById(R.id.donate_liberapay);
donateLiberapay.setOnClickListener(v -> {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://liberapay.com/tom79/donate"));
startActivity(browserIntent);
});
TextView license = findViewById(R.id.license);
content = new SpannableString(license.getText().toString());

View File

@ -88,9 +88,6 @@ public class AppInfoAdapter extends RecyclerView.Adapter {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("nitterizeme","test");
String url = "https://"+appInfo.getDomain();
if( appInfo.getDomain().contains("/maps/place")) {
url = "https://google.com/maps/place";
}
intent.setData(Uri.parse(url));
context.startActivity(intent);
});

View File

@ -76,8 +76,7 @@ public class MainActivity extends AppCompatActivity {
"youtube.com",
"m.youtube.com",
"youtu.be",
"youtube-nocookie.com",
"maps",
"youtube-nocookie.com"
};
@Override

View File

@ -135,14 +135,44 @@
</androidx.cardview.widget.CardView>
<!-- Idea from info -->
<Button
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/Donate"
android:id="@+id/donate"
/>
android:text="@string/Donate"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Paypal"
android:id="@+id/donate_paypal"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
tools:ignore="HardcodedText"
/>
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:textColor="@android:color/white"
android:layout_marginTop="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Liberapay"
android:id="@+id/donate_liberapay"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
tools:ignore="HardcodedText" />
</LinearLayout>
<!-- About the app -->
<TextView