Replaced BuyDialog with PurchaseActivity

This commit is contained in:
Karim Abou Zeid 2017-09-02 19:20:30 +02:00
commit 035792b3d0
16 changed files with 349 additions and 215 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View file

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:grid="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp"
grid:alignmentMode="alignBounds">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:orientation="vertical"
grid:layout_column="0"
grid:layout_columnWeight="1"
grid:layout_row="0">
<include
layout="@layout/card_about_app"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" />
<include layout="@layout/card_support_development" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:orientation="vertical"
grid:layout_column="1"
grid:layout_columnWeight="1"
grid:layout_row="0">
<include
layout="@layout/card_author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" />
<include layout="@layout/card_special_thanks" />
</LinearLayout>
</android.support.v7.widget.GridLayout>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.activities.PurchaseActivity">
<include layout="@layout/status_bar" />
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_below="@+id/status_bar"
android:background="@color/md_green_500"
android:elevation="4dp">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
android:background="@android:color/transparent" />
</android.support.design.widget.AppBarLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/app_bar"
android:layout_marginTop="-72dp"
android:clipToPadding="false"
android:elevation="8dp"
android:isScrollContainer="true">
<include layout="@layout/activity_purchase_content" />
</ScrollView>
</RelativeLayout>

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/card_on_app_bar_side_padding"
android:paddingLeft="@dimen/card_on_app_bar_side_padding"
android:paddingRight="@dimen/card_on_app_bar_side_padding"
android:paddingTop="8dp"
android:weightSum="1">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitStart"
android:src="@drawable/promo_banner16" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:gravity="center_vertical"
android:paddingBottom="16dp"
android:paddingTop="24dp"
android:text="Phonograph Pro"
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="Unlocks extra features, such as the folder view, all theme colors, a black theme and the sleep timer.\n\nThe source code of Phonograph is available on GitHub. You are welcome to compile the pro version yourself for free. However, if you want to support the development and receive updates through the Play Store, consider purchasing Phonograph Pro.\nThank you,\nKarim"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp">
<Button
android:id="@+id/restore_button"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/restore" />
<Button
android:id="@+id/purchase_button"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/purchase"
android:textColor="@color/md_green_600" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

View file

@ -2,4 +2,7 @@
<dimen name="title_view_height">56dp</dimen>
<dimen name="header_image_height">180dp</dimen>
<dimen name="card_on_app_bar_side_padding">72dp</dimen>
</resources>

View file

@ -58,4 +58,6 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="app_widget_card_buttons_width">128dp</dimen>
<dimen name="app_widget_card_radius">2dp</dimen>
<dimen name="card_on_app_bar_side_padding">8dp</dimen>
</resources>

View file

@ -197,7 +197,7 @@
<string name="support_development">Support development</string>
<string name="buy_pro">Buy Phonograph Pro</string>
<string name="thank_you">Thank you!</string>
<string name="restored_previous_purchases_please_restart">Restored previous purchases. Please restart the app to make use of all features.</string>
<string name="restored_previous_purchase_please_restart">Restored previous purchase. Please restart the app to make use of all features.</string>
<string name="version">Version</string>
<string name="author">Author</string>
<string name="write_an_email">Write an email</string>
@ -279,4 +279,10 @@
<string name="black_theme_is_a_pro_feature">The black theme is Phonograph Pro feature.</string>
<string name="sleep_timer_is_a_pro_feature">Sleep timer is a Phonograph Pro feature</string>
<string name="folder_view_is_a_pro_feature">Folder view is a Phonograph Pro feature.</string>
<string name="restore_purchase">Restore purchase</string>
<string name="restoring_purchase">Restoring purchase…</string>
<string name="could_not_restore_purchase">Could not restore purchase.</string>
<string name="purchase">Purchase</string>
<string name="restore">Restore</string>
<string name="no_purchase_found">No purchase found.</string>
</resources>