Data storage folder dialog styling.

This commit is contained in:
GaidamakUA 2015-10-27 15:13:24 +02:00
parent 98cab00db7
commit a15849b197
6 changed files with 32 additions and 8 deletions

View file

@ -3,6 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="?attr/bottom_menu_view_bg"
tools:context="net.osmand.plus.download.ui.DataStoragePlaceDialogFragment"> tools:context="net.osmand.plus.download.ui.DataStoragePlaceDialogFragment">
<ImageView <ImageView

View file

@ -141,8 +141,13 @@
<item name="colorAccent">@color/color_white</item> <item name="colorAccent">@color/color_white</item>
</style> </style>
<style name="FreeVersionBanner" parent="OsmandDarkTheme">
<item name="android:textColor">@color/color_white</item> <style name="OsmandLightTheme.BottomSheet">
<item name="android:dialogTheme">@style/BottomSheet.Dialog</item>
</style>
<style name="OsmandDarkTheme.BottomSheet">
<item name="android:dialogTheme">@style/BottomSheet.Dialog</item>
</style> </style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat"> <style name="OsmandDarkTheme" parent="Theme.AppCompat">
@ -201,6 +206,9 @@
<item name="contextMenuButtonColor">@color/osmand_orange</item> <item name="contextMenuButtonColor">@color/osmand_orange</item>
</style> </style>
<style name="FreeVersionBanner" parent="OsmandDarkTheme">
<item name="android:textColor">@color/color_white</item>
</style>
<!-- Standard action bar override --> <!-- Standard action bar override -->
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse"> <style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
@ -294,13 +302,11 @@
<item name="android:textColor">@null</item> <item name="android:textColor">@null</item>
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
<item name="android:layout_width">fill_parent</item> <item name="android:layout_width">fill_parent</item>
<item name="android:windowBackground">@color/color_white</item> <item name="android:windowBackground">@null</item>
<item name="android:windowIsFloating">true</item> <item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
<item name="android:backgroundDimAmount">0.3</item> <item name="android:backgroundDimAmount">0.3</item>
<item name="android:backgroundDimEnabled">true</item> <item name="android:backgroundDimEnabled">true</item>
<item name="android:textColorPrimary">@color/dashboard_black</item>
<item name="android:textColorSecondary">@color/icon_color</item>
</style> </style>
</resources> </resources>

View file

@ -34,7 +34,11 @@ public class DataStoragePlaceDialogFragment extends DialogFragment {
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
final Dialog dialog = new Dialog(getActivity(), R.style.BottomSheet_Dialog); boolean isLightTheme = ((OsmandApplication) getActivity().getApplication())
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
int themeId = isLightTheme ? R.style.OsmandLightTheme_BottomSheet
: R.style.OsmandDarkTheme_BottomSheet;
final Dialog dialog = new Dialog(getActivity(), themeId);
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
return dialog; return dialog;
} }

View file

@ -82,6 +82,7 @@ public class AdvancedEditPoiFragment extends Fragment
(LinearLayout) view.findViewById(R.id.editTagsList); (LinearLayout) view.findViewById(R.id.editTagsList);
final MapPoiTypes mapPoiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes(); final MapPoiTypes mapPoiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes();
// TODO: 10/27/15 Probably use executor so loading would be paralleled.
new InitTranslatedTypesTask(mapPoiTypes).execute(); new InitTranslatedTypesTask(mapPoiTypes).execute();
mAdapter = new TagAdapterLinearLayoutHack(editTagsLineaLayout, getData()); mAdapter = new TagAdapterLinearLayoutHack(editTagsLineaLayout, getData());
// TODO do not restart initialization every time, and probably move initialization to appInit // TODO do not restart initialization every time, and probably move initialization to appInit

View file

@ -133,7 +133,7 @@ public class DashOsmEditsFragment extends DashBaseFragment
// TODO: 9/7/15 Redesign osm notes. // TODO: 9/7/15 Redesign osm notes.
private void uploadItem(final OsmPoint point) { private void uploadItem(final OsmPoint point) {
AlertDialog.Builder b = new AlertDialog.Builder(getActivity()); AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
b.setMessage(getString(R.string.local_osm_changes_upload_all_confirm, 1)); b.setMessage(getString(R.string.local_osm_changes_upload_all_confirm));
b.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() { b.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {

View file

@ -52,6 +52,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created by Denis * Created by Denis
@ -509,7 +510,18 @@ public class OsmEditsFragment extends OsmAndListFragment
getString(R.string.local_openstreetmap_uploading), getString(R.string.local_openstreetmap_uploading),
ProgressDialog.STYLE_HORIZONTAL).getDialog(); ProgressDialog.STYLE_HORIZONTAL).getDialog();
OsmEditsUploadListener listener = new OsmEditsUploadListenerHelper(getActivity(), OsmEditsUploadListener listener = new OsmEditsUploadListenerHelper(getActivity(),
getString(R.string.local_openstreetmap_were_uploaded)); getString(R.string.local_openstreetmap_were_uploaded)) {
@Override
public void uploadEnded(Map<OsmPoint, String> loadErrorsMap) {
super.uploadEnded(loadErrorsMap);
for (OsmPoint osmPoint : loadErrorsMap.keySet()) {
if (loadErrorsMap.get(osmPoint) == null) {
listAdapter.remove(osmPoint);
}
}
listAdapter.notifyDataSetChanged();
}
};
UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask( UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(
dialog, listener, plugin, remotepoi, remotebug, points.length, closeChangeSet); dialog, listener, plugin, remotepoi, remotebug, points.length, closeChangeSet);
uploadTask.execute(points); uploadTask.execute(points);