DownloadInex updated ui
This commit is contained in:
parent
f193bd678d
commit
e7865effac
4 changed files with 38 additions and 8 deletions
|
@ -54,6 +54,17 @@
|
||||||
android:textSize="@dimen/download_descr_text_size"
|
android:textSize="@dimen/download_descr_text_size"
|
||||||
tools:text="@string/lorem_ipsum"
|
tools:text="@string/lorem_ipsum"
|
||||||
android:maxLines="1"/>
|
android:maxLines="1"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/uptodate_descr"
|
||||||
|
style="@style/ListText.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/download_descr_text_size"
|
||||||
|
tools:text="@string/lorem_ipsum"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="@dimen/list_header_height"
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="@dimen/list_header_height"
|
||||||
android:paddingLeft="@dimen/list_header_padding">
|
android:paddingLeft="@dimen/list_header_padding">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@ -19,7 +20,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/list_header_text_left_margin"
|
android:layout_marginLeft="@dimen/list_header_text_left_margin"
|
||||||
android:layout_marginTop="@dimen/list_header_top_margin"
|
android:layout_marginTop="@dimen/list_header_top_margin"
|
||||||
android:maxLines="1"
|
|
||||||
android:textSize="@dimen/list_header_text_size"
|
android:textSize="@dimen/list_header_text_size"
|
||||||
tools:text="@string/lorem_ipsum"/>
|
tools:text="@string/lorem_ipsum"/>
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
<item name="expandable_list_item_background">@color/expandable_list_item_light</item>
|
<item name="expandable_list_item_background">@color/expandable_list_item_light</item>
|
||||||
<item name="expandable_list_background">@color/color_white</item>
|
<item name="expandable_list_background">@color/color_white</item>
|
||||||
<item name="list_settings_icon">@drawable/ic_overflow_menu_light</item>
|
<item name="list_settings_icon">@drawable/ic_overflow_menu_light</item>
|
||||||
<item name="size_progress_bar">@drawable/size_progressbar_dark</item>
|
<item name="size_progress_bar">@drawable/size_progressbar_light</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
|
||||||
|
@ -206,7 +206,7 @@
|
||||||
<item name="expandable_list_item_background">@color/list_item_background_dark</item>
|
<item name="expandable_list_item_background">@color/list_item_background_dark</item>
|
||||||
<item name="expandable_list_background">@color/list_background_dark</item>
|
<item name="expandable_list_background">@color/list_background_dark</item>
|
||||||
<item name="list_settings_icon">@drawable/ic_overflow_menu_dark</item>
|
<item name="list_settings_icon">@drawable/ic_overflow_menu_dark</item>
|
||||||
<item name="size_progress_bar">@drawable/size_progressbar_light</item>
|
<item name="size_progress_bar">@drawable/size_progressbar_dark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
|
<style name="Widget.Styled.ActionBarDark" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
|
||||||
|
|
|
@ -228,8 +228,10 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
|
||||||
}
|
}
|
||||||
final View row = v;
|
final View row = v;
|
||||||
TextView name = (TextView) row.findViewById(R.id.name);
|
TextView name = (TextView) row.findViewById(R.id.name);
|
||||||
TextView edition = (TextView) row.findViewById(R.id.update_descr);
|
TextView update = (TextView) row.findViewById(R.id.update_descr);
|
||||||
edition.setText("");
|
update.setText("");
|
||||||
|
TextView uptodate = (TextView) row.findViewById(R.id.uptodate_descr);
|
||||||
|
uptodate.setText("");
|
||||||
TextView description = (TextView) row.findViewById(R.id.download_descr);
|
TextView description = (TextView) row.findViewById(R.id.download_descr);
|
||||||
IndexItem e = (IndexItem) getChild(groupPosition, childPosition);
|
IndexItem e = (IndexItem) getChild(groupPosition, childPosition);
|
||||||
OsmandApplication clctx = downloadFragment.getMyApplication();
|
OsmandApplication clctx = downloadFragment.getMyApplication();
|
||||||
|
@ -264,21 +266,38 @@ public class DownloadIndexAdapter extends OsmandBaseExpandableListAdapter implem
|
||||||
}
|
}
|
||||||
} else if (e.getDate(format) != null) {
|
} else if (e.getDate(format) != null) {
|
||||||
String sfName = e.getTargetFileName();
|
String sfName = e.getTargetFileName();
|
||||||
|
|
||||||
final boolean updatableResource = indexActivatedFileNames.containsKey(sfName);
|
final boolean updatableResource = indexActivatedFileNames.containsKey(sfName);
|
||||||
if (updatableResource && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
|
if (updatableResource && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
|
||||||
description.setText(indexActivatedFileNames.get(sfName) + " " + e.getSizeDescription(clctx));
|
description.setText(indexActivatedFileNames.get(sfName) + " " + e.getSizeDescription(clctx));
|
||||||
|
//up to date
|
||||||
|
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)) {
|
} else if (indexFileNames.containsKey(sfName) && !DownloadActivity.downloadListIndexThread.checkIfItemOutdated(e)) {
|
||||||
description.setText(indexFileNames.get(sfName) + " " + e.getSizeDescription(clctx));
|
description.setText(indexFileNames.get(sfName) + " " + e.getSizeDescription(clctx));
|
||||||
|
//up to date
|
||||||
|
uptodate.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||||
|
+ indexFileNames.get(sfName));
|
||||||
|
uptodate.setVisibility(View.VISIBLE);
|
||||||
|
update.setVisibility(View.GONE);
|
||||||
} else if (updatableResource) {
|
} else if (updatableResource) {
|
||||||
String updatedDescr = indexActivatedFileNames.get(sfName) + " " + e.getSizeDescription(clctx);
|
String updatedDescr = indexActivatedFileNames.get(sfName) + " " + e.getSizeDescription(clctx);
|
||||||
description.setText(updatedDescr);
|
description.setText(updatedDescr);
|
||||||
edition.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
//needed to be updated
|
||||||
|
update.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||||
+ e.getDate(format));
|
+ e.getDate(format));
|
||||||
|
uptodate.setVisibility(View.GONE);
|
||||||
|
update.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} 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));
|
+ indexFileNames.get(sfName));
|
||||||
edition.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
//needed to be updated
|
||||||
|
update.setText(downloadFragment.getResources().getString(R.string.local_index_installed) + " : "
|
||||||
+ e.getDate(format));
|
+ e.getDate(format));
|
||||||
|
uptodate.setVisibility(View.GONE);
|
||||||
|
update.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue