[android] fix: News page layout fixed.

This commit is contained in:
Alexander Marchuk 2016-01-05 14:26:45 +03:00
parent 704ce1fe5e
commit 3a7d5d713d
21 changed files with 21 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View file

@ -43,10 +43,9 @@
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:textAppearance="@style/MwmTextAppearance.Body2"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
tools:text="@string/whats_new_3d_subtitle"/>
@ -79,7 +78,7 @@
android:id="@+id/switch_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/MwmTextAppearance.Body2"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:singleLine="true"
tools:text="Switch block subtitle"/>
</LinearLayout>

View file

@ -42,8 +42,9 @@
<!-- What's new -->
<integer-array name="news_images">
<item>@drawable/img_news_tts</item>
<item>@drawable/img_news_p2p</item>
<item>@drawable/img_news_3d_buildings</item>
<!-- TODO(trashkalmar): Replace me -->
<item>@drawable/img_news_3d_buildings</item>
</integer-array>
<string-array name="news_titles">
@ -57,12 +58,12 @@
</string-array>
<string-array name="news_switch_titles">
<item>@string/whats_new_3d_switch_title</item>
<item>@string/whats_new_3d_buildings_switch_title</item>
<item>@string/pref_map_3d_title</item>
<item>@string/pref_map_3d_buildings_title</item>
</string-array>
<string-array name="news_switch_subtitles">
<item>@string/whats_new_3d_switch_subtitle</item>
<item>@string/whats_new_3d_buildings_switch_subtitle</item>
<item/>
<item>@string/pref_map_3d_buildings_subtitle</item>
</string-array>
</resources>

View file

@ -33,14 +33,15 @@
<SwitchPreference
android:key="@string/pref_3d"
android:title="3D mode"
android:title="@string/pref_map_3d_title"
android:switchTextOn=""
android:switchTextOff=""
android:order="5"/>
<SwitchPreference
android:key="@string/pref_3d_buildings"
android:title="3D buildings"
android:title="@string/pref_map_3d_buildings_title"
android:summary="@string/pref_map_3d_buildings_subtitle"
android:switchTextOn=""
android:switchTextOff=""
android:order="6"/>

View file

@ -31,12 +31,13 @@
<CheckBoxPreference
android:key="@string/pref_3d"
android:title="3D mode"
android:title="@string/pref_map_3d_title"
android:order="5"/>
<CheckBoxPreference
android:key="@string/pref_3d_buildings"
android:title="3D buildings"
android:title="@string/pref_map_3d_buildings_title"
android:summary="@string/pref_map_3d_buildings_subtitle"
android:order="6"/>
<Preference

View file

@ -727,7 +727,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
mSearchController.refreshToolbar();
mPlacePage.onResume();
// if (!NewsFragment.showOn(this))
if (!NewsFragment.showOn(this))
LikesManager.INSTANCE.showDialogs(this);
mMainMenu.onResume();

View file

@ -85,8 +85,11 @@ public class NewsFragment extends BaseMwmDialogFragment
((TextView)switchBlock.findViewById(R.id.switch_title))
.setText(text);
((TextView)switchBlock.findViewById(R.id.switch_subtitle))
.setText(mSwitchSubtitles[position]);
TextView subtitle = (TextView)switchBlock.findViewById(R.id.switch_subtitle);
if (TextUtils.isEmpty(mSwitchSubtitles[position]))
UiUtils.hide(subtitle);
else
subtitle.setText(mSwitchSubtitles[position]);
final SwitchCompat checkBox = (SwitchCompat)switchBlock.findViewById(R.id.switch_box);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()