[android] Updated Whats New screens with 'Font size' and 'Filter in Search'

This commit is contained in:
alexzatsepin 2017-01-20 19:11:09 +03:00 committed by Vladimir Byko-Ianko
parent a8cc0f8361
commit 3022e598ad
45 changed files with 6 additions and 236 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

View file

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mapswithme.maps.widget.HeightLimitedFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base_plus"
android:layout_marginBottom="@dimen/margin_base"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:text="@string/whatsnew_update_editor_title"
android:textAppearance="@style/MwmTextAppearance.Title"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:fontFamily="@string/robotoMedium"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_base"
android:layout_gravity="center_horizontal"
android:src="@drawable/img_whatsnew_booking_improved"
android:tag="@string/tag_height_limited"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_base"
android:layout_marginRight="@dimen/margin_base"
android:text="@string/whatsnew_update_editor_message"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"/>
<TextView
android:id="@+id/migrate_message"
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:text="@string/whatsnew_update_editor_message_update"
android:textAppearance="@style/MwmTextAppearance.Body1"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"/>
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="@dimen/margin_base">
<TextView
android:id="@+id/done"
android:layout_width="wrap_content"
style="@style/MwmWidget.Button"
android:paddingLeft="@dimen/margin_base"
android:paddingRight="@dimen/margin_base"
android:layout_gravity="right|bottom"
android:gravity="center"
android:text="@string/done"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?colorAccent"/>
<LinearLayout
android:id="@+id/migrate_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/margin_base"
android:clipToPadding="false"
android:orientation="horizontal">
<TextView
android:id="@+id/close"
android:layout_width="0dp"
android:layout_weight="3"
style="@style/MwmWidget.Button"
android:gravity="center"
android:text="@string/not_now"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?colorAccent"/>
<Button
android:id="@+id/migrate"
android:layout_width="0dp"
android:layout_weight="5"
style="@style/MwmWidget.Button.Accent"
android:layout_marginLeft="@dimen/margin_base"
android:text="@string/migration_update_all_button"
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?android:textColorPrimaryInverse"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</com.mapswithme.maps.widget.HeightLimitedFrameLayout>

View file

@ -29,38 +29,32 @@
<!-- What's new -->
<integer-array name="news_images">
<item>@drawable/img_whatsnew_traffic</item>
<item>@drawable/img_whatsnew_traffic_roaming</item>
<item>@drawable/img_whatsnew_update_uber</item>
<item>@drawable/ic_whatsnew_filter</item>
<item>@drawable/ic_whatsnew_label</item>
</integer-array>
<string-array name="news_titles">
<item>@string/whatsnew_traffic</item>
<item>@string/whatsnew_traffic_roaming</item>
<item>@string/whatsnew_order_taxi</item>
<item>@string/whatsnew_filters_in_search</item>
<item>@string/whatsnew_font_size</item>
</string-array>
<string-array name="news_messages_1">
<item>@string/whatsnew_traffic_text</item>
<item>@string/whatsnew_traffic_roaming_text</item>
<item>@string/whatsnew_order_taxi_text</item>
<item>@string/whatsnew_filters_in_search_text</item>
<item>@string/whatsnew_font_size_text</item>
</string-array>
<string-array name="news_messages_2">
<item/>
<item/>
<item/>
</string-array>
<string-array name="news_switch_titles">
<item/>
<item/>
<item/>
</string-array>
<string-array name="news_switch_subtitles">
<item/>
<item/>
<item/>
</string-array>
</resources>

View file

@ -1,120 +0,0 @@
package com.mapswithme.maps.news;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.view.Window;
import com.mapswithme.maps.BuildConfig;
import com.mapswithme.maps.MwmActivity;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.maps.downloader.MapManager;
import com.mapswithme.util.Config;
import com.mapswithme.util.UiUtils;
// TODO (trashkalmar): This is temporary class
public class SinglePageNewsFragment extends BaseMwmDialogFragment
{
@Override
protected int getCustomTheme()
{
return (UiUtils.isTablet() ? super.getCustomTheme()
: getFullscreenTheme());
}
@Override
public @NonNull Dialog onCreateDialog(Bundle savedInstanceState)
{
Dialog res = super.onCreateDialog(savedInstanceState);
res.requestWindowFeature(Window.FEATURE_NO_TITLE);
View content = View.inflate(getActivity(), R.layout.fragment_news_single, null);
res.setContentView(content);
View done = content.findViewById(R.id.done);
if (MapManager.nativeIsLegacyMode())
{
UiUtils.hide(done);
done = content.findViewById(R.id.close);
content.findViewById(R.id.migrate).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
((MwmActivity) getActivity()).showDownloader(false);
dismissAllowingStateLoss();
}
});
}
else
{
UiUtils.hide(content.findViewById(R.id.migrate_message));
UiUtils.hide(content.findViewById(R.id.migrate_buttons));
}
done.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
dismissAllowingStateLoss();
}
});
return res;
}
@SuppressWarnings("TryWithIdenticalCatches")
private static void create(FragmentActivity activity)
{
try
{
SinglePageNewsFragment fragment = SinglePageNewsFragment.class.newInstance();
fragment.show(activity.getSupportFragmentManager(), SinglePageNewsFragment.class.getName());
} catch (java.lang.InstantiationException ignored)
{}
catch (IllegalAccessException ignored)
{}
}
private static boolean recreate(FragmentActivity activity)
{
FragmentManager fm = activity.getSupportFragmentManager();
Fragment f = fm.findFragmentByTag(SinglePageNewsFragment.class.getName());
if (f == null)
return false;
// If we're here, it means that the user has rotated the screen.
// We use different dialog themes for landscape and portrait modes on tablets,
// so the fragment should be recreated to be displayed correctly.
fm.beginTransaction().remove(f).commitAllowingStateLoss();
fm.executePendingTransactions();
return true;
}
public static boolean showOn(FragmentActivity activity)
{
if (Config.getFirstInstallVersion() >= BuildConfig.VERSION_CODE)
return false;
FragmentManager fm = activity.getSupportFragmentManager();
if (fm.isDestroyed())
return false;
if (Config.getLastWhatsNewVersion() / 10 >= BuildConfig.VERSION_CODE / 10 &&
!recreate(activity))
return false;
create(activity);
Config.setWhatsNewShown();
return true;
}
}