mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
Merge "commons" into the project root directory
This commit is contained in:
parent
d42db0612e
commit
b4231bbfdc
324 changed files with 22 additions and 23 deletions
44
app/src/main/java/fr/free/nrw/commons/AboutActivity.java
Normal file
44
app/src/main/java/fr/free/nrw/commons/AboutActivity.java
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package fr.free.nrw.commons;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class AboutActivity extends Activity {
|
||||
private TextView versionText;
|
||||
private TextView licenseText;
|
||||
private TextView improveText;
|
||||
private TextView privacyPolicyText;
|
||||
private TextView uploadsToText;
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
||||
versionText = (TextView) findViewById(R.id.about_version);
|
||||
licenseText = (TextView) findViewById(R.id.about_license);
|
||||
improveText = (TextView) findViewById(R.id.about_improve);
|
||||
privacyPolicyText = (TextView) findViewById(R.id.about_privacy_policy);
|
||||
uploadsToText = (TextView) findViewById(R.id.about_uploads_to);
|
||||
|
||||
uploadsToText.setText(fr.free.nrw.commons.CommonsApplication.EVENTLOG_WIKI);
|
||||
versionText.setText(fr.free.nrw.commons.CommonsApplication.APPLICATION_VERSION);
|
||||
|
||||
// We can't use formatted strings directly because it breaks with
|
||||
// our localization tools. Grab an HTML string and turn it into
|
||||
// a formatted string.
|
||||
fixFormatting(licenseText, R.string.about_license);
|
||||
fixFormatting(improveText, R.string.about_improve);
|
||||
fixFormatting(privacyPolicyText, R.string.about_privacy_policy);
|
||||
|
||||
licenseText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
improveText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
privacyPolicyText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
private void fixFormatting(TextView textView, int resource) {
|
||||
textView.setText(Html.fromHtml(getResources().getString(resource)));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue