diff options
author | Thomas <tschneider.ac@gmail.com> | 2020-05-08 17:54:40 +0200 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2020-05-08 17:54:40 +0200 |
commit | 2e4906722029577491da5b6598f4fe9ba0601eec (patch) | |
tree | 7e2ffe931c9308257f1f4f4fb1e72df175360764 /app | |
parent | 48085819ff4ea2ae6f938d7fdcb2fc16ae6e0e47 (diff) |
Add support button
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java | 20 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_liberapay.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/layout/popup_release_notes.xml | 13 |
3 files changed, 33 insertions, 4 deletions
diff --git a/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java index 8b7f047cf..c1928b179 100644 --- a/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/BaseMainActivity.java @@ -44,6 +44,7 @@ import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; +import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; @@ -1257,7 +1258,7 @@ public abstract class BaseMainActivity extends BaseActivity int lastReleaseNoteRead = sharedpreferences.getInt(Helper.SET_POPUP_RELEASE_NOTES, 0); int versionCode = BuildConfig.VERSION_CODE; - if (lastReleaseNoteRead != versionCode) { //Need to push release notes + if (lastReleaseNoteRead != versionCode ) { //Need to push release notes if (social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) { new RetrieveRemoteDataAsyncTask(BaseMainActivity.this, BaseMainActivity.this).execute(); } @@ -1272,11 +1273,26 @@ public abstract class BaseMainActivity extends BaseActivity LayoutInflater inflater = getLayoutInflater(); dialogReleaseNoteView = inflater.inflate(R.layout.popup_release_notes, new LinearLayout(BaseMainActivity.this), false); dialogBuilderOptin.setView(dialogReleaseNoteView); + TextView release_title = dialogReleaseNoteView.findViewById(R.id.release_title); TextView release_notes = dialogReleaseNoteView.findViewById(R.id.release_notes); + Button liberapay_support = dialogReleaseNoteView.findViewById(R.id.liberapay_support); release_title.setText(getString(R.string.release_note_title, BuildConfig.VERSION_NAME)); release_notes.setText(finalContent); - + if( BuildConfig.DONATIONS) { + liberapay_support.setVisibility(View.VISIBLE); + }else{ + liberapay_support.setVisibility(View.GONE); + } + liberapay_support.setOnClickListener(v->{ + Intent intentLiberapay = new Intent(Intent.ACTION_VIEW); + intentLiberapay.setData(Uri.parse("https://liberapay.com/tom79")); + try { + startActivity(intentLiberapay); + } catch (Exception e) { + Helper.openBrowser(BaseMainActivity.this, "https://liberapay.com/tom79"); + } + }); dialogBuilderOptin.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss()); try { Handler handler = new Handler(); diff --git a/app/src/main/res/drawable/ic_liberapay.xml b/app/src/main/res/drawable/ic_liberapay.xml index b9dd4b5a7..5400dc38e 100644 --- a/app/src/main/res/drawable/ic_liberapay.xml +++ b/app/src/main/res/drawable/ic_liberapay.xml @@ -1,5 +1,5 @@ <vector android:height="24dp" android:viewportHeight="80" android:viewportWidth="80" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> - <path android:fillColor="#1a171b" android:pathData="m25.91,63.04c-3.571,0 -6.373,-0.466 -8.41,-1.396 -2.037,-0.93 -3.495,-2.199 -4.375,-3.809 -0.88,-1.609 -1.308,-3.457 -1.282,-5.544 0.025,-2.086 0.313,-4.311 0.868,-6.675l9.579,-40.05 11.69,-1.81 -10.484,43.44c-0.202,0.905 -0.314,1.735 -0.339,2.489 -0.026,0.754 0.113,1.421 0.415,1.999 0.302,0.579 0.817,1.044 1.546,1.395 0.729,0.353 1.747,0.579 3.055,0.679l-2.263,9.278"/> - <path android:fillColor="#1a171b" android:pathData="m68.15,38.08c0,3.671 -0.604,7.03 -1.811,10.07 -1.207,3.043 -2.879,5.669 -5.01,7.881 -2.138,2.213 -4.702,3.935 -7.693,5.167 -2.992,1.231 -6.248,1.848 -9.767,1.848 -1.71,0 -3.42,-0.151 -5.129,-0.453l-3.394,13.651h-11.162l12.52,-52.19c2.01,-0.603 4.311,-1.143 6.901,-1.622 2.589,-0.477 5.393,-0.716 8.41,-0.716 2.815,0 5.242,0.428 7.278,1.282 2.037,0.855 3.708,2.024 5.02,3.507 1.307,1.484 2.274,3.219 2.904,5.205 0.627,1.987 0.942,4.11 0.942,6.373m-27.378,15.461c0.854,0.202 1.91,0.302 3.167,0.302 1.961,0 3.746,-0.364 5.355,-1.094 1.609,-0.728 2.979,-1.747 4.111,-3.055 1.131,-1.307 2.01,-2.877 2.64,-4.714 0.628,-1.835 0.943,-3.858 0.943,-6.071 0,-2.161 -0.479,-3.998 -1.433,-5.506 -0.956,-1.508 -2.615,-2.263 -4.978,-2.263 -1.61,0 -3.118,0.151 -4.525,0.453l-5.28,21.948"/> + <path android:fillColor="#ffffff" android:pathData="m25.91,63.04c-3.571,0 -6.373,-0.466 -8.41,-1.396 -2.037,-0.93 -3.495,-2.199 -4.375,-3.809 -0.88,-1.609 -1.308,-3.457 -1.282,-5.544 0.025,-2.086 0.313,-4.311 0.868,-6.675l9.579,-40.05 11.69,-1.81 -10.484,43.44c-0.202,0.905 -0.314,1.735 -0.339,2.489 -0.026,0.754 0.113,1.421 0.415,1.999 0.302,0.579 0.817,1.044 1.546,1.395 0.729,0.353 1.747,0.579 3.055,0.679l-2.263,9.278"/> + <path android:fillColor="#ffffff" android:pathData="m68.15,38.08c0,3.671 -0.604,7.03 -1.811,10.07 -1.207,3.043 -2.879,5.669 -5.01,7.881 -2.138,2.213 -4.702,3.935 -7.693,5.167 -2.992,1.231 -6.248,1.848 -9.767,1.848 -1.71,0 -3.42,-0.151 -5.129,-0.453l-3.394,13.651h-11.162l12.52,-52.19c2.01,-0.603 4.311,-1.143 6.901,-1.622 2.589,-0.477 5.393,-0.716 8.41,-0.716 2.815,0 5.242,0.428 7.278,1.282 2.037,0.855 3.708,2.024 5.02,3.507 1.307,1.484 2.274,3.219 2.904,5.205 0.627,1.987 0.942,4.11 0.942,6.373m-27.378,15.461c0.854,0.202 1.91,0.302 3.167,0.302 1.961,0 3.746,-0.364 5.355,-1.094 1.609,-0.728 2.979,-1.747 4.111,-3.055 1.131,-1.307 2.01,-2.877 2.64,-4.714 0.628,-1.835 0.943,-3.858 0.943,-6.071 0,-2.161 -0.479,-3.998 -1.433,-5.506 -0.956,-1.508 -2.615,-2.263 -4.978,-2.263 -1.61,0 -3.118,0.151 -4.525,0.453l-5.28,21.948"/> </vector> diff --git a/app/src/main/res/layout/popup_release_notes.xml b/app/src/main/res/layout/popup_release_notes.xml index 2346f3d5c..af26fe73f 100644 --- a/app/src/main/res/layout/popup_release_notes.xml +++ b/app/src/main/res/layout/popup_release_notes.xml @@ -42,6 +42,17 @@ android:gravity="start" android:textSize="14sp" /> + <androidx.appcompat.widget.AppCompatButton + android:drawablePadding="5dp" + android:id="@+id/liberapay_support" + style="@style/Base.Widget.AppCompat.Button.Colored" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:drawableStart="@drawable/ic_liberapay" + android:gravity="center" + android:text="@string/about_opencollective" /> + <TextView android:id="@+id/dev_follow_title" android:visibility="gone" @@ -52,11 +63,13 @@ android:text="@string/follow_account_update" android:gravity="start" android:textSize="16sp" /> + <app.fedilab.android.helper.ExpandableHeightListView android:id="@+id/lv_developers" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@null" android:scrollbars="none" /> + </LinearLayout> </ScrollView> |