Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b3319401c8
6 changed files with 318 additions and 182 deletions
|
@ -34,6 +34,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="12sp"
|
||||
|
@ -44,7 +45,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_white"
|
||||
|
|
|
@ -14,77 +14,109 @@
|
|||
|
||||
<include layout="@layout/card_top_divider"/>
|
||||
|
||||
<android.support.v7.widget.GridLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/bg_color"
|
||||
osmand:columnCount="2">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_columnSpan="2"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="48dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/select_month_and_country"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
<net.osmand.plus.widgets.ButtonEx
|
||||
android:id="@+id/show_all"
|
||||
style="@style/DashboardGeneralButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:text="@string/shared_string_all"
|
||||
android:textColor="?attr/contextMenuButtonColor"
|
||||
osmand:textAllCapsCompat="true"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_columnSpan="2"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/monthButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:clickable="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/calendarImageView"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_data"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/montReportsSpinner"
|
||||
osmand:layout_gravity="fill_horizontal|fill_vertical"
|
||||
android:layout_marginRight="56dp"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<View
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_column="1"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
android:id="@+id/monthReportsSpinner"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="-8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:clickable="false"
|
||||
android:background="@null"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/regionIconImageView"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:paddingTop="4dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_world_globe_dark"/>
|
||||
android:id="@+id/monthDropDownIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="16dp"
|
||||
android:src="@drawable/ic_action_arrow_drop_down"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/reportsButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="4dp">
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:clickable="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/regionIconImageView"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_world_globe_dark"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -99,15 +131,24 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="fill_horizontal"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="Worldwide"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/countryDropDownIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="16dp"
|
||||
android:src="@drawable/ic_action_arrow_drop_down"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_to_hide"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_columnSpan="2"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<ProgressBar
|
||||
|
@ -115,25 +156,29 @@
|
|||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="9dp"
|
||||
osmand:layout_columnSpan="2"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfContributorsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_group"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/numberOfContributorsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="4dp">
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfContributorsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_group"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numberOfContributorsTitle"
|
||||
|
@ -148,27 +193,38 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_column="1"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfEditsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_map"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/numberOfEditsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfEditsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_map"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -184,13 +240,29 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/donationsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_bitcoin"/>
|
||||
|
||||
|
@ -198,8 +270,7 @@
|
|||
android:id="@+id/donationsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -215,14 +286,25 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_column="1"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfRecipientsIcon"
|
||||
android:layout_width="56dp"
|
||||
|
@ -234,8 +316,7 @@
|
|||
android:id="@+id/numberOfRecipientsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
@ -251,10 +332,13 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.GridLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
|
||||
|
|
|
@ -30,12 +30,6 @@
|
|||
app:typeface="@string/font_roboto_regular"/>
|
||||
|
||||
</LinearLayout>
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/progress"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -51,6 +45,13 @@
|
|||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="9dp"
|
||||
android:id="@+id/progress"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -22,7 +22,6 @@ import net.osmand.PlatformUtil;
|
|||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.LocalIndexInfo;
|
||||
import net.osmand.plus.download.AbstractDownloadActivity;
|
||||
import net.osmand.plus.download.DownloadActivity;
|
||||
import net.osmand.plus.liveupdates.LiveUpdatesHelper.TimeOfDay;
|
||||
|
@ -41,6 +40,7 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
|
|||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceDownloadViaWiFi;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceForLocalIndex;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceTimeOfDayToUpdate;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFrequency;
|
||||
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.runLiveUpdate;
|
||||
|
@ -78,7 +78,15 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
|||
String lastCheckString = formatDateTime(getActivity(), lastCheck != DEFAULT_LAST_CHECK
|
||||
? lastCheck : timestamp);
|
||||
lastMapChangeTextView.setText(getString(R.string.last_map_change, lastUpdateDate));
|
||||
|
||||
|
||||
OsmandSettings.CommonPreference<Boolean> preference = preferenceLiveUpdatesOn(localIndexInfo,
|
||||
getSettings());
|
||||
if (preference.get()) {
|
||||
lastUpdateTextView.setText(getString(R.string.last_update, lastCheckString));
|
||||
} else {
|
||||
lastUpdateTextView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
final OsmandSettings.CommonPreference<Boolean> liveUpdatePreference =
|
||||
preferenceForLocalIndex(localIndexInfo, getSettings());
|
||||
|
@ -98,7 +106,7 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
|||
for (int i = 0; i < timeOfDays.length; i++) {
|
||||
timeOfDaysStrings[i] = getString(timeOfDays[i].getLocalizedId());
|
||||
}
|
||||
updateTimesOfDaySpinner.setAdapter(new ArrayAdapter<String>(getActivity(),
|
||||
updateTimesOfDaySpinner.setAdapter(new ArrayAdapter<>(getActivity(),
|
||||
R.layout.action_spinner_item, timeOfDaysStrings));
|
||||
updateTimesOfDaySpinner.setSelection(timeOfDayPreference.get());
|
||||
|
||||
|
@ -109,7 +117,7 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
|||
}
|
||||
|
||||
refreshTimeOfDayLayout(UpdateFrequency.values()[updateFrequencyPreference.get()], updateTimesOfDayLayout);
|
||||
updateFrequencySpinner.setAdapter(new ArrayAdapter<String>(getActivity(),
|
||||
updateFrequencySpinner.setAdapter(new ArrayAdapter<>(getActivity(),
|
||||
R.layout.action_spinner_item, updateFrequenciesStrings));
|
||||
updateFrequencySpinner.setSelection(updateFrequencyPreference.get());
|
||||
updateFrequencySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
|
|
|
@ -11,6 +11,7 @@ import android.support.annotation.AttrRes;
|
|||
import android.support.annotation.ColorInt;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -24,6 +25,7 @@ import android.widget.TextView;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.osm.io.NetworkUtils;
|
||||
import net.osmand.plus.R;
|
||||
|
@ -55,7 +57,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
private TextView donationsTextView;
|
||||
private TextView recipientsTextView;
|
||||
|
||||
private Spinner montReportsSpinner;
|
||||
private Spinner monthReportsSpinner;
|
||||
private MonthsForReportsAdapter monthsForReportsAdapter;
|
||||
|
||||
private CountrySelectionFragment countrySelectionFragment = new CountrySelectionFragment();
|
||||
|
@ -82,9 +84,25 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_reports, container, false);
|
||||
montReportsSpinner = (Spinner) view.findViewById(R.id.montReportsSpinner);
|
||||
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());
|
||||
montReportsSpinner.setAdapter(monthsForReportsAdapter);
|
||||
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() {
|
||||
|
||||
|
@ -105,7 +123,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
OnClickListener listener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int monthItemPosition = montReportsSpinner.getSelectedItemPosition();
|
||||
int monthItemPosition = monthReportsSpinner.getSelectedItemPosition();
|
||||
String monthUrlString = monthsForReportsAdapter.getQueryString(monthItemPosition);
|
||||
String countryUrlString = selectedCountryItem.getDownloadName();
|
||||
if (countryUrlString.length() > 0) {
|
||||
|
@ -128,7 +146,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);
|
||||
|
@ -167,7 +187,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
|
||||
}
|
||||
};
|
||||
montReportsSpinner.setOnItemSelectedListener(onItemSelectedListener);
|
||||
monthReportsSpinner.setOnItemSelectedListener(onItemSelectedListener);
|
||||
|
||||
inactiveColor = getColorFromAttr(R.attr.plugin_details_install_header_bg);
|
||||
textColorPrimary = getColorFromAttr(android.R.attr.textColorPrimary);
|
||||
|
@ -177,7 +197,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
}
|
||||
|
||||
public void requestAndUpdateUi() {
|
||||
int monthItemPosition = montReportsSpinner.getSelectedItemPosition();
|
||||
int monthItemPosition = monthReportsSpinner.getSelectedItemPosition();
|
||||
String monthUrlString = monthsForReportsAdapter.getQueryString(monthItemPosition);
|
||||
String countryUrlString = selectedCountryItem.getDownloadName();
|
||||
|
||||
|
@ -260,7 +280,7 @@ public class ReportsFragment extends BaseOsmAndFragment implements CountrySelect
|
|||
private static class MonthsForReportsAdapter extends ArrayAdapter<String> {
|
||||
private static final SimpleDateFormat queryFormat = new SimpleDateFormat("yyyy-MM", Locale.US);
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private static final SimpleDateFormat humanFormat = new SimpleDateFormat("MMMM yyyy");
|
||||
private static final SimpleDateFormat humanFormat = new SimpleDateFormat("LLLL yyyy");
|
||||
|
||||
ArrayList<String> queryString = new ArrayList<>();
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.AdapterView;
|
||||
|
@ -165,9 +166,11 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
final TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tab_layout);
|
||||
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
|
||||
|
||||
// tabLayout.setupWithViewPager(viewPager);
|
||||
// Hack due to bug in design support library v22.2.1
|
||||
// https://code.google.com/p/android/issues/detail?id=180462
|
||||
// TODO remove in new version
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
if (ViewCompat.isLaidOut(tabLayout)) {
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
} else {
|
||||
|
@ -180,6 +183,26 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
ViewTreeObserver vto = view.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
|
||||
ViewTreeObserver obs = view.getViewTreeObserver();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
obs.removeOnGlobalLayoutListener(this);
|
||||
} else {
|
||||
obs.removeGlobalOnLayoutListener(this);
|
||||
}
|
||||
|
||||
if (getActivity() != null) {
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ImageButton onlineDocumentationButton =
|
||||
(ImageButton) view.findViewById(R.id.onlineDocumentationButton);
|
||||
|
|
Loading…
Reference in a new issue