Change order for the subscription
This commit is contained in:
@@ -56,10 +56,7 @@ public class InAppPurchaseWrapper {
|
||||
private static volatile InAppPurchaseWrapper sInAppPurchaseWrapper;
|
||||
private static Object sMutex = new Object();
|
||||
|
||||
private enum SubscriptionType {
|
||||
MONTHLY,
|
||||
YEARLY
|
||||
}
|
||||
private enum SubscriptionType { MONTHLY, YEARLY }
|
||||
|
||||
private MutableLiveData<ProductDetails> mMutableMonthlyProductDetails = new MutableLiveData();
|
||||
private LiveData<ProductDetails> mMonthlyProductDetails = mMutableMonthlyProductDetails;
|
||||
@@ -160,9 +157,8 @@ public class InAppPurchaseWrapper {
|
||||
return subscriptionType == SubscriptionType.MONTHLY ? RELEASE_MONTHLY_SUBSCRIPTION
|
||||
: RELEASE_YEARLY_SUBSCRIPTION;
|
||||
} else if (bravePackageName.equals(BraveConstants.BRAVE_BETA_PACKAGE_NAME)) {
|
||||
return subscriptionType == SubscriptionType.MONTHLY
|
||||
? BETA_MONTHLY_SUBSCRIPTION
|
||||
: BETA_YEARLY_SUBSCRIPTION;
|
||||
return subscriptionType == SubscriptionType.MONTHLY ? BETA_MONTHLY_SUBSCRIPTION
|
||||
: BETA_YEARLY_SUBSCRIPTION;
|
||||
} else {
|
||||
return subscriptionType == SubscriptionType.MONTHLY ? NIGHTLY_MONTHLY_SUBSCRIPTION
|
||||
: NIGHTLY_YEARLY_SUBSCRIPTION;
|
||||
|
||||
@@ -174,11 +174,9 @@ public class BraveVpnUtils {
|
||||
String expiryTimeInString = purchase.getString("expiryTimeMillis");
|
||||
return Long.parseLong(expiryTimeInString);
|
||||
} catch (JSONException | NumberFormatException e) {
|
||||
Log.e(
|
||||
TAG,
|
||||
Log.e(TAG,
|
||||
"BraveVpnUtils -> getPurchaseExpiryDate JSONException | NumberFormatException"
|
||||
+ " error "
|
||||
+ e);
|
||||
+ " error " + e);
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@@ -72,77 +72,6 @@
|
||||
android:layout_marginBottom="14dp"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/monthly_selector_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:baselineAligned="false"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/monthly_selector"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monthly_subscription_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/monthly_subscription"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:textAlignment="textStart"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/renews_monthly"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:textAlignment="textStart"
|
||||
android:alpha="0.6"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/monthly_plan_progress"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monthly_subscription_amount_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:textAlignment="textStart"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/yearly_selector_layout"
|
||||
android:layout_width="match_parent"
|
||||
@@ -233,6 +162,77 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/monthly_selector_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:baselineAligned="false"
|
||||
android:padding="16dp"
|
||||
android:background="@drawable/monthly_selector"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monthly_subscription_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/monthly_subscription"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:textAlignment="textStart"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/renews_monthly"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:textAlignment="textStart"
|
||||
android:alpha="0.6"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/monthly_plan_progress"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monthly_subscription_amount_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:textAlignment="textStart"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user