simplified share intent label

This commit is contained in:
Mariotaku Lee 2015-03-23 01:38:41 +08:00
parent 6a62ba6382
commit 9ff0ffa7f9
6 changed files with 28 additions and 25 deletions

View File

@ -163,7 +163,7 @@
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter android:label="@string/share_via_twidere">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.SEND_MULTIPLE"/>

View File

@ -27,13 +27,13 @@ import org.mariotaku.twidere.util.TwidereLinkify;
*/
public class TypeMapingUtil {
public class TypeMappingUtil {
public static String getLinkType (int type) {
public static String getLinkType(int type) {
String linkType = "";
switch (type) {
case TwidereLinkify.LINK_TYPE_MENTION:
linkType = "mention";
linkType = "mention";
break;
case TwidereLinkify.LINK_TYPE_CASHTAG:
linkType = "cashTag";
@ -61,11 +61,14 @@ public class TypeMapingUtil {
}
public static String getMediaType (int type) {
public static String getMediaType(int type) {
String mediaType = "";
switch (type) {
case ParcelableMedia.TYPE_IMAGE:
mediaType = "image";
mediaType = "image";
break;
case ParcelableMedia.TYPE_VIDEO:
mediaType = "video";
break;
default:
mediaType = "unknown";

View File

@ -111,7 +111,7 @@ import java.util.List;
import java.util.Locale;
import edu.tsinghua.spice.Utilies.SpiceProfilingUtil;
import edu.tsinghua.spice.Utilies.TypeMapingUtil;
import edu.tsinghua.spice.Utilies.TypeMappingUtil;
import twitter4j.TwitterException;
import static android.text.TextUtils.isEmpty;
@ -312,9 +312,9 @@ public class StatusFragment extends BaseSupportFragment
Utils.openMediaDirectly(getActivity(), accountId, status, media, status.media);
//spice
SpiceProfilingUtil.log(getActivity(),
status.id + ",Clicked," + accountId + "," + status.user_id + "," + status.text_plain.length() + "," + media.media_url + "," + TypeMapingUtil.getMediaType(media.type) + "," + status.timestamp);
status.id + ",Clicked," + accountId + "," + status.user_id + "," + status.text_plain.length() + "," + media.media_url + "," + TypeMappingUtil.getMediaType(media.type) + "," + status.timestamp);
SpiceProfilingUtil.profile(getActivity(), accountId,
status.id + ",Clicked," + accountId + "," + status.user_id + "," + status.text_plain.length() + "," + media.media_url + "," + TypeMapingUtil.getMediaType(media.type) + "," + status.timestamp);
status.id + ",Clicked," + accountId + "," + status.user_id + "," + status.text_plain.length() + "," + media.media_url + "," + TypeMappingUtil.getMediaType(media.type) + "," + status.timestamp);
//end
}
@ -390,22 +390,22 @@ public class StatusFragment extends BaseSupportFragment
+ "," + status.text_plain.length() + "," + status.timestamp);
} else {
for (final ParcelableMedia spiceMedia : status.media) {
if (TypeMapingUtil.getMediaType(spiceMedia.type).equals("image")) {
if (TypeMappingUtil.getMediaType(spiceMedia.type).equals("image")) {
SpiceProfilingUtil.profile(getActivity(), status.account_id,
status.id + ",PreviewM," + status.account_id + "," + status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + status.text_plain.length() + "," + TypeMapingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + spiceMedia.width + "x" + spiceMedia.height + ","
+ "," + status.text_plain.length() + "," + TypeMappingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + spiceMedia.width + "x" + spiceMedia.height + ","
+ status.timestamp);
SpiceProfilingUtil.log(getActivity(),
status.id + ",PreviewM," + status.account_id + "," + status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + status.text_plain.length() + "," + TypeMapingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + spiceMedia.width + "x" + spiceMedia.height + ","
+ "," + status.text_plain.length() + "," + TypeMappingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + spiceMedia.width + "x" + spiceMedia.height + ","
+ status.timestamp);
} else {
SpiceProfilingUtil.profile(getActivity(), status.account_id,
status.id + ",PreviewO," + status.account_id + "," + status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + status.text_plain.length() + "," + TypeMapingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + status.timestamp);
+ "," + status.text_plain.length() + "," + TypeMappingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + status.timestamp);
SpiceProfilingUtil.log(getActivity(),
status.id + ",PreviewO," + status.account_id + "," + status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + status.text_plain.length() + "," + TypeMapingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + status.timestamp);
+ "," + status.text_plain.length() + "," + TypeMappingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.media_url + "," + status.timestamp);
}
}
}

View File

@ -84,7 +84,7 @@ import java.util.Collections;
import java.util.List;
import edu.tsinghua.spice.Utilies.SpiceProfilingUtil;
import edu.tsinghua.spice.Utilies.TypeMapingUtil;
import edu.tsinghua.spice.Utilies.TypeMappingUtil;
import twitter4j.MediaUploadResponse;
import twitter4j.Status;
import twitter4j.StatusUpdate;
@ -336,9 +336,9 @@ public class BackgroundOperationService extends IntentService implements Constan
} else
for (final ParcelableMedia spiceMedia : response.getData().media) {
SpiceProfilingUtil.log(this.getBaseContext(), response.getData().id + ",Media," + response.getData().account_id + ","
+ response.getData().in_reply_to_user_id + "," + response.getData().in_reply_to_status_id + "," + spiceMedia.media_url + "," + TypeMapingUtil.getMediaType(spiceMedia.type));
+ response.getData().in_reply_to_user_id + "," + response.getData().in_reply_to_status_id + "," + spiceMedia.media_url + "," + TypeMappingUtil.getMediaType(spiceMedia.type));
SpiceProfilingUtil.profile(this.getBaseContext(), response.getData().account_id, response.getData().id + ",Media," + response.getData().account_id + ","
+ response.getData().in_reply_to_user_id + "," + response.getData().in_reply_to_status_id + "," + spiceMedia.media_url + "," + TypeMapingUtil.getMediaType(spiceMedia.type));
+ response.getData().in_reply_to_user_id + "," + response.getData().in_reply_to_status_id + "," + spiceMedia.media_url + "," + TypeMappingUtil.getMediaType(spiceMedia.type));
}
//end
}

View File

@ -81,7 +81,7 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import edu.tsinghua.spice.Utilies.SpiceProfilingUtil;
import edu.tsinghua.spice.Utilies.TypeMapingUtil;
import edu.tsinghua.spice.Utilies.TypeMappingUtil;
import edu.ucdavis.earlybird.ProfilingUtil;
import twitter4j.DirectMessage;
import twitter4j.Paging;
@ -2339,20 +2339,20 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
+ status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count);
} else {
for (final ParcelableMedia spiceMedia : status.media) {
if (TypeMapingUtil.getMediaType(spiceMedia.type).equals("image")) {
if (TypeMappingUtil.getMediaType(spiceMedia.type).equals("image")) {
SpiceProfilingUtil.log(getContext(), status.id + ",RetweetM," + account_id + ","
+ status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + spiceMedia.media_url + "," + TypeMapingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.width + "x" + spiceMedia.height);
+ "," + spiceMedia.media_url + "," + TypeMappingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.width + "x" + spiceMedia.height);
SpiceProfilingUtil.profile(getContext(), account_id, status.id + ",RetweetM," + account_id + ","
+ status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + spiceMedia.media_url + "," + TypeMapingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.width + "x" + spiceMedia.height);
+ "," + spiceMedia.media_url + "," + TypeMappingUtil.getMediaType(spiceMedia.type) + "," + spiceMedia.width + "x" + spiceMedia.height);
} else {
SpiceProfilingUtil.log(getContext(), status.id + ",RetweetO," + account_id + ","
+ status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + spiceMedia.media_url + "," + TypeMapingUtil.getMediaType(spiceMedia.type));
+ "," + spiceMedia.media_url + "," + TypeMappingUtil.getMediaType(spiceMedia.type));
SpiceProfilingUtil.profile(getContext(), account_id, status.id + ",RetweetO," + account_id + ","
+ status.user_id + "," + status.reply_count + "," + status.retweet_count + "," + status.favorite_count
+ "," + spiceMedia.media_url + "," + TypeMapingUtil.getMediaType(spiceMedia.type));
+ "," + spiceMedia.media_url + "," + TypeMappingUtil.getMediaType(spiceMedia.type));
}
}
}

View File

@ -31,7 +31,7 @@ import org.mariotaku.twidere.model.ParcelableMedia;
import org.mariotaku.twidere.util.TwidereLinkify.OnLinkClickListener;
import edu.tsinghua.spice.Utilies.SpiceProfilingUtil;
import edu.tsinghua.spice.Utilies.TypeMapingUtil;
import edu.tsinghua.spice.Utilies.TypeMappingUtil;
import edu.ucdavis.earlybird.ProfilingUtil;
import static org.mariotaku.twidere.util.Utils.openStatus;
@ -59,7 +59,7 @@ public class OnLinkClickHandler implements OnLinkClickListener, Constants {
// UCD
ProfilingUtil.profile(context, account_id, "Click, " + link + ", " + type);
//spice
SpiceProfilingUtil.profile(context, account_id, account_id + ",Visit," + link + "," + TypeMapingUtil.getLinkType(type));
SpiceProfilingUtil.profile(context, account_id, account_id + ",Visit," + link + "," + TypeMappingUtil.getLinkType(type));
//end
}