mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
107 lines
4.5 KiB
Java
107 lines
4.5 KiB
Java
package fr.free.nrw.commons;
|
||
|
||
import android.annotation.SuppressLint;
|
||
import android.content.Intent;
|
||
import android.net.Uri;
|
||
import android.os.Bundle;
|
||
import android.text.SpannableString;
|
||
import android.text.style.UnderlineSpan;
|
||
import android.util.Log;
|
||
import android.support.customtabs.CustomTabsIntent;
|
||
import android.support.v4.content.ContextCompat;
|
||
import android.view.View;
|
||
import android.widget.TextView;
|
||
import android.widget.Toast;
|
||
|
||
import butterknife.BindView;
|
||
import butterknife.ButterKnife;
|
||
import butterknife.OnClick;
|
||
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||
import fr.free.nrw.commons.ui.widget.HtmlTextView;
|
||
|
||
import static android.widget.Toast.LENGTH_SHORT;
|
||
|
||
/**
|
||
* Represents about screen of this app
|
||
*/
|
||
public class AboutActivity extends NavigationBaseActivity {
|
||
@BindView(R.id.about_version) TextView versionText;
|
||
@BindView(R.id.about_license) HtmlTextView aboutLicenseText;
|
||
@BindView(R.id.about_faq) TextView faqText;
|
||
|
||
String language[] = { "Kazakh", "Afrikaans", "Arabic", "Bengali", "Asturianu", "azərbaycanca", "Bikol Central",
|
||
"Bulgarain", "বাংলা", "Bosanski", "Brezhoneg","català","کوردی", " čeština", " kaszëbsczi", "Cymraeg", "dansk", "Deutsch"
|
||
,"Zazaki", "डोटेली","Ελληνικά","euskara","español","فارسی","suomi", "français" ,"Nordfriisk", "galego", "Hawaiʻi"
|
||
,"हिन्दी","Hunsrik","עברית","hornjoserbsce","magyar","interlingua","Bahasa Indonesia", "íslenska","Italian","japanese",
|
||
"Basa Jawa", "ქართული", " ភាសាខ្មែរ","ಕನ್ನಡ", "한국어","къарачай-малкъар","Кыргызча", "latina", "Lëtzebuergesch", "lietuvių",
|
||
"latviešu", "Malagasy", "македонски"," മലയാളം","монгол","मराठी","Bahasa Melayu","Malti", "नेपाली", "norsk bokmål",
|
||
" Nederlands","occitan","ଓଡ଼ିଆ","ਪੰਜਾਬੀ","polsk","Piemontèis","پښتو","português","română","русский"," سنڌي", " සිංහල",
|
||
"slovenčina"," سرائیکی", "svenska", "தமிழ்", "ತುಳು"," తెలుగు"," ไทย", "Türkçe","українська", "اردو", "Tiếng Việt",
|
||
" მარგალური","ייִדיש",};
|
||
|
||
/**
|
||
* This method helps in the creation About screen
|
||
*
|
||
* @param savedInstanceState Data bundle
|
||
*/
|
||
@Override
|
||
@SuppressLint("StringFormatInvalid")
|
||
public void onCreate(Bundle savedInstanceState) {
|
||
super.onCreate(savedInstanceState);
|
||
setContentView(R.layout.activity_about);
|
||
|
||
ButterKnife.bind(this);
|
||
String aboutText = getString(R.string.about_license);
|
||
aboutLicenseText.setHtmlText(aboutText);
|
||
SpannableString content = new SpannableString(getString(R.string.about_faq));
|
||
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
|
||
faqText.setText(content);
|
||
versionText.setText(BuildConfig.VERSION_NAME);
|
||
initDrawer();
|
||
}
|
||
|
||
@OnClick(R.id.facebook_launch_icon)
|
||
public void launchFacebook(View view) {
|
||
Intent intent;
|
||
try {
|
||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/" + "1921335171459985"));
|
||
intent.setPackage("com.facebook.katana");
|
||
startActivity(intent);
|
||
} catch (Exception e) {
|
||
Utils.handleWebUrl(this,Uri.parse("https://www.facebook.com/" + "1921335171459985"));
|
||
}
|
||
}
|
||
|
||
@OnClick(R.id.github_launch_icon)
|
||
public void launchGithub(View view) {
|
||
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons\\"));
|
||
}
|
||
|
||
@OnClick(R.id.website_launch_icon)
|
||
public void launchWebsite(View view) {
|
||
Utils.handleWebUrl(this,Uri.parse("https://commons-app.github.io/\\"));
|
||
}
|
||
|
||
@OnClick(R.id.about_rate_us)
|
||
public void launchRatings(View view){
|
||
Utils.rateApp(this);
|
||
}
|
||
|
||
@OnClick(R.id.about_credits)
|
||
public void launchCredits(View view) {
|
||
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/blob/master/CREDITS/\\"));
|
||
}
|
||
|
||
@OnClick(R.id.about_privacy_policy)
|
||
public void launchPrivacyPolicy(View view) {
|
||
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\"));
|
||
}
|
||
|
||
|
||
@OnClick(R.id.about_faq)
|
||
public void launchFrequentlyAskedQuesions(View view) {
|
||
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Frequently-Asked-Questions\\"));
|
||
}
|
||
|
||
|
||
}
|