Skip to content

Commit 631a77d

Browse files
committed
Merge remote-tracking branch 'refs/remotes/commons-app/master'
2 parents 4bedaea + a611cd0 commit 631a77d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

app/src/main/java/fr/free/nrw/commons/CommonsApplication.java

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class CommonsApplication extends Application {
5959
public static final String API_URL = "https://commons.wikimedia.org/w/api.php";
6060
public static final String IMAGE_URL_BASE = "https://upload.wikimedia.org/wikipedia/commons";
6161
public static final String HOME_URL = "https://commons.wikimedia.org/wiki/";
62+
public static final String MOBILE_HOME_URL = "https://commons.m.wikimedia.org/wiki/";
6263
public static final String EVENTLOG_URL = "https://www.wikimedia.org/beacon/event";
6364
public static final String EVENTLOG_WIKI = "commonswiki";
6465

app/src/main/java/fr/free/nrw/commons/Media.java

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public String getDescriptionUrl() {
6161
return CommonsApplication.HOME_URL + "File:" + Utils.urlEncode(getFilename().replace("File:", "").replace(" ", "_"));
6262
}
6363

64+
public String getMobileDescriptionUrl() {
65+
return CommonsApplication.MOBILE_HOME_URL + "File:" + Utils.urlEncode(getFilename().replace("File:", "").replace(" ", "_"));
66+
}
67+
6468
public Uri getLocalUri() {
6569
return localUri;
6670
}

app/src/main/java/fr/free/nrw/commons/media/MediaDetailPagerFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
143143
// View in browser
144144
Intent viewIntent = new Intent();
145145
viewIntent.setAction(Intent.ACTION_VIEW);
146-
viewIntent.setData(Uri.parse(m.getDescriptionUrl()));
146+
viewIntent.setData(Uri.parse(m.getMobileDescriptionUrl()));
147147
startActivity(viewIntent);
148148
return true;
149149
case R.id.menu_download_current_image:

0 commit comments

Comments
 (0)