From 46fe672561227c5dde8f2544281bde813053e38a Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Thu, 10 Mar 2016 11:10:12 +0200 Subject: [PATCH] reports fix of fallback. --- OsmAnd/res/layout/fragment_reports.xml | 446 +++++++++++------- .../plus/liveupdates/ReportsFragment.java | 29 +- 2 files changed, 286 insertions(+), 189 deletions(-) diff --git a/OsmAnd/res/layout/fragment_reports.xml b/OsmAnd/res/layout/fragment_reports.xml index c1346583f8..0263257b24 100644 --- a/OsmAnd/res/layout/fragment_reports.xml +++ b/OsmAnd/res/layout/fragment_reports.xml @@ -1,6 +1,6 @@ - - + android:orientation="vertical"> + + + + + + + + + + - - - - - - - - + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:gravity="center_vertical" + android:minHeight="60dp" + android:orientation="horizontal"> - + - + android:layout_marginRight="16dp" + android:layout_weight="1" + android:orientation="vertical"> + + + + + + + + - - + - + android:orientation="vertical"> - - - + android:layout_height="wrap_content"> - + - - - + android:background="?attr/selectableItemBackground" + android:gravity="center_vertical" + android:minHeight="60dp" + android:orientation="horizontal"> - - + + + + + + + + + + + - - + android:background="?attr/selectableItemBackground" + android:gravity="center_vertical" + android:minHeight="60dp" + android:orientation="horizontal"> - + + + android:layout_marginRight="16dp" + android:orientation="vertical"> + + + + + - - - + android:gravity="center_vertical" + android:minHeight="60dp" + android:orientation="horizontal"> - + + + android:layout_marginRight="16dp" + android:orientation="vertical"> + + + + + - - - + android:gravity="center_vertical" + android:minHeight="60dp" + android:orientation="horizontal"> - + + + android:layout_marginRight="16dp" + android:orientation="vertical"> + + + + + - - + - + card_view:cardBackgroundColor="?attr/bg_color" + card_view:cardCornerRadius="4dp"> - + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:gravity="center_vertical" + android:minHeight="48dp" + android:orientation="vertical" + android:padding="16dp"> - - + + + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java index 0eac451a67..ed9ab20108 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/ReportsFragment.java @@ -75,7 +75,6 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect private TextView numberOfRecipientsTitle; private TextView donationsTitle; private ProgressBar progressBar; - private View dividerToHide; private int inactiveColor; private int textColorPrimary; @@ -86,9 +85,25 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_reports, container, false); monthReportsSpinner = (Spinner) view.findViewById(R.id.monthReportsSpinner); + final View monthButton = view.findViewById(R.id.monthButton); + monthReportsSpinner.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + event.offsetLocation(AndroidUtils.dpToPx(getActivity(), 48f), 0); + monthButton.onTouchEvent(event); + return true; + } + }); monthsForReportsAdapter = new MonthsForReportsAdapter(getActivity()); monthReportsSpinner.setAdapter(monthsForReportsAdapter); + monthButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + monthReportsSpinner.performClick(); + } + }); + view.findViewById(R.id.show_all).setOnClickListener(new OnClickListener() { @Override @@ -132,7 +147,9 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect countryNameTextView.setText(selectedCountryItem.getLocalName()); setThemedDrawable(view, R.id.calendarImageView, R.drawable.ic_action_data); + setThemedDrawable(view, R.id.monthDropDownIcon, R.drawable.ic_action_arrow_drop_down); setThemedDrawable(view, R.id.regionIconImageView, R.drawable.ic_world_globe_dark); + setThemedDrawable(view, R.id.countryDropDownIcon, R.drawable.ic_action_arrow_drop_down); numberOfContributorsIcon = (ImageView) view.findViewById(R.id.numberOfContributorsIcon); numberOfEditsIcon = (ImageView) view.findViewById(R.id.numberOfEditsIcon); @@ -156,8 +173,6 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect donationsTextView = (TextView) view.findViewById(R.id.donationsTextView); recipientsTextView = (TextView) view.findViewById(R.id.recipientsTextView); - dividerToHide = view.findViewById(R.id.divider_to_hide); - requestAndUpdateUi(); AdapterView.OnItemSelectedListener onItemSelectedListener = new AdapterView.OnItemSelectedListener() { @@ -356,8 +371,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect donationsTitle.setTextColor(inactiveColor); progressBar.setVisibility(View.VISIBLE); - dividerToHide.setVisibility(View.GONE); - + contributorsTextView.setTextColor(inactiveColor); donationsTextView.setTextColor(inactiveColor); recipientsTextView.setTextColor(inactiveColor); @@ -375,9 +389,8 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect numberOfRecipientsTitle.setTextColor(textColorSecondary); donationsTitle.setTextColor(textColorSecondary); - progressBar.setVisibility(View.GONE); - dividerToHide.setVisibility(View.VISIBLE); - + progressBar.setVisibility(View.INVISIBLE); + contributorsTextView.setTextColor(textColorPrimary); editsTextView.setTextColor(textColorPrimary); donationsTextView.setTextColor(textColorPrimary);