[android] Add 'Donate' button to the main menu #3230
42 changed files with 166 additions and 13 deletions
|
@ -1,15 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24">
|
||||
<path
|
||||
android:pathData="M1,11h4v11h-4z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M16,3.25C16.65,2.49 17.66,2 18.7,2C20.55,2 22,3.45 22,5.3c0,2.27 -2.91,4.9 -6,7.7c-3.09,-2.81 -6,-5.44 -6,-7.7C10,3.45 11.45,2 13.3,2C14.34,2 15.35,2.49 16,3.25z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M20,17h-7l-2.09,-0.73l0.33,-0.94L13,16h2.82c0.65,0 1.18,-0.53 1.18,-1.18v0c0,-0.49 -0.31,-0.93 -0.77,-1.11L8.97,11H7v9.02L14,22l8.01,-3v0C22,17.9 21.11,17 20,17z"
|
||||
android:fillColor="#000000"/>
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M9.6,15.6 L11,14.175 8.825,12 11,9.825 9.6,8.4 6,12ZM14.4,15.6 L18,12 14.4,8.4 13,9.825 15.175,12 13,14.175ZM5,21Q4.175,21 3.587,20.413Q3,19.825 3,19V5Q3,4.175 3.587,3.587Q4.175,3 5,3H19Q19.825,3 20.413,3.587Q21,4.175 21,5V19Q21,19.825 20.413,20.413Q19.825,21 19,21ZM5,19H19Q19,19 19,19Q19,19 19,19V5Q19,5 19,5Q19,5 19,5H5Q5,5 5,5Q5,5 5,5V19Q5,19 5,19Q5,19 5,19ZM5,5Q5,5 5,5Q5,5 5,5V19Q5,19 5,19Q5,19 5,19Q5,19 5,19Q5,19 5,19V5Q5,5 5,5Q5,5 5,5Z" />
|
||||
</vector>
|
||||
|
|
15
android/res/drawable/ic_donate.xml
Normal file
15
android/res/drawable/ic_donate.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M1,11h4v11h-4z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M16,3.25C16.65,2.49 17.66,2 18.7,2C20.55,2 22,3.45 22,5.3c0,2.27 -2.91,4.9 -6,7.7c-3.09,-2.81 -6,-5.44 -6,-7.7C10,3.45 11.45,2 13.3,2C14.34,2 15.35,2.49 16,3.25z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M20,17h-7l-2.09,-0.73l0.33,-0.94L13,16h2.82c0.65,0 1.18,-0.53 1.18,-1.18v0c0,-0.49 -0.31,-0.93 -0.77,-1.11L8.97,11H7v9.02L14,22l8.01,-3v0C22,17.9 21.11,17 20,17z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
|
@ -77,6 +77,12 @@
|
|||
android:text="@string/report_a_bug"
|
||||
app:drawableStartCompat="@drawable/ic_report_a_bug"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/donate"
|
||||
style="@style/MwmWidget.TextView.Item"
|
||||
android:text="@string/donate"
|
||||
app:drawableStartCompat="@drawable/ic_donate" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/support_us"
|
||||
style="@style/MwmWidget.TextView.Item"
|
||||
|
|
|
@ -240,6 +240,8 @@
|
|||
<string name="help">مساعدة</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">اسئلة مكررة</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">ﻉﺮﺒﺘﻳ</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">كيف يمكنك دعمنا؟</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -236,6 +236,8 @@
|
|||
<string name="help">Дапамога</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Пытанні і адказы</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Ахвяраваць</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Як нас падтрымаць?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -223,6 +223,8 @@
|
|||
<string name="help">Помощ</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Въпроси и отговори</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Дарете</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Как да ни подкрепите?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -216,6 +216,8 @@
|
|||
<string name="help">Nápověda</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Otázky a odpovědi</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Darovat</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Jak nás podpořit?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -216,6 +216,8 @@
|
|||
<string name="help">Hjælp</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Spørgsmål og svar</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Doner</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Sådan støtter vi os?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -235,6 +235,8 @@
|
|||
<string name="help">Hilfe</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Fragen und Antworten</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Spenden</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Wie unterstützen Sie uns?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -217,6 +217,8 @@
|
|||
<string name="help">Βοήθεια</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Ερωτήσεις και απαντήσεις</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Προσφέρω</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Πώς να μας υποστηρίξετε;</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -223,6 +223,8 @@
|
|||
<string name="help">Ayuda</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Preguntas frecuentes</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Donar</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">¿Cómo apoyarnos?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -221,6 +221,8 @@
|
|||
<string name="help">Laguntza</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Maiz galderak</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Dohaintza eman</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Nola lagundu diguzu?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -209,6 +209,8 @@
|
|||
<string name="help">کمک</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">ﺦﺳﺎﭘ ﻭ ﺶﺳﺮﭘ</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">ﺪﯿﻨﮐ ﺍﺪﻫﺍ</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">چگونه از ما حمایت کنیم؟</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -222,6 +222,8 @@
|
|||
<string name="help">Ohje</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Kysymykset ja vastaukset</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Lahjoittaa</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Kuinka tukea meitä?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -237,6 +237,8 @@
|
|||
<string name="help">Aide</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Foire aux questions</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Faire un don</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Comment nous soutenir?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -216,6 +216,8 @@
|
|||
<string name="help">Segítség</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Kérdések és válaszok</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Adományoz</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Hogyan támogat minket?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -218,6 +218,8 @@
|
|||
<string name="help">Bantuan</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Pertanyaan dan jawaban</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Menyumbangkan</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Bagaimana cara mendukung kami?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -221,6 +221,8 @@
|
|||
<string name="help">Aiuto</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Domande frequenti</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Donare</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Come sostenerci?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -164,6 +164,8 @@
|
|||
<string name="help">עזרה</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">תובושתו תולאש</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">םוֹרתְלִ</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">כיצד לתמוך בנו?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -214,6 +214,8 @@
|
|||
<string name="help">ヘルプ</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">質問と回答</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">寄付</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">どのように私たちを支持する方法?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -216,6 +216,8 @@
|
|||
<string name="help">도움말</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">질문과 답변</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">기부</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">우리를 지원하는 방법?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -218,6 +218,8 @@
|
|||
<string name="help">Hjelp</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Spørsmål og svar</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Donere</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Hvordan støtte oss?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -218,6 +218,8 @@
|
|||
<string name="help">Hulp</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Vragen en antwoorden</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Doneren</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Hoe ons te steunen?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -221,6 +221,8 @@
|
|||
<string name="help">Pomoc</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Pytania i odpowiedzi</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Podarować</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Jak nas wspierać?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -231,6 +231,8 @@
|
|||
<string name="help">Ajuda</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Perguntas e respostas</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Doar</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="copyright">Direitos autorais</string>
|
||||
<!-- Text in menu + Button in the main Help dialog -->
|
||||
|
|
|
@ -221,6 +221,8 @@
|
|||
<string name="help">Ajuda</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Perguntas e respostas</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Doar</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Como nos apoiar?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -223,6 +223,8 @@
|
|||
<string name="help">Ajutor</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Întrebări frecvente</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Donează</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Cum să ne sprijiniți?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -238,6 +238,8 @@
|
|||
<string name="help">Справка</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Вопросы и ответы</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Поддержать рублём</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Как наc поддержать?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -216,6 +216,8 @@
|
|||
<string name="help">Nápoveda</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Otázky a odpovede</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Darovať</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Ako nás podporiť?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -214,6 +214,8 @@
|
|||
<string name="help">Hjälp</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Frågor och svar</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Donera</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Hur stöder vi oss?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
<string name="news">Habari</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Maswali na majibu</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Changia</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Jinsi ya kutuunga mkono?</string>
|
||||
<!-- Preference title -->
|
||||
|
|
|
@ -218,6 +218,8 @@
|
|||
<string name="help">ความช่วยเหลือ</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">คำถามและคำตอบ</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">บริจาค</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">วิธีการสนับสนุนเรา</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -237,6 +237,8 @@
|
|||
<string name="help">Yardım</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Sıkça Sorulan Sorular</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Bağış yapmak</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Sizi nasıl destekleyebilirim?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -231,6 +231,8 @@
|
|||
<string name="help">Допомога</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Питання та відповіді</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Пожертвувати</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Як нас підтримати?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -216,6 +216,8 @@
|
|||
<string name="help">Trợ giúp</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Câu hỏi và trả lời</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Quyên tặng</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">Làm thế nào để hỗ trợ chúng tôi?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -227,6 +227,8 @@
|
|||
<string name="help">幫助</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">問題和解答</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">捐</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">如何支持我們?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -224,6 +224,8 @@
|
|||
<string name="help">帮助</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">问题和解答</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">捐</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">如何支持我们?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -256,6 +256,8 @@
|
|||
<string name="help">Help</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="faq">Frequently Asked Questions</string>
|
||||
<!-- Button in the main menu -->
|
||||
<string name="donate">Donate</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
<string name="how_to_support_us">How to support us?</string>
|
||||
<!-- Button in the main Help dialog -->
|
||||
|
|
|
@ -86,6 +86,7 @@ import com.mapswithme.maps.widget.placepage.PlacePageController;
|
|||
import com.mapswithme.maps.widget.placepage.PlacePageData;
|
||||
import com.mapswithme.maps.widget.placepage.PlacePageFactory;
|
||||
import com.mapswithme.maps.widget.placepage.RoutingModeListener;
|
||||
import com.mapswithme.util.Config;
|
||||
import com.mapswithme.util.Counters;
|
||||
import com.mapswithme.util.InputUtils;
|
||||
import com.mapswithme.util.PermissionsUtils;
|
||||
|
@ -201,6 +202,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@NonNull
|
||||
private PlacePageController mPlacePageController;
|
||||
|
||||
private String mDonatesUrl;
|
||||
|
||||
public interface LeftAnimationTrackListener
|
||||
{
|
||||
void onTrackStarted(boolean collapsed);
|
||||
|
@ -447,6 +450,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
getDownloadMapsCounter(),
|
||||
this::onDownloadMapsOptionSelected
|
||||
));
|
||||
mDonatesUrl = Config.getDonateUrl();
|
||||
if (!TextUtils.isEmpty(mDonatesUrl))
|
||||
items.add(new MenuBottomSheetItem(R.string.donate, R.drawable.ic_donate, this::onDonateOptionSelected));
|
||||
items.add(new MenuBottomSheetItem(R.string.settings, R.drawable.ic_settings, this::onSettingsOptionSelected));
|
||||
items.add(new MenuBottomSheetItem(R.string.share_my_location, R.drawable.ic_share, this::onShareLocationOptionSelected));
|
||||
return items;
|
||||
|
@ -2004,6 +2010,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
showDownloader(false);
|
||||
}
|
||||
|
||||
public void onDonateOptionSelected()
|
||||
{
|
||||
Utils.openUrl(this, mDonatesUrl);
|
||||
}
|
||||
|
||||
public void onSettingsOptionSelected()
|
||||
{
|
||||
Intent intent = new Intent(getActivity(), SettingsActivity.class);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.mapswithme.maps.help;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -14,6 +15,7 @@ import com.mapswithme.maps.BuildConfig;
|
|||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.base.BaseMwmFragment;
|
||||
import com.mapswithme.util.Config;
|
||||
import com.mapswithme.util.Constants;
|
||||
import com.mapswithme.util.Graphics;
|
||||
import com.mapswithme.util.Utils;
|
||||
|
@ -22,6 +24,8 @@ import java.text.SimpleDateFormat;
|
|||
|
||||
public class HelpFragment extends BaseMwmFragment implements View.OnClickListener
|
||||
{
|
||||
private String mDonateUrl;
|
||||
|
||||
private void setupItem(@IdRes int id, boolean tint, @NonNull View frame)
|
||||
{
|
||||
TextView view = frame.findViewById(id);
|
||||
|
@ -47,6 +51,7 @@ public class HelpFragment extends BaseMwmFragment implements View.OnClickListene
|
|||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
mDonateUrl = Config.getDonateUrl();
|
||||
View root = inflater.inflate(R.layout.about, container, false);
|
||||
|
||||
((TextView) root.findViewById(R.id.version))
|
||||
|
@ -67,13 +72,16 @@ public class HelpFragment extends BaseMwmFragment implements View.OnClickListene
|
|||
setupItem(R.id.openstreetmap, true, root);
|
||||
setupItem(R.id.faq, true, root);
|
||||
setupItem(R.id.report, true, root);
|
||||
if ("google".equalsIgnoreCase(BuildConfig.FLAVOR))
|
||||
if (TextUtils.isEmpty(mDonateUrl))
|
||||
{
|
||||
TextView view = root.findViewById(R.id.support_us);
|
||||
view.setVisibility(View.GONE);
|
||||
TextView donateView = root.findViewById(R.id.donate);
|
||||
donateView.setVisibility(View.GONE);
|
||||
TextView supportUsView = root.findViewById(R.id.support_us);
|
||||
rtsisyk
commented
Возможен рейс, когда кнопка создатся, а потом ссылка будет пустая. Возможен рейс, когда кнопка создатся, а потом ссылка будет пустая.
![]() Так сделай нормально без рейса. А иначе кнопка создастся и не уберётся, когда не нужна. Так сделай нормально без рейса. А иначе кнопка создастся и не уберётся, когда не нужна.
rtsisyk
commented
Сделать подписку на изменение settings.ini и динамически удалять кнопку с экрана? Немного перебор. Сделать подписку на изменение settings.ini и динамически удалять кнопку с экрана? Немного перебор.
![]() Это же HelpFragment, штука которая показывается, удаляется на закрытии, создается заново (?) на открытии. Как тут кнопка должна убираться и зачем? Layout фрагмента создается в onCreateView. Это же HelpFragment, штука которая показывается, удаляется на закрытии, создается заново (?) на открытии. Как тут кнопка должна убираться и зачем? Layout фрагмента создается в onCreateView.
|
||||
supportUsView.setVisibility(View.GONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
setupItem(R.id.donate, true, root);
|
||||
setupItem(R.id.support_us, true, root);
|
||||
}
|
||||
setupItem(R.id.rate, true, root);
|
||||
|
@ -131,6 +139,8 @@ public class HelpFragment extends BaseMwmFragment implements View.OnClickListene
|
|||
Utils.sendBugReport(getActivity(), "");
|
||||
else if (id == R.id.support_us)
|
||||
openLink(Constants.Url.SUPPORT_US);
|
||||
else if (id == R.id.donate)
|
||||
openLink(mDonateUrl);
|
||||
else if (id == R.id.rate)
|
||||
Utils.openAppInMarket(getActivity(), BuildConfig.REVIEW_URL);
|
||||
else if (id == R.id.copyright)
|
||||
|
|
|
@ -41,6 +41,7 @@ public final class Config
|
|||
private static final String KEY_MISC_ENABLE_SCREEN_SLEEP = "EnableScreenSleep";
|
||||
private static final String KEY_MISC_SHOW_ON_LOCK_SCREEN = "ShowOnLockScreen";
|
||||
private static final String KEY_MISC_AGPS_TIMESTAMP = "AGPSTimestamp";
|
||||
private static final String KEY_DONATE_URL = "DonateUrl";
|
||||
|
||||
private Config() {}
|
||||
|
||||
|
@ -64,11 +65,13 @@ public final class Config
|
|||
return nativeGetLong(key, def);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static String getString(String key)
|
||||
{
|
||||
return getString(key, "");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static String getString(String key, String def)
|
||||
{
|
||||
return nativeGetString(key, def);
|
||||
![]() Зачем этот пустой метод? Зачем этот пустой метод?
rtsisyk
commented
Какой пустой метод? Какой пустой метод?
|
||||
|
@ -335,6 +338,11 @@ public final class Config
|
|||
nativeSetTransliteration(value);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String getDonateUrl()
|
||||
{
|
||||
return getString(KEY_DONATE_URL);
|
||||
}
|
||||
|
||||
private static native boolean nativeGetBoolean(String name, boolean defaultValue);
|
||||
private static native void nativeSetBoolean(String name, boolean value);
|
||||
|
|
|
@ -5138,6 +5138,45 @@
|
|||
zh-Hans = 问题和解答
|
||||
zh-Hant = 問題和解答
|
||||
|
||||
[donate]
|
||||
comment = Button in the main menu
|
||||
tags = android
|
||||
en = Donate
|
||||
ar = ﻉﺮﺒﺘﻳ
|
||||
be = Ахвяраваць
|
||||
bg = Дарете
|
||||
cs = Darovat
|
||||
da = Doner
|
||||
de = Spenden
|
||||
el = Προσφέρω
|
||||
es = Donar
|
||||
eu = Dohaintza eman
|
||||
fa = ﺪﯿﻨﮐ ﺍﺪﻫﺍ
|
||||
fi = Lahjoittaa
|
||||
fr = Faire un don
|
||||
he = םוֹרתְלִ
|
||||
hu = Adományoz
|
||||
id = Menyumbangkan
|
||||
it = Donare
|
||||
ja = 寄付
|
||||
ko = 기부
|
||||
nb = Donere
|
||||
nl = Doneren
|
||||
pl = Podarować
|
||||
pt = Doar
|
||||
pt-BR = Doar
|
||||
ro = Donează
|
||||
ru = Поддержать рублём
|
||||
sk = Darovať
|
||||
sv = Donera
|
||||
sw = Changia
|
||||
th = บริจาค
|
||||
tr = Bağış yapmak
|
||||
uk = Пожертвувати
|
||||
vi = Quyên tặng
|
||||
zh-Hans = 捐
|
||||
zh-Hant = 捐
|
||||
|
||||
[how_to_support_us]
|
||||
comment = Button in the main Help dialog
|
||||
tags = android,ios
|
||||
|
|
Reference in a new issue
Не надо его хранить, пускай всегда из конфига запрашивается