Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
36c92ab22e
2 changed files with 4 additions and 17 deletions
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue