Fix Live Subscr UI

This commit is contained in:
Alexey Kulish 2016-02-08 12:50:42 +03:00
parent b4f446d4e4
commit 3e96a9a8f4
2 changed files with 12 additions and 1 deletions

View file

@ -9,7 +9,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="56dp"
android:background="@color/osmand_orange" android:background="?attr/pstsTabBackground"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">

View file

@ -24,6 +24,7 @@ import android.view.SubMenu;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AbsListView; import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.Button; import android.widget.Button;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.ExpandableListView; import android.widget.ExpandableListView;
@ -140,6 +141,16 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList
updateSubscriptionHeader(); updateSubscriptionHeader();
listView.addHeaderView(subscriptionHeader); 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(); loadLocalIndexesTask = new LoadLocalIndexTask(adapter, this).execute();
return view; return view;