From e404e492b7ab3533350d8d7f995dfcc93aaaf0ef Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 27 Jan 2016 21:56:44 +0300 Subject: [PATCH] InApp small fix --- .../plus/liveupdates/LiveUpdatesFragment.java | 16 ++-------------- .../plus/liveupdates/SubscriptionFragment.java | 5 ++--- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index c3c3afc91a..66914d8d44 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -108,7 +108,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment { //getSettings().LIVE_UPDATES_PURCHASED.set(true); subscriptionHeader = inflater.inflate(R.layout.live_updates_header, listView, false); - updateHeader(); + updateSubscriptionHeader(); listView.addHeaderView(subscriptionHeader); @@ -116,7 +116,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment { return view; } - public void updateHeader() { + public void updateSubscriptionHeader() { View subscriptionBanner = subscriptionHeader.findViewById(R.id.subscription_banner); View subscriptionInfo = subscriptionHeader.findViewById(R.id.subscription_info); if (getSettings().LIVE_UPDATES_PURCHASED.get()) { @@ -176,18 +176,6 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment { } } - public void updateSubscriptionBanner() { - View subscriptionBanner = subscriptionHeader.findViewById(R.id.subscription_banner); - View subscriptionInfo = subscriptionHeader.findViewById(R.id.subscription_info); - if (InAppHelper.isSubscribedToLiveUpdates()) { - subscriptionBanner.setVisibility(View.GONE); - subscriptionInfo.setVisibility(View.VISIBLE); - } else { - subscriptionBanner.setVisibility(View.VISIBLE); - subscriptionInfo.setVisibility(View.GONE); - } - } - @Override public void onDestroyView() { super.onDestroyView(); diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java index 8457878349..c8cb879200 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/SubscriptionFragment.java @@ -4,7 +4,6 @@ import android.app.Activity; import android.app.ProgressDialog; import android.os.Bundle; import android.support.v4.app.Fragment; -import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -226,7 +225,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In Fragment parent = getParentFragment(); if (parent != null && parent instanceof LiveUpdatesFragment) { - ((LiveUpdatesFragment) parent).updateHeader(); + ((LiveUpdatesFragment) parent).updateSubscriptionHeader(); } dismiss(); @@ -330,7 +329,7 @@ public class SubscriptionFragment extends BaseOsmAndDialogFragment implements In if (InAppHelper.getSkuLiveUpdates().equals(sku)) { Fragment parentFragment = getParentFragment(); if (parentFragment instanceof LiveUpdatesFragment) { - ((LiveUpdatesFragment) parentFragment).updateSubscriptionBanner(); + ((LiveUpdatesFragment) parentFragment).updateSubscriptionHeader(); } }