Merge pull request #1080 from tshradheya/fb-about-button

Revamped About Page #1005
This commit is contained in:
neslihanturan 2018-01-24 18:08:31 +03:00 committed by GitHub
commit a6caa64e17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 130 additions and 1 deletions

View file

@ -1,10 +1,14 @@
package fr.free.nrw.commons;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import fr.free.nrw.commons.theme.NavigationBaseActivity;
import fr.free.nrw.commons.ui.widget.HtmlTextView;
@ -33,4 +37,32 @@ public class AboutActivity extends NavigationBaseActivity {
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) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + "1921335171459985")));
}
}
@OnClick(R.id.github_launch_icon)
public void launchGithub(View view) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/commons-app/apps-android-commons\\"));
startActivity(browserIntent);
}
@OnClick(R.id.website_launch_icon)
public void launchWebsite(View view) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://commons-app.github.io/\\"));
startActivity(browserIntent);
}
}