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,100 +14,141 @@
|
|||
|
||||
<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"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/calendarImageView"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_data"/>
|
||||
<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">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/montReportsSpinner"
|
||||
osmand:layout_gravity="fill_horizontal|fill_vertical"
|
||||
android:layout_marginRight="56dp"
|
||||
android:gravity="center_vertical"/>
|
||||
<ImageView
|
||||
android:id="@+id/calendarImageView"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_data"/>
|
||||
|
||||
<Spinner
|
||||
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/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"
|
||||
osmand:layout_column="1"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<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"/>
|
||||
|
||||
<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">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reports_for"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
<ImageView
|
||||
android:id="@+id/regionIconImageView"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_world_globe_dark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="fill_horizontal"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="Worldwide"/>
|
||||
android:layout_weight="1"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reports_for"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
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,146 +156,189 @@
|
|||
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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numberOfContributorsTitle"
|
||||
<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:text="@string/number_of_contributors"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numberOfContributorsTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/number_of_contributors"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contributorsTextView"
|
||||
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>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contributorsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_column="1"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfEditsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_map"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/numberOfEditsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numberOfEditsTitle"
|
||||
<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:text="@string/number_of_edits"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/editsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/numberOfEditsTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/number_of_edits"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/donationsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_bitcoin"/>
|
||||
<TextView
|
||||
android:id="@+id/editsTextView"
|
||||
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
|
||||
android:id="@+id/donationsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationsTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/donations"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
osmand:layout_column="1"
|
||||
android:layout_marginLeft="56dp"
|
||||
android:background="?attr/dashboard_divider"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/numberOfRecipientsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_group"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/numberOfRecipientsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
osmand:layout_gravity="fill_vertical"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="60dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numberOfRecipientsTitle"
|
||||
<ImageView
|
||||
android:id="@+id/donationsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_action_bitcoin"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/donationsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/number_of_recipients"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationsTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/donations"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donationsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recipientsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="-"
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.GridLayout>
|
||||
<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/numberOfRecipientsIcon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_group"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/numberOfRecipientsLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numberOfRecipientsTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/number_of_recipients"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/recipientsTextView"
|
||||
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>
|
||||
|
||||
</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));
|
||||
lastUpdateTextView.setText(getString(R.string.last_update, lastCheckString));
|
||||
|
||||
|
||||
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,10 +84,26 @@ 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() {
|
||||
|
||||
@Override
|
||||
|
@ -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,8 +146,10 @@ 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);
|
||||
numberOfRecipientsIcon = (ImageView) view.findViewById(R.id.numberOfRecipientsIcon);
|
||||
|
@ -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,18 +166,40 @@ 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 (ViewCompat.isLaidOut(tabLayout)) {
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
if (Build.VERSION.SDK_INT >= 11) {
|
||||
if (ViewCompat.isLaidOut(tabLayout)) {
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
} else {
|
||||
tabLayout.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
||||
int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
tabLayout.removeOnLayoutChangeListener(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
tabLayout.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||
ViewTreeObserver vto = view.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
||||
int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
tabLayout.removeOnLayoutChangeListener(this);
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -346,9 +369,9 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
} else {
|
||||
new SaveWithAdvancedTagsDialogFragment().show(getChildFragmentManager(), "dialog");
|
||||
}
|
||||
} else if(editPoiData.getPoiCategory() == getMyApplication().getPoiTypes().getOtherPoiCategory()) {
|
||||
} else if (editPoiData.getPoiCategory() == getMyApplication().getPoiTypes().getOtherPoiCategory()) {
|
||||
poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type));
|
||||
} else if(editPoiData.getPoiTypeDefined() == null) {
|
||||
} else if (editPoiData.getPoiTypeDefined() == null) {
|
||||
poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type_only_from_list));
|
||||
} else {
|
||||
save();
|
||||
|
@ -372,7 +395,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
node.putTag(editPoiData.getPoiCategory().getDefaultTag(), tag.getValue());
|
||||
|
||||
}
|
||||
if(offlineEdit && !Algorithms.isEmpty(tag.getValue())) {
|
||||
if (offlineEdit && !Algorithms.isEmpty(tag.getValue())) {
|
||||
node.putTag(tag.getKey(), tag.getValue());
|
||||
}
|
||||
} else if (!Algorithms.isEmpty(tag.getKey()) && !Algorithms.isEmpty(tag.getValue())) {
|
||||
|
@ -460,7 +483,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
@Override
|
||||
protected void onPostExecute(Node result) {
|
||||
progress.dismiss();
|
||||
if(postExecute != null) {
|
||||
if (postExecute != null) {
|
||||
postExecute.processResult(result);
|
||||
}
|
||||
}
|
||||
|
@ -476,9 +499,9 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
private void setAdapterForPoiTypeEditText() {
|
||||
final Map<String, PoiType> subCategories = new LinkedHashMap<>();
|
||||
PoiCategory ct = editPoiData.getPoiCategory();
|
||||
if(ct != null) {
|
||||
if (ct != null) {
|
||||
for (PoiType s : ct.getPoiTypes()) {
|
||||
if(!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) {
|
||||
if (!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) {
|
||||
addMapEntryAdapter(subCategories, s.getTranslation(), s);
|
||||
addMapEntryAdapter(subCategories, s.getKeyName().replace('_', ' '), s);
|
||||
}
|
||||
|
@ -663,11 +686,11 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
deleteNode(n, c, closeChangeSet);
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
|
||||
private void deleteNode(final Node n, final String c, final boolean closeChangeSet) {
|
||||
final boolean isLocalEdit = openstreetmapUtil instanceof OpenstreetmapLocalUtil;
|
||||
commitNode(OsmPoint.Action.DELETE, n, openstreetmapUtil.getEntityInfo(n.getId()), c, closeChangeSet,
|
||||
|
@ -727,7 +750,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
.setNegativeButton(R.string.shared_string_cancel, null);
|
||||
return builder.create();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private TextView.OnEditorActionListener mOnEditorActionListener =
|
||||
new TextView.OnEditorActionListener() {
|
||||
|
|
Loading…
Reference in a new issue