Fix SelectSearchImageLayout orientaion
This commit is contained in:
1 parent
2558a3770a
commit
40cfddb348
2 files changed
+8
-6
No files matched your search
@@ -77,10 +77,10 @@ public class SelectSearchImageLayout extends LinearLayout implements View.OnClic
|
||||
LayoutInflater.from(context).inflate(R.layout.widget_select_search_image_layout, this);
|
||||
|
||||
// TODO It is a bad idea.
|
||||
int childCount = getChildCount();
|
||||
if (childCount == 3) {
|
||||
View firstChild = getChildAt(0);
|
||||
if (firstChild instanceof TextView) {
|
||||
setOrientation(LinearLayout.VERTICAL);
|
||||
} else if (childCount == 2) {
|
||||
} else if (firstChild instanceof LinearLayout) {
|
||||
setOrientation(LinearLayout.HORIZONTAL);
|
||||
} else {
|
||||
throw new IllegalStateException("Can't guess orientation, did you changed the layout res ?");
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingRight="@dimen/search_item_interval_half"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
@@ -41,11 +40,14 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.hippo.widget.Space
|
||||
android:layout_width="@dimen/search_item_interval"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="@dimen/search_item_interval_half">
|
||||
android:layout_weight="1">
|
||||
|
||||
<com.hippo.widget.FixedAspectImageView
|
||||
android:id="@+id/search_select_image_image"
|
||||
|
||||
Reference in new issue
Block a user