Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ section the body of the GitHub release, and refuses a version without one. `scri
- An xls sheet with a chart keeps its cell values and its size.
- Search no longer breaks on a long document with many matches.
- Pro: typed formulas work again on devices with an older WebView.
- Free edition: the "Support the app" dialog and the Pro gate always show the yearly
subscription, with shorter texts. A tap without Google Play says so.

## 4.23.0

Expand Down
36 changes: 32 additions & 4 deletions app/src/ads/java/app/opendocument/droid/nonfree/PlayBilling.kt
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,37 @@ class PlayBilling(
}
}

/** Starts play's purchase sheet. Only after [queryPassPrice] found a price. */
fun buyPass(activity: Activity) {
val details = passDetails ?: return
val offerToken = passOfferToken ?: return
/**
* Starts play's purchase sheet. Asks play for the pass first if [queryPassPrice] has not found
* it yet. Calls [onUnavailable] if play has no pass to sell, or does not open the sheet.
*/
fun buyPass(activity: Activity, onUnavailable: () -> Unit) {
val details = passDetails
val offerToken = passOfferToken
if (details != null && offerToken != null) {
launchFlow(activity, details, offerToken, onUnavailable)

return
}

// the dialog asked before the tap, but play may have been down then: one more try
queryPassPrice {
val foundDetails = passDetails
val foundOfferToken = passOfferToken
if (foundDetails == null || foundOfferToken == null) {
onUnavailable()
} else {
launchFlow(activity, foundDetails, foundOfferToken, onUnavailable)
}
}
}

private fun launchFlow(
activity: Activity,
details: ProductDetails,
offerToken: String,
onUnavailable: () -> Unit,
) {
val product =
BillingFlowParams.ProductDetailsParams.newBuilder()
.setProductDetails(details)
Expand All @@ -160,6 +186,8 @@ class PlayBilling(
val result = client.launchBillingFlow(activity, params)
if (result.responseCode != BillingClient.BillingResponseCode.OK) {
crashManager.log("pass flow failed: " + result.responseCode)

onUnavailable()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ class BillingManager {
playBilling?.queryPassPrice(callback) ?: callback(null)
}

fun buyPass(activity: Activity) {
playBilling?.buyPass(activity)
/** See [PlayBilling.buyPass]. Without play, [onUnavailable] runs at once. */
fun buyPass(activity: Activity, onUnavailable: () -> Unit) {
playBilling?.buyPass(activity, onUnavailable) ?: onUnavailable()
}

fun destroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,6 @@ class MainActivity : AppCompatActivity() {
val view = layoutInflater.inflate(R.layout.dialog_pass, null)
val featureView = view.findViewById<TextView>(R.id.pass_feature)
val buyButton = view.findViewById<Button>(R.id.pass_buy)
val terms = view.findViewById<View>(R.id.pass_terms)
val proButton = view.findViewById<View>(R.id.pass_get_pro)

if (feature != null) {
Expand All @@ -837,16 +836,14 @@ class MainActivity : AppCompatActivity() {
.setNegativeButton(R.string.not_now, null)
.show()

// no price, no button: without play, or before the product exists, the pro app is the one
// thing to offer
// the button is up from the start, and shows the price once play gives one. without play,
// a tap says so
billingManager.queryPassPrice { price ->
if (price == null || !dialog.isShowing) {
return@queryPassPrice
}

buyButton.text = getString(R.string.pass_buy, price)
buyButton.visibility = View.VISIBLE
terms.visibility = View.VISIBLE
}

buyButton.setOnClickListener {
Expand All @@ -858,7 +855,15 @@ class MainActivity : AppCompatActivity() {

dialog.dismiss()

billingManager.buyPass(this)
billingManager.buyPass(this) {
SnackbarHelper.show(
this,
R.string.pass_unavailable,
null,
isIndefinite = false,
isError = true,
)
}
}

proButton.setOnClickListener {
Expand Down
12 changes: 5 additions & 7 deletions app/src/main/res/layout/dialog_pass.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- the body of MainActivity.offerPass, between the dialog's own title and its "Not now". The
pass button and its terms stay hidden until Play has a price; without one, the Pro link is
all there is to offer -->
pass button starts without a price, and takes the one Play gives -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -31,7 +30,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone" />
android:text="@string/pass_buy_no_price" />

<TextView
android:id="@+id/pass_terms"
Expand All @@ -41,14 +40,13 @@
android:gravity="center_horizontal"
android:text="@string/pass_terms"
android:textAppearance="?attr/textAppearanceBodySmall"
android:textColor="?attr/colorOnSurfaceVariant"
android:visibility="gone" />
android:textColor="?attr/colorOnSurfaceVariant" />

<com.google.android.material.button.MaterialButton
android:id="@+id/pass_get_pro"
style="@style/Widget.Material3.Button.TextButton"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginTop="16dp"
android:text="@string/pass_get_pro" />
</LinearLayout>
4 changes: 0 additions & 4 deletions app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Sense ressaltat</string>
<string name="color_no_fill">Sense emplenament</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Part de Pro</string>
<string name="pro_offer_formatting">La negreta, la cursiva, els colors i la mida del text, així com afegir o unir paràgrafs, formen part d\'OpenDocument Reader Pro. El ressaltador està disponible a totes les edicions.</string>
<string name="pro_offer_sheet">La negreta, la cursiva, els colors, la mida del text i l\'alineació de les cel·les, així com escriure fórmules i inserir o suprimir files i columnes, formen part d\'OpenDocument Reader Pro. L\'emplenament està disponible a totes les edicions.</string>
<string name="pro_offer_markup">Subratllar, ratllar i dibuixar en un PDF formen part d\'OpenDocument Reader Pro. El ressaltador està disponible a totes les edicions.</string>
<string name="not_now">Ara no</string>
<string name="edit_refused_new_line">Un salt de línia dins d\'un paràgraf no es pot desar. Premeu Retorn per a un paràgraf nou.</string>
<string name="edit_refused_formula">Aquesta cel·la conté una fórmula i es queda tal com està.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Bez zvýraznění</string>
<string name="color_no_fill">Bez výplně</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Součást verze Pro</string>
<string name="pro_offer_formatting">Tučné písmo, kurzíva, barvy, velikost textu a také přidávání a spojování odstavců jsou součástí OpenDocument Reader Pro. Zvýrazňovač je k dispozici ve všech verzích.</string>
<string name="pro_offer_sheet">Tučné písmo, kurzíva, barvy, velikost textu a zarovnání buněk, psaní vzorců a také vkládání a odstraňování řádků a sloupců jsou součástí OpenDocument Reader Pro. Výplň je k dispozici ve všech verzích.</string>
<string name="pro_offer_markup">Podtrhávání, přeškrtávání a kreslení v PDF jsou součástí OpenDocument Reader Pro. Zvýrazňovač je k dispozici ve všech verzích.</string>
<string name="not_now">Teď ne</string>
<string name="edit_refused_new_line">Zalomení řádku uvnitř odstavce nelze uložit. Pro nový odstavec stiskněte Enter.</string>
<string name="edit_refused_formula">Tato buňka obsahuje vzorec a zůstane beze změny.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Ingen fremhævning</string>
<string name="color_no_fill">Intet fyld</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">En del af Pro</string>
<string name="pro_offer_formatting">Fed, kursiv, farver og tekststørrelse samt tilføjelse og sammenlægning af afsnit er en del af OpenDocument Reader Pro. Fremhævning er med i alle udgaver.</string>
<string name="pro_offer_sheet">Fed, kursiv, farver, tekststørrelse og justering af celler, indtastning af formler samt indsættelse og sletning af rækker og kolonner er en del af OpenDocument Reader Pro. Fyld er med i alle udgaver.</string>
<string name="pro_offer_markup">Understregning, gennemstregning og tegning på en PDF er en del af OpenDocument Reader Pro. Fremhævning er med i alle udgaver.</string>
<string name="not_now">Ikke nu</string>
<string name="edit_refused_new_line">Et linjeskift inde i et afsnit kan ikke gemmes. Tryk på Enter for et nyt afsnit.</string>
<string name="edit_refused_formula">Cellen indeholder en formel og forbliver, som den er.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Keine Hervorhebung</string>
<string name="color_no_fill">Keine Füllfarbe</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Teil von Pro</string>
<string name="pro_offer_formatting">Fett, kursiv, Farben und Textgröße sowie das Hinzufügen oder Zusammenführen von Absätzen sind Teil von OpenDocument Reader Pro. Das Hervorheben ist in jeder Version enthalten.</string>
<string name="pro_offer_sheet">Fett, kursiv, Farben, Textgröße und Ausrichtung von Zellen, das Eingeben von Formeln sowie das Einfügen oder Löschen von Zeilen und Spalten sind Teil von OpenDocument Reader Pro. Die Füllfarbe ist in jeder Version enthalten.</string>
<string name="pro_offer_markup">Unterstreichen, Durchstreichen und Zeichnen in einem PDF sind Teil von OpenDocument Reader Pro. Das Hervorheben ist in jeder Version enthalten.</string>
<string name="not_now">Nicht jetzt</string>
<string name="edit_refused_new_line">Ein Zeilenumbruch innerhalb eines Absatzes kann nicht gespeichert werden. Drücken Sie die Eingabetaste für einen neuen Absatz.</string>
<string name="edit_refused_formula">Diese Zelle enthält eine Formel und bleibt, wie sie ist.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Sin resaltado</string>
<string name="color_no_fill">Sin relleno</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Parte de Pro</string>
<string name="pro_offer_formatting">La negrita, la cursiva, los colores y el tamaño del texto, así como añadir o unir párrafos, forman parte de OpenDocument Reader Pro. El resaltador está disponible en todas las versiones.</string>
<string name="pro_offer_sheet">La negrita, la cursiva, los colores, el tamaño del texto y la alineación de las celdas, así como escribir fórmulas e insertar o eliminar filas y columnas, forman parte de OpenDocument Reader Pro. El relleno está disponible en todas las versiones.</string>
<string name="pro_offer_markup">Subrayar, tachar y dibujar en un PDF forman parte de OpenDocument Reader Pro. El resaltador está disponible en todas las versiones.</string>
<string name="not_now">Ahora no</string>
<string name="edit_refused_new_line">Un salto de línea dentro de un párrafo no se puede guardar. Pulse Intro para crear un párrafo nuevo.</string>
<string name="edit_refused_formula">Esa celda contiene una fórmula y se queda como está.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-et/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Esiletõstuta</string>
<string name="color_no_fill">Täiteta</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Osa Pro-versioonist</string>
<string name="pro_offer_formatting">Paks kiri, kaldkiri, värvid ja teksti suurus ning lõikude lisamine või ühendamine on OpenDocument Reader Pro osa. Esiletõst on saadaval kõigis versioonides.</string>
<string name="pro_offer_sheet">Paks kiri, kaldkiri, värvid, teksti suurus ja lahtrite joondus, valemite sisestamine ning ridade ja veergude lisamine või kustutamine on OpenDocument Reader Pro osa. Täide on saadaval kõigis versioonides.</string>
<string name="pro_offer_markup">Allajoonimine, läbikriipsutamine ja joonistamine PDF-il on OpenDocument Reader Pro osa. Esiletõst on saadaval kõigis versioonides.</string>
<string name="not_now">Mitte praegu</string>
<string name="edit_refused_new_line">Reavahetust lõigu sees ei saa salvestada. Uue lõigu jaoks vajuta Enter.</string>
<string name="edit_refused_formula">Selles lahtris on valem ja see jääb nii, nagu on.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Aucun surlignage</string>
<string name="color_no_fill">Aucun remplissage</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Inclus dans Pro</string>
<string name="pro_offer_formatting">Le gras, l\'italique, les couleurs et la taille du texte, ainsi que l\'ajout ou la fusion de paragraphes, sont inclus dans OpenDocument Reader Pro. Le surligneur est disponible dans toutes les éditions.</string>
<string name="pro_offer_sheet">Le gras, l\'italique, les couleurs, la taille du texte et l\'alignement des cellules, la saisie de formules, ainsi que l\'insertion ou la suppression de lignes et de colonnes, sont inclus dans OpenDocument Reader Pro. Le remplissage est disponible dans toutes les éditions.</string>
<string name="pro_offer_markup">Le soulignement, le barré et le dessin sur un PDF sont inclus dans OpenDocument Reader Pro. Le surligneur est disponible dans toutes les éditions.</string>
<string name="not_now">Pas maintenant</string>
<string name="edit_refused_new_line">Un saut de ligne à l\'intérieur d\'un paragraphe ne peut pas être enregistré. Appuyez sur Entrée pour créer un nouveau paragraphe.</string>
<string name="edit_refused_formula">Cette cellule contient une formule et reste telle quelle.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-ga/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Gan aibhsiú</string>
<string name="color_no_fill">Gan líonadh</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Cuid de Pro</string>
<string name="pro_offer_formatting">Is cuid d\'OpenDocument Reader Pro iad trom, iodálach, dathanna agus méid an téacs, chomh maith le míreanna a chur leis nó a cheangal le chéile. Tá an t-aibhsitheoir i ngach eagrán.</string>
<string name="pro_offer_sheet">Is cuid d\'OpenDocument Reader Pro iad trom, iodálach, dathanna, méid an téacs agus ailíniú na gceall, foirmlí a chlóscríobh, agus rónna agus colúin a ionsá nó a scriosadh. Tá an líonadh i ngach eagrán.</string>
<string name="pro_offer_markup">Is cuid d\'OpenDocument Reader Pro é líne a chur faoi théacs nó tríd, agus tarraingt ar PDF. Tá an t-aibhsitheoir i ngach eagrán.</string>
<string name="not_now">Ní anois</string>
<string name="edit_refused_new_line">Ní féidir briseadh líne laistigh de mhír a shábháil. Brúigh Enter le haghaidh míre nua.</string>
<string name="edit_refused_formula">Tá foirmle sa chill sin agus fanfaidh sí mar atá.</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">कोई हाइलाइट नहीं</string>
<string name="color_no_fill">कोई रंग नहीं</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Pro का हिस्सा</string>
<string name="pro_offer_formatting">बोल्ड, इटैलिक, रंग और टेक्स्ट का आकार, और नए अनुच्छेद जोड़ना या अनुच्छेदों को मिलाना OpenDocument Reader Pro में शामिल हैं। हाइलाइटर हर वर्शन में मिलता है।</string>
<string name="pro_offer_sheet">सेल में बोल्ड, इटैलिक, रंग, टेक्स्ट का आकार और अलाइनमेंट, सूत्र टाइप करना, और पंक्तियाँ और कॉलम डालना या हटाना OpenDocument Reader Pro में शामिल हैं। रंग भरना हर वर्शन में मिलता है।</string>
<string name="pro_offer_markup">PDF पर रेखांकन, काटना और ड्रॉ करना OpenDocument Reader Pro में शामिल हैं। हाइलाइटर हर वर्शन में मिलता है।</string>
<string name="not_now">अभी नहीं</string>
<string name="edit_refused_new_line">अनुच्छेद के भीतर लाइन ब्रेक सहेजा नहीं जा सकता। नए अनुच्छेद के लिए Enter दबाएँ।</string>
<string name="edit_refused_formula">इस सेल में एक सूत्र है, इसलिए यह जैसा है वैसा ही रहेगा।</string>
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@
<string name="color_none">Nessuna evidenziazione</string>
<string name="color_no_fill">Nessun riempimento</string>
<string name="tool_pro_badge">Pro</string>
<string name="pro_offer_title">Parte di Pro</string>
<string name="pro_offer_formatting">Grassetto, corsivo, colori e dimensione del testo, oltre all\'aggiunta o all\'unione di paragrafi, fanno parte di OpenDocument Reader Pro. L\'evidenziatore è disponibile in tutte le edizioni.</string>
<string name="pro_offer_sheet">Grassetto, corsivo, colori, dimensione del testo e allineamento delle celle, digitazione di formule e inserimento o eliminazione di righe e colonne fanno parte di OpenDocument Reader Pro. Il riempimento è disponibile in tutte le edizioni.</string>
<string name="pro_offer_markup">Sottolineare, barrare e disegnare su un PDF fanno parte di OpenDocument Reader Pro. L\'evidenziatore è disponibile in tutte le edizioni.</string>
<string name="not_now">Non ora</string>
<string name="edit_refused_new_line">Un\'interruzione di riga all\'interno di un paragrafo non può essere salvata. Premi Invio per un nuovo paragrafo.</string>
<string name="edit_refused_formula">Questa cella contiene una formula e resta così com\'è.</string>
Expand Down
Loading
Loading