Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ public static void viewBlogSettingsForResult(Activity activity, SiteModel site)
AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.OPENED_BLOG_SETTINGS, site);
}

public static void viewCurrentSite(Context context, SiteModel site) {
public static void viewCurrentSite(Context context, SiteModel site, boolean openFromHeader) {
if (site == null) {
Toast.makeText(context, context.getText(R.string.blog_not_found), Toast.LENGTH_SHORT).show();
return;
}

AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.OPENED_VIEW_SITE, site);
AnalyticsTracker.Stat stat = openFromHeader ? AnalyticsTracker.Stat.OPENED_VIEW_SITE_FROM_HEADER
: AnalyticsTracker.Stat.OPENED_VIEW_SITE;
AnalyticsUtils.trackWithSiteDetails(stat, site);
openUrlExternal(context, site.getUrl());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
mFabView.setVisibility(View.INVISIBLE);
}

rootView.findViewById(R.id.card_view).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ActivityLauncher.viewCurrentSite(getActivity(), getSelectedSite(), true);
}
});

mFabView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -170,7 +177,7 @@ public void onClick(View v) {
rootView.findViewById(R.id.row_view_site).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ActivityLauncher.viewCurrentSite(getActivity(), getSelectedSite());
ActivityLauncher.viewCurrentSite(getActivity(), getSelectedSite(), false);
}
});

Expand Down
1 change: 1 addition & 0 deletions WordPress/src/main/res/layout/my_site_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
android:orientation="vertical">

<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public enum Stat {
OPENED_PAGES,
OPENED_COMMENTS,
OPENED_VIEW_SITE,
OPENED_VIEW_SITE_FROM_HEADER,
OPENED_VIEW_ADMIN,
OPENED_MEDIA_LIBRARY,
OPENED_BLOG_SETTINGS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,10 @@ private AnalyticsTrackerMixpanelInstructionsForStat instructionsForStat(
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Site Menu - Opened View Site");
break;
case OPENED_VIEW_SITE_FROM_HEADER:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Site Menu - Opened View Site From Header");
break;
case OPENED_VIEW_ADMIN:
instructions = AnalyticsTrackerMixpanelInstructionsForStat.
mixpanelInstructionsForEventName("Site Menu - Opened View Admin");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public void track(AnalyticsTracker.Stat stat, Map<String, ?> properties) {
case OPENED_VIEW_SITE:
predefinedEventProperties.put("menu_item", "view_site");
break;
case OPENED_VIEW_SITE_FROM_HEADER:
predefinedEventProperties.put("menu_item", "view_site_from_header");
break;
case OPENED_VIEW_ADMIN:
predefinedEventProperties.put("menu_item", "view_admin");
break;
Expand Down Expand Up @@ -434,6 +437,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) {
return "site_menu_opened";
case OPENED_VIEW_SITE:
return "site_menu_opened";
case OPENED_VIEW_SITE_FROM_HEADER:
return "site_menu_opened";
case OPENED_VIEW_ADMIN:
return "site_menu_opened";
case OPENED_MEDIA_LIBRARY:
Expand Down