workaround for redeem code

updated theme library
This commit is contained in:
Mariotaku Lee 2017-01-01 22:37:37 +08:00
parent c1a41f77c7
commit c628ae9996
6 changed files with 26 additions and 10 deletions

View File

@ -171,7 +171,7 @@ dependencies {
compile "com.github.mariotaku.CommonsLibrary:text:$mariotaku_commons_library_version"
compile "com.github.mariotaku.CommonsLibrary:text-kotlin:$mariotaku_commons_library_version"
compile 'com.github.mariotaku:KPreferences:0.9.5'
compile 'com.github.mariotaku:Chameleon:0.9.5'
compile 'com.github.mariotaku:Chameleon:0.9.6'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'nl.komponents.kovenant:kovenant:3.3.0'
compile 'nl.komponents.kovenant:kovenant-android:3.3.0'

View File

@ -52,6 +52,7 @@ class GooglePlayInAppPurchaseActivity : BaseActivity(), BillingProcessor.IBillin
}
override fun onBillingInitialized() {
// See https://github.com/anjlab/android-inapp-billing-v3/issues/156
if (intent.action == ACTION_RESTORE_PURCHASE) {
performRestorePurchase()
} else {
@ -68,8 +69,12 @@ class GooglePlayInAppPurchaseActivity : BaseActivity(), BillingProcessor.IBillin
}
private fun handleError(billingResponse: Int) {
setResult(getResultCode(billingResponse))
finish()
if (billingResponse == BILLING_ERROR_OTHER_ERROR) {
getProductDetailsAndFinish()
} else {
setResult(getResultCode(billingResponse))
finish()
}
}
private fun handlePurchased(details: TransactionDetails) {

View File

@ -283,6 +283,11 @@ open class BaseActivity : ChameleonActivity(), IExtendedActivity, IThemedActivit
override val themeBackgroundOption: String
get() = ThemeUtils.getThemeBackgroundOption(this)
protected val shouldApplyWindowBackground: Boolean
get() {
return true
}
override fun onApplyThemeResource(theme: Resources.Theme, resId: Int, first: Boolean) {
super.onApplyThemeResource(theme, resId, first)
if (window != null && shouldApplyWindowBackground) {
@ -291,11 +296,6 @@ open class BaseActivity : ChameleonActivity(), IExtendedActivity, IThemedActivit
}
}
protected val shouldApplyWindowBackground: Boolean
get() {
return true
}
override fun onCreateView(parent: View?, name: String, context: Context, attrs: AttributeSet): View? {
// Fix for https://github.com/afollestad/app-theme-engine/issues/109
if (context !== this) {

View File

@ -117,6 +117,7 @@ class DraftsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, OnItemCl
override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean {
mode.menuInflater.inflate(R.menu.action_multi_select_drafts, menu)
listView.updateSelectionItems(menu)
return true
}
@ -176,6 +177,7 @@ class DraftsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, OnItemCl
override fun onItemCheckedStateChanged(mode: ActionMode, position: Int, id: Long,
checked: Boolean) {
updateTitle(mode)
listView.updateSelectionItems(mode.menu)
}
override fun onItemClick(view: AdapterView<*>, child: View, position: Int, id: Long) {

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="AppCompatResource">
<item
android:id="@id/delete"
@ -18,14 +20,17 @@
android:visible="false">
<item
android:id="@+id/select_all"
android:showAsAction="never"
android:title="@string/action_select_all"
app:showAsAction="never"/>
<item
android:id="@+id/select_none"
android:showAsAction="never"
android:title="@string/action_select_none"
app:showAsAction="never"/>
<item
android:id="@+id/invert_selection"
android:showAsAction="never"
android:title="@string/action_invert_selection"
app:showAsAction="never"/>
</group>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="AppCompatResource">
<item
android:id="@id/delete"
@ -15,14 +16,17 @@
android:visible="false">
<item
android:id="@+id/select_all"
android:showAsAction="never"
android:title="@string/action_select_all"
app:showAsAction="never"/>
<item
android:id="@+id/select_none"
android:showAsAction="never"
android:title="@string/action_select_none"
app:showAsAction="never"/>
<item
android:id="@+id/invert_selection"
android:showAsAction="never"
android:title="@string/action_invert_selection"
app:showAsAction="never"/>
</group>