forked from organicmaps/organicmaps
[ios][android] Added news into About
Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
parent
0301f7678e
commit
77e0431d1d
9 changed files with 85 additions and 5 deletions
10
android/res/drawable/ic_news.xml
Executable file
10
android/res/drawable/ic_news.xml
Executable file
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M22,3l-1.67,1.67L18.67,3L17,4.67L15.33,3l-1.66,1.67L12,3l-1.67,1.67L8.67,3L7,4.67L5.33,3L3.67,4.67L2,3v18c0,0 0,0 0,0l20,0V3zM11,19H4v-6h7V19zM20,19h-7v-2h7V19zM20,15h-7v-2h7V15zM20,11H4V8h16V11z"/>
|
||||
</vector>
|
|
@ -62,6 +62,11 @@
|
|||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:text="@string/about_description"/>
|
||||
|
||||
<TextView android:id="@+id/news"
|
||||
style="@style/MwmWidget.TextView.Item"
|
||||
android:text="@string/news"
|
||||
app:drawableStartCompat="@drawable/ic_news"/>
|
||||
|
||||
<TextView android:id="@+id/faq"
|
||||
style="@style/MwmWidget.TextView.Item"
|
||||
android:text="@string/faq"
|
||||
|
|
|
@ -55,6 +55,7 @@ public class HelpFragment extends BaseMwmFragment implements View.OnClickListene
|
|||
((TextView) root.findViewById(R.id.data_version))
|
||||
.setText(getString(R.string.data_version, localDate(Framework.nativeGetDataVersion())));
|
||||
|
||||
setupItem(R.id.news, true, root);
|
||||
setupItem(R.id.web, true, root);
|
||||
setupItem(R.id.email, true, root);
|
||||
setupItem(R.id.github, false, root);
|
||||
|
@ -106,6 +107,8 @@ public class HelpFragment extends BaseMwmFragment implements View.OnClickListene
|
|||
final int id = v.getId();
|
||||
if (id == R.id.web)
|
||||
openLink(Constants.Url.WEB_SITE);
|
||||
else if (id == R.id.news)
|
||||
openLink(Constants.Url.NEWS);
|
||||
else if (id == R.id.email)
|
||||
Utils.sendTo(getContext(), BuildConfig.SUPPORT_MAIL, "Organic Maps");
|
||||
else if (id == R.id.github)
|
||||
|
|
|
@ -29,6 +29,7 @@ public final class Constants
|
|||
|
||||
public static final String SUPPORT_US = "https://organicmaps.app/support-us";
|
||||
|
||||
public static final String NEWS = "https://organicmaps.app/news/";
|
||||
public static final String WEB_SITE = "https://organicmaps.app";
|
||||
public static final String GITHUB = "https://github.com/organicmaps/organicmaps";
|
||||
|
||||
|
|
|
@ -4593,6 +4593,43 @@
|
|||
zh-Hans = 网站
|
||||
zh-Hant = 網站
|
||||
|
||||
[news]
|
||||
comment = Text in About menu, opens Organic Maps news website
|
||||
tags = android,ios
|
||||
en = News
|
||||
ar = ﺭﺎﺒﺧﺃ
|
||||
be = Навіны
|
||||
bg = Новини
|
||||
cs = Zprávy
|
||||
da = Nyheder
|
||||
de = Nachrichten
|
||||
el = Νέα
|
||||
es = Noticias
|
||||
fa = ﺭﺎﺒﺧﺍ
|
||||
fi = Uutiset
|
||||
fr = Nouvelles
|
||||
he = תוֹשׁדָחֲ
|
||||
hu = Hírek
|
||||
id = Berita
|
||||
it = Notizia
|
||||
ja = ニュース
|
||||
ko = 소식
|
||||
nb = Nyheter
|
||||
nl = Nieuws
|
||||
pl = Wiadomości
|
||||
pt = Notícias
|
||||
ro = Știri
|
||||
ru = Новости
|
||||
sk = Správy
|
||||
sv = Nyheter
|
||||
sw = Habari
|
||||
th = ข่าว
|
||||
tr = Haberler
|
||||
uk = Новини
|
||||
vi = Tin tức
|
||||
zh-Hans = 新闻
|
||||
zh-Hant = 消息
|
||||
|
||||
[github]
|
||||
comment = Text in menu
|
||||
tags = android,ios
|
||||
|
|
6
iphone/Maps/Images.xcassets/About/Contents.json
Normal file
6
iphone/Maps/Images.xcassets/About/Contents.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
16
iphone/Maps/Images.xcassets/About/ic_news.imageset/Contents.json
vendored
Normal file
16
iphone/Maps/Images.xcassets/About/ic_news.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "newspaper_white_24dp.svg",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"preserves-vector-representation" : true,
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
1
iphone/Maps/Images.xcassets/About/ic_news.imageset/newspaper_white_24dp.svg
vendored
Normal file
1
iphone/Maps/Images.xcassets/About/ic_news.imageset/newspaper_white_24dp.svg
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><g><rect fill="none" height="24" width="24"/></g><g><path d="M22,3l-1.67,1.67L18.67,3L17,4.67L15.33,3l-1.66,1.67L12,3l-1.67,1.67L8.67,3L7,4.67L5.33,3L3.67,4.67L2,3v18c0,0,0,0,0,0 l20,0V3z M11,19H4v-6h7V19z M20,19h-7v-2h7V19z M20,15h-7v-2h7V15z M20,11H4V8h16V11z"/></g></svg>
|
After Width: | Height: | Size: 410 B |
|
@ -116,7 +116,7 @@ final class AboutController: MWMViewController, UITableViewDataSource, UITableVi
|
|||
|
||||
// Update didSelect... delegate after modifying this list.
|
||||
private let labels = [
|
||||
["faq", "report_a_bug", "how_to_support_us", "rate_the_app"],
|
||||
["news", "faq", "report_a_bug", "how_to_support_us", "rate_the_app"],
|
||||
["telegram", "github", "website", "email", "facebook", "twitter", "instagram", "matrix", "openstreetmap"],
|
||||
["privacy_policy", "terms_of_use", "copyright"],
|
||||
]
|
||||
|
@ -168,10 +168,11 @@ final class AboutController: MWMViewController, UITableViewDataSource, UITableVi
|
|||
case 0: self.openUrl("https://organicmaps.app/donate/")
|
||||
// First buttons section.
|
||||
case 1: switch indexPath[1] {
|
||||
case 0: self.navigationController?.pushViewController(FaqController(), animated: true)
|
||||
case 1: sendEmailWith(header: "Organic Maps Bugreport", toRecipients: [kiOSEmail])
|
||||
case 2: self.openUrl("https://organicmaps.app/support-us/")
|
||||
case 3: UIApplication.shared.rateApp()
|
||||
case 0: self.openUrl("https://organicmaps.app/news/")
|
||||
case 1: self.navigationController?.pushViewController(FaqController(), animated: true)
|
||||
case 2: sendEmailWith(header: "Organic Maps Bugreport", toRecipients: [kiOSEmail])
|
||||
case 3: self.openUrl("https://organicmaps.app/support-us/")
|
||||
case 4: UIApplication.shared.rateApp()
|
||||
default: fatalError("Invalid cell0 \(indexPath)")
|
||||
}
|
||||
// Second section. Open urls in external Safari so logged-in users can easily follow us.
|
||||
|
|
Loading…
Add table
Reference in a new issue