forked from organicmaps/organicmaps
[android] Move bottom btn into constraint layout
This commit is contained in:
parent
6cdade6525
commit
f67b4902ea
3 changed files with 27 additions and 25 deletions
|
@ -74,18 +74,18 @@
|
|||
android:paddingLeft="@dimen/margin_double_and_half"
|
||||
android:paddingRight="@dimen/margin_double_and_half"
|
||||
android:paddingTop="@dimen/placeholder_margin_top"
|
||||
android:paddingBottom="@dimen/placeholder_margin_top"
|
||||
mapsme:imgSrcDefault="@drawable/img_empty_bookmarks"
|
||||
mapsme:titleDefault="@string/cached_bookmarks_placeholder_title"
|
||||
mapsme:subTitleDefault="@string/cached_bookmarks_placeholder_subtitle">
|
||||
<Button
|
||||
android:id="@+id/download_routers_btn"
|
||||
style="@style/MwmWidget.Button.Accent"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:text="@string/downloader_download_routers"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1.Light"/>
|
||||
</com.mapswithme.maps.widget.PlaceholderView>
|
||||
|
||||
mapsme:subTitleDefault="@string/cached_bookmarks_placeholder_subtitle"/>
|
||||
<Button
|
||||
android:id="@+id/download_routers_btn"
|
||||
style="@style/MwmWidget.Button.Accent"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
android:text="@string/downloader_download_routers"
|
||||
mapsme:layout_constraintLeft_toLeftOf="parent"
|
||||
mapsme:layout_constraintRight_toRightOf="parent"
|
||||
mapsme:layout_constraintTop_toBottomOf="@id/placeholder"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1.Light"/>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/placeholder_loading"
|
||||
|
|
|
@ -86,7 +86,7 @@ enum DiscoveryManager
|
|||
if (mCallback == null)
|
||||
return;
|
||||
|
||||
if (isAggregateResultsEmpty(results, type))
|
||||
if (isAggregateResultsEmpty(results, type) || true)
|
||||
{
|
||||
mCallback.onNotFound();
|
||||
return;
|
||||
|
|
|
@ -25,11 +25,16 @@ import com.mapswithme.util.UiUtils;
|
|||
|
||||
public class PlaceholderView extends LinearLayout
|
||||
{
|
||||
@Nullable
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private ImageView mImage;
|
||||
@Nullable
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private TextView mTitle;
|
||||
@Nullable
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private TextView mSubtitle;
|
||||
|
||||
private int mImgMaxHeight;
|
||||
|
@ -131,23 +136,23 @@ public class PlaceholderView extends LinearLayout
|
|||
|
||||
private void setupDefaultContent()
|
||||
{
|
||||
if (isDefaultValueValid(mImage, mImgSrcDefault))
|
||||
if (isDefaultValueValid(mImgSrcDefault))
|
||||
{
|
||||
mImage.setImageResource(mImgSrcDefault);
|
||||
}
|
||||
if (isDefaultValueValid(mTitle, mTitleResIdDefault))
|
||||
if (isDefaultValueValid(mTitleResIdDefault))
|
||||
{
|
||||
mTitle.setText(mTitleResIdDefault);
|
||||
}
|
||||
if (isDefaultValueValid(mSubtitle, mSubtitleResIdDefault))
|
||||
if (isDefaultValueValid(mSubtitleResIdDefault))
|
||||
{
|
||||
mSubtitle.setText(mSubtitleResIdDefault);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isDefaultValueValid(View view, int defaultResId)
|
||||
private static boolean isDefaultValueValid(int defaultResId)
|
||||
{
|
||||
return view != null && defaultResId != UiUtils.NO_ID;
|
||||
return defaultResId != UiUtils.NO_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -210,11 +215,8 @@ public class PlaceholderView extends LinearLayout
|
|||
public void setContent(@DrawableRes int imageRes, @StringRes int titleRes,
|
||||
@StringRes int subtitleRes)
|
||||
{
|
||||
if (mImage != null)
|
||||
mImage.setImageResource(imageRes);
|
||||
if (mTitle != null)
|
||||
mTitle.setText(titleRes);
|
||||
if (mSubtitle != null)
|
||||
mSubtitle.setText(subtitleRes);
|
||||
mImage.setImageResource(imageRes);
|
||||
mTitle.setText(titleRes);
|
||||
mSubtitle.setText(subtitleRes);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue