From 3e96a9a8f416ca65046763e6d4f441d14e2b8b6e Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Mon, 8 Feb 2016 12:50:42 +0300 Subject: [PATCH] Fix Live Subscr UI --- OsmAnd/res/layout/subscription_fragment.xml | 2 +- .../osmand/plus/liveupdates/LiveUpdatesFragment.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/layout/subscription_fragment.xml b/OsmAnd/res/layout/subscription_fragment.xml index f0fe2ad0ad..9c16f1b7f2 100644 --- a/OsmAnd/res/layout/subscription_fragment.xml +++ b/OsmAnd/res/layout/subscription_fragment.xml @@ -9,7 +9,7 @@ diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index 93e2fe0004..136fb62391 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -24,6 +24,7 @@ import android.view.SubMenu; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; +import android.widget.AdapterView; import android.widget.Button; import android.widget.CompoundButton; import android.widget.ExpandableListView; @@ -140,6 +141,16 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList updateSubscriptionHeader(); listView.addHeaderView(subscriptionHeader); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + if (position == 0 && !processing && InAppHelper.isSubscribedToLiveUpdates()) { + SubscriptionFragment subscriptionFragment = new SubscriptionFragment(); + subscriptionFragment.setEditMode(true); + subscriptionFragment.show(getChildFragmentManager(), SubscriptionFragment.TAG); + } + } + }); loadLocalIndexesTask = new LoadLocalIndexTask(adapter, this).execute(); return view;