Fixed layout for local indexes

This commit is contained in:
Bars107 2015-02-03 14:54:45 +02:00
parent 7d15231862
commit c3b5658888
5 changed files with 100 additions and 93 deletions

View file

@ -1,102 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<net.osmand.plus.views.controls.PagerSlidingTabStrip
android:id="@+id/sliding_tabs"
android:layout_width="fill_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
<net.osmand.plus.views.controls.PagerSlidingTabStrip
android:id="@+id/sliding_tabs"
android:layout_width="fill_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
<LinearLayout
android:id="@+id/ProgressView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<LinearLayout
android:id="@+id/ProgressView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|left"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|left"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/IndeterminateProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone"/>
<ProgressBar
android:id="@+id/IndeterminateProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:indeterminateOnly="true"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/ProgressPercent"
android:layout_width="48dp"
android:layout_alignParentRight="true"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="right|center_vertical"
android:text=""
android:textSize="14sp"/>
<TextView
android:id="@+id/ProgressPercent"
android:layout_width="48dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right|center_vertical"
android:maxLines="1"
android:text=""
android:textSize="14sp"
tools:text="@string/lorem_ipsum" />
<TextView
android:id="@+id/ProgressMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/ProgressPercent"
android:layout_toRightOf="@id/IndeterminateProgressBar"
android:ellipsize="end"
android:gravity="left|center_vertical"
android:singleLine="true"
android:text=""
android:textSize="14sp"/>
</RelativeLayout>
<TextView
android:id="@+id/ProgressMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_toLeftOf="@id/ProgressPercent"
android:layout_toRightOf="@id/IndeterminateProgressBar"
android:ellipsize="end"
android:gravity="left|center_vertical"
android:singleLine="true"
android:text=""
android:textSize="14sp"
tools:text="@string/lorem_ipsum" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/DeterminateProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<ProgressBar
android:id="@+id/DeterminateProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/a_1_navigation_cancel_small_dark"/>
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/a_1_navigation_cancel_small_dark" />
</LinearLayout>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<Button
android:id="@+id/DownloadButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/downloadButtonBackground"
android:textColor="?attr/pstsTextColor"
android:gravity="center"
android:text="@string/download_files"
android:visibility="gone"/>
<Button
android:id="@+id/DownloadButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/downloadButtonBackground"
android:gravity="center"
android:text="@string/download_files"
android:textColor="?attr/pstsTextColor"
android:visibility="gone" />
</LinearLayout>

View file

@ -18,9 +18,6 @@
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:groupIndicator="@android:color/transparent"
style="@style/OsmandListView"/>

View file

@ -3,10 +3,10 @@
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="@dimen/list_content_padding"
android:paddingRight="@dimen/list_content_padding"
android:paddingLeft="@dimen/list_content_padding">
android:paddingTop="4dp"
android:paddingBottom="4dp">
<LinearLayout
android:layout_width="fill_parent"

View file

@ -49,6 +49,7 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@ -1003,6 +1004,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
v.findViewById(R.id.explist_indicator).setVisibility(View.GONE);
TextView nameView = ((TextView) v.findViewById(R.id.category_name));
nameView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
List<LocalIndexInfo> list = data.get(group);
int size = 0;
for (LocalIndexInfo aList : list) {

View file

@ -192,7 +192,9 @@ public class PagerSlidingTabStrip extends HorizontalScrollView {
tabTypefaceSelectedStyle = a.getInt(R.styleable.PagerSlidingTabStrip_pstsTextSelectedStyle, Typeface.BOLD);
tabTextAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextAlpha, HALF_TRANSP);
tabTextSelectedAlpha = a.getFloat(R.styleable.PagerSlidingTabStrip_pstsTextSelectedAlpha, OPAQUE);
tabTypeface = FontCache.getRobotoMedium(context);
if (!isInEditMode()) {
tabTypeface = FontCache.getRobotoMedium(context);
}
a.recycle();
setMarginBottomTabContainer();