Updated sizes and removed audio video data from local index

This commit is contained in:
Denis 2015-02-18 14:41:48 +02:00
parent 68d48fb9ae
commit 1299e7c265
7 changed files with 42 additions and 33 deletions

View file

@ -5,10 +5,8 @@
android:layout_height="wrap_content"
android:background="?attr/expandable_list_item_background"
android:minHeight="@dimen/list_item_height"
android:paddingBottom="@dimen/download_item_vertical_padding"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:paddingTop="@dimen/download_item_vertical_padding">
android:paddingRight="@dimen/list_content_padding">
<CheckBox
android:id="@+id/check_download_item"
@ -21,6 +19,7 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView

View file

@ -6,10 +6,8 @@
android:background="?attr/expandable_list_item_background"
android:minHeight="@dimen/list_item_height"
android:orientation="horizontal"
android:paddingBottom="@dimen/download_item_vertical_padding"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:paddingTop="@dimen/download_item_vertical_padding">
android:paddingRight="@dimen/list_content_padding">
<CheckBox
android:id="@+id/check_local_index"

View file

@ -6,10 +6,8 @@
android:layout_height="wrap_content"
android:background="?attr/expandable_list_item_background"
android:minHeight="@dimen/list_item_height"
android:paddingBottom="@dimen/download_item_vertical_padding"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:paddingTop="@dimen/download_item_vertical_padding">
android:paddingRight="@dimen/list_content_padding">
<CheckBox
android:id="@+id/check_download_item"

View file

@ -39,7 +39,6 @@
<dimen name="dialog_content_margin">24dp</dimen>
<dimen name="dialog_content_bottom_margin">16dp</dimen>
<dimen name="local_size_height">34dp</dimen>
<dimen name="download_item_vertical_padding">4dp</dimen>
<!-- TextSizes -->
<dimen name="list_header_text_size">14sp</dimen>

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="online_map">Online map</string>
<string name="roads_only">Roads only</string>
<string name="rendering_attr_pisteRoutes_name">Piste routes</string>
<string name="free">Free %1$s </string>

View file

@ -271,14 +271,14 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
if (updatableResource && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
description.setText(indexActivatedFileNames.get(sfName) + " " + e.getSizeDescription(clctx));
//up to date
uptodate.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
uptodate.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + ": "
+ indexActivatedFileNames.get(sfName));
uptodate.setVisibility(View.VISIBLE);
update.setVisibility(View.GONE);
} else if (indexFileNames.containsKey(sfName) && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
description.setText(indexFileNames.get(sfName) + " " + e.getSizeDescription(clctx));
//up to date
uptodate.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
uptodate.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + ": "
+ indexFileNames.get(sfName));
uptodate.setVisibility(View.VISIBLE);
update.setVisibility(View.GONE);
@ -286,15 +286,15 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
String updatedDescr = indexActivatedFileNames.get(sfName) + " " + e.getSizeDescription(clctx);
description.setText(updatedDescr);
//needed to be updated
update.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
update.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + ": "
+ e.getDate(format));
uptodate.setVisibility(View.GONE);
update.setVisibility(View.VISIBLE);
} else {
description.setText(name.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
description.setText(name.getText() + "\n" + downloadFragment.getResources().getString(R.string.local_index_installed) + ": "
+ indexFileNames.get(sfName));
//needed to be updated
update.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
update.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + ": "
+ e.getDate(format));
uptodate.setVisibility(View.GONE);
update.setVisibility(View.VISIBLE);

View file

@ -287,6 +287,10 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
@Override
protected void onProgressUpdate(LocalIndexInfo... values) {
for (LocalIndexInfo v : values) {
//do not show recordings
if (v.getType() == LocalIndexType.AV_DATA){
continue;
}
listAdapter.addLocalIndexInfo(v);
descriptionLoader = new LoadLocalIndexDescriptionTask();
descriptionLoader.execute(v);
@ -301,6 +305,10 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
listAdapter.clear();
} else {
for (LocalIndexInfo v : result) {
//do not show recordings
if (v.getType() == LocalIndexType.AV_DATA){
continue;
}
listAdapter.addLocalIndexInfo(v);
descriptionLoader = new LoadLocalIndexDescriptionTask();
descriptionLoader.execute(v);
@ -502,13 +510,6 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
descriptionLoader.cancel(true);
}
// @Override
// public Object onRetainNonConfigurationInstance() {
// if(asyncLoader != null){
// return asyncLoader.getResult();
// }
// return super.onRetainNonConfigurationInstance();
// }
@SuppressWarnings("deprecation")
@Override
@ -521,6 +522,10 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
//Next line throws NPE in some circumstances when called from dashboard and listAdpater=null is not checked for. (Checking !this.isAdded above is not sufficient!)
if (listAdapter != null && listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) {
for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) {
//do not show recordings
if (info.getType() == LocalIndexType.AV_DATA){
continue;
}
listAdapter.addLocalIndexInfo(info);
}
listAdapter.sortData();
@ -991,9 +996,15 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
} else {
sizeText.setVisibility(View.GONE);
}
TextView descr = ((TextView) v.findViewById(R.id.local_index_descr));
descr.setVisibility(View.VISIBLE);
descr.setText(child.getDescription());
if (child.getType() == LocalIndexType.TILES_DATA) {
descr.setText(R.string.online_map);
} else {
descr.setVisibility(View.VISIBLE);
descr.setText(child.getDescription());
}
final CheckBox checkbox = (CheckBox) v.findViewById(R.id.check_local_index);
@ -1033,16 +1044,19 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
final boolean restore = info.isBackupedData();
MenuItem item;
if (info.getType() == LocalIndexType.MAP_DATA) {
item = optionsMenu.getMenu().add(restore? R.string.local_index_mi_restore : R.string.local_index_mi_backup)
.setIcon(backup);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
performBasicOperation(restore ? R.string.local_index_mi_restore : R.string.local_index_mi_backup, info);
return true;
}
});
}
MenuItem item = optionsMenu.getMenu().add(restore? R.string.local_index_mi_restore : R.string.local_index_mi_backup)
.setIcon(backup);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
performBasicOperation(restore ? R.string.local_index_mi_restore : R.string.local_index_mi_backup, info);
return true;
}
});
item = optionsMenu.getMenu().add(R.string.local_index_mi_rename)
.setIcon(light ? R.drawable.ic_action_edit_light : R.drawable.ic_action_edit_dark);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {