[android] fix: UI fixes.

This commit is contained in:
Alexander Marchuk 2016-02-01 16:12:24 +03:00 committed by Sergey Yershov
parent c90639c815
commit daa4280f67
5 changed files with 19 additions and 18 deletions

View file

@ -10,7 +10,7 @@
android:orientation="horizontal">
<EditText
android:id="@+id/query"
style="@style/MwmTextAppearance.Toolbar"
style="@style/MwmTextAppearance.Toolbar.Search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"

View file

@ -4,5 +4,5 @@
xmlns:tools="http://schemas.android.com/tools"
style="@style/MwmWidget.Tab"
android:textAppearance="@style/MwmTextAppearance.Body4"
tools:drawableLeft="@drawable/ic_menu_open"
tools:drawableTop="@drawable/ic_menu_open"
tools:text="Some tab"/>

View file

@ -11,12 +11,6 @@
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="MwmTextAppearance.Toolbar">
<item name="android:textSize">@dimen/text_size_toolbar</item>
<item name="android:textColor">@color/text_light</item>
<item name="android:textColorHint">@color/text_light_hint</item>
</style>
<style name="MwmTextAppearance.Title">
<item name="android:textSize">@dimen/text_size_title</item>
<item name="android:textColor">?android:textColorPrimary</item>
@ -69,8 +63,18 @@
<item name="android:textAllCaps">true</item>
</style>
<style name="MwmTextAppearance.Toolbar"/>
<style name="MwmTextAppearance.Toolbar.Search">
<item name="android:textSize">@dimen/text_size_toolbar</item>
<item name="android:textColor">@color/text_light</item>
<item name="android:textColorHint">@color/text_light_hint</item>
</style>
<style name="MwmTextAppearance.Toolbar.Title" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">@dimen/text_size_toolbar</item>
<item name="android:textColor">@color/text_light</item>
<item name="android:textColorHint">@color/text_light_hint</item>
</style>
<style name="MwmTextAppearance.Toolbar.Title.Light">

View file

@ -163,7 +163,7 @@
<style name="MwmWidget.Tab">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">@dimen/tabs_height</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAllCaps">true</item>
<item name="android:textAppearance">@style/MwmTextAppearance.Body3</item>
<item name="android:gravity">center</item>

View file

@ -24,11 +24,10 @@ public class DownloadFragment extends BaseMwmListFragment implements View.OnClic
private DownloadedAdapter mDownloadedAdapter;
private TextView mTvUpdateAll;
private View mDownloadAll;
private int mMode = MODE_DISABLED;
private int mMode = MODE_NONE;
private int mListenerSlotId;
private LayoutInflater mLayoutInflater;
private static final int MODE_DISABLED = -1;
private static final int MODE_NONE = 0;
private static final int MODE_UPDATE_ALL = 1;
private static final int MODE_CANCEL_ALL = 2;
@ -70,7 +69,7 @@ public class DownloadFragment extends BaseMwmListFragment implements View.OnClic
{
mDownloadAdapter = getDownloadAdapter();
setListAdapter(mDownloadAdapter);
mMode = MODE_DISABLED;
mMode = MODE_NONE;
mListenerSlotId = ActiveCountryTree.addListener(this);
}
}
@ -130,7 +129,7 @@ public class DownloadFragment extends BaseMwmListFragment implements View.OnClic
}
else if (getListAdapter() instanceof DownloadedAdapter)
{
mMode = MODE_DISABLED;
mMode = MODE_NONE;
mDownloadedAdapter.onPause();
mDownloadAdapter = getDownloadAdapter();
mDownloadAdapter.onResume(getListView());
@ -147,7 +146,9 @@ public class DownloadFragment extends BaseMwmListFragment implements View.OnClic
{
if (mTvUpdateAll == null || !isAdded())
return;
if (mMode == MODE_DISABLED)
updateMode();
if (mMode == MODE_NONE)
{
mTvUpdateAll.setVisibility(View.GONE);
UiUtils.showIf(CountryTree.hasParent() && CountryTree.isDownloadableGroup(), mDownloadAll);
@ -156,7 +157,6 @@ public class DownloadFragment extends BaseMwmListFragment implements View.OnClic
UiUtils.hide(mDownloadAll);
updateMode();
switch (mMode)
{
case MODE_CANCEL_ALL:
@ -167,9 +167,6 @@ public class DownloadFragment extends BaseMwmListFragment implements View.OnClic
mTvUpdateAll.setText(getString(R.string.downloader_update_all));
mTvUpdateAll.setVisibility(View.VISIBLE);
break;
case MODE_NONE:
mTvUpdateAll.setVisibility(View.GONE);
break;
}
}