Skip to content

Commit

Permalink
buy me a coffee
Browse files Browse the repository at this point in the history
  • Loading branch information
ekibun committed Mar 13, 2020
1 parent cf5cd5f commit 93f00b1
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import soko.ekibun.bangumi.model.ThemeModel
import soko.ekibun.bangumi.ui.view.BaseFragmentActivity
import soko.ekibun.bangumi.ui.web.WebActivity
import soko.ekibun.bangumi.util.AppUtil
import java.net.URLEncoder


/**
Expand Down Expand Up @@ -159,6 +160,19 @@ class SettingsActivity : BaseFragmentActivity(), PreferenceFragmentCompat.OnPref
"github_page" -> activity?.let {
WebActivity.launchUrl(it, "https://github.com/ekibun/Bangumi", "")
}
"pref_alipay" -> activity?.let {
it.startActivity(
Intent.createChooser(
Intent.parseUri(
"intent://platformapi/startapp?saId=10000007&" +
"qrcode=" + URLEncoder.encode("https://qr.alipay.com/fkx192410t0bnuwmwawdaa4") +
"#Intent;scheme=alipayqr;package=com.eg.android.AlipayGphone;end",
Intent.URI_INTENT_SCHEME
),
"buy me a coffee"
)
)
}
}

return super.onPreferenceTreeClick(preference)
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/res/layout/pref_coffee_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/buy_me_a_coffee"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="textEnd"
android:text="@string/buy_me_a_coffee_sign"/>
</LinearLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,11 @@
<string name="history">历史记录</string>
<string name="clear_history">清空历史记录</string>
<string name="about">关于</string>

<string name="buy_me_a_coffee">
一转眼,app已经两岁了,是开坑之后持续最久的项目了。起初是想借助Bangumi的api整合各个资源站的数据,没想到写着写着变成了Bangumi第三方客户端。\n
\n两年来,通过这个项目认识了Bangumi,也认识了一些友商dalao,项目也成了日常摸鱼和脑洞的试验场。一路下来很有趣,所以也会坚持写下去。当然,由于垃圾原生和自己技术的问题,新功能肯定没有隔壁友商加的快。\n
\n最后,欢迎各种建议、欢迎STAR,欢迎投食!\n
</string>
<string name="buy_me_a_coffee_sign">2020-03-13</string>
</resources>
17 changes: 17 additions & 0 deletions app/src/main/res/xml/app_preferences.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen
xmlns:app="http://schemas.android.com/apk/res-auto">

<androidx.preference.PreferenceScreen
app:iconSpaceReserved="false"
app:key="pref_calendar"
Expand Down Expand Up @@ -108,5 +109,21 @@
app:key="check_update_now"
app:title="检查更新"/>

<androidx.preference.PreferenceScreen
app:iconSpaceReserved="false"
app:key="buy_me_a_coffee"
app:title="🍚">
<Preference
app:selectable="false"
app:iconSpaceReserved="false"
app:layout="@layout/pref_coffee_header"/>
<Preference
app:key="pref_alipay"
app:iconSpaceReserved="false"
app:title="支付宝"
app:summary="请备注id以便联系"
/>
</androidx.preference.PreferenceScreen>

</androidx.preference.PreferenceScreen>
</androidx.preference.PreferenceScreen>

0 comments on commit 93f00b1

Please sign in to comment.