mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add EventLogging for Share attempts
This commit is contained in:
parent
f7882e916d
commit
03277af6cc
2 changed files with 7 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ public class CommonsApplication extends Application {
|
|||
|
||||
public static final Object[] EVENT_UPLOAD_ATTEMPT = {"MobileAppUploadAttempts", 5334329L};
|
||||
public static final Object[] EVENT_LOGIN_ATTEMPT = {"MobileAppLoginAttempts", 5257721L};
|
||||
public static final Object[] EVENT_SHARE_ATTEMPT = {"MobileAppShareAttempts", 5346170L};
|
||||
|
||||
public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using Android Commons app";
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import org.wikimedia.commons.*;
|
|||
|
||||
public class MediaDetailPagerFragment extends SherlockFragment {
|
||||
private ViewPager pager;
|
||||
private ShareActionProvider shareActionProvider;
|
||||
private Boolean editable;
|
||||
private CommonsApplication app;
|
||||
|
||||
public interface MediaDetailProvider {
|
||||
public Media getMediaAtPosition(int i);
|
||||
|
|
@ -82,6 +82,7 @@ public class MediaDetailPagerFragment extends SherlockFragment {
|
|||
if(savedInstanceState != null) {
|
||||
editable = savedInstanceState.getBoolean("editable");
|
||||
}
|
||||
app = (CommonsApplication)getActivity().getApplicationContext();
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +92,10 @@ public class MediaDetailPagerFragment extends SherlockFragment {
|
|||
Media m = provider.getMediaAtPosition(pager.getCurrentItem());
|
||||
switch(item.getItemId()) {
|
||||
case R.id.menu_share_current_image:
|
||||
EventLog.schema(CommonsApplication.EVENT_SHARE_ATTEMPT)
|
||||
.param("username", app.getCurrentAccount().name)
|
||||
.param("filename", m.getFilename())
|
||||
.log();
|
||||
Intent shareIntent = new Intent();
|
||||
shareIntent.setAction(Intent.ACTION_SEND);
|
||||
shareIntent.setType("text/plain");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue