This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jp.takke.ui; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.graphics.drawable.Drawable; | |
import android.view.View; | |
import android.view.Window; | |
import android.widget.Button; | |
import android.widget.ListAdapter; | |
import android.widget.ListView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2015 takke (@takke) <http://takke.jp/> | |
// All rights reserved. | |
// | |
// LICENSE is NYSL (http://www.kmonos.net/nysl/) | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ハッシュタグやメンションを置換する | |
* | |
* @param html | |
* @param targets | |
* @return | |
*/ | |
private static String replaceHashtagMentions(String html, final ArrayList<HashtagMentionEntity> targets) { | |
// 先に出てくる順にソート |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
takke@tm-nuc:~$ twurl "/1.1/statuses/show.json?id=479307198901026816" | php -R 'print_r(json_decode($argn));' | |
stdClass Object | |
( | |
[created_at] => Wed Jun 18 16:58:35 +0000 2014 | |
[id] => 479307198901026816 | |
[id_str] => 479307198901026816 | |
[text] => Starting today, you can share and view animated GIFs on http://t.co/wJD8Fp317i, Android and iPhone. http://t.co/XBrAbOm4Ya | |
[source] => <a href="http://twitter.com" rel="nofollow">Twitter Web Client</a> | |
[truncated] => | |
[in_reply_to_status_id] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
takke@tm-nuc:~$ twurl "/1.1/statuses/show.json?id=449660889793581056" | php -R 'print_r(json_decode($argn));' | |
stdClass Object | |
( | |
[created_at] => Fri Mar 28 21:34:45 +0000 2014 | |
[id] => 449660889793581056 | |
[id_str] => 449660889793581056 | |
[text] => "I hope you'll keep...building bonds of friendship that will enrich your lives & enrich our world" ―FLOTUS in China, http://t.co/fxmuQN9JL9 | |
[source] => <a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a> | |
[truncated] => | |
[in_reply_to_status_id] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2007 Yusuke Yamamoto | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kick parallel (for benchmark) | |
class Box { | |
long total = 0; | |
int child = 0; | |
} | |
final Box box = new Box(); | |
final int childCount = 10; | |
for (int i=0; i<childCount; i++) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DM画像認証対応 | |
MyLog.d("doDownloadImage, download image with twitter4j"); | |
final Twitter twitter = TPUtil.getTwitterInstance(context); | |
try { | |
final Class<? extends Twitter> c = twitter.getClass(); | |
final Method m = c.getDeclaredMethod("get", String.class); | |
m.setAccessible(true); | |
final HttpResponse res = (HttpResponse) m.invoke(twitter, rawImageUrl); // twitter.get(rawImageUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("deprecation") | |
protected void showTwiccaPluginConfig() { | |
// twicca 対応アプリ一覧探索 | |
final PackageManager pm = getPackageManager(); | |
final Intent intent = new Intent("jp.r246.twicca.ACTION_PLUGIN_SETTINGS"); | |
final List<ResolveInfo> resolveInfo = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); | |
if (resolveInfo.size() == 0) { | |
Toast.makeText(this, R.string.twicca_plugin_not_found, Toast.LENGTH_SHORT).show(); |
NewerOlder