use of com.klinker.android.twitter.views.NetworkedCacheableImageView in project Talon-for-Twitter by klinker24.
the class TimelineArrayAdapter method newView.
public View newView(ViewGroup viewGroup) {
View v = null;
final ViewHolder holder = new ViewHolder();
if (settings.addonTheme) {
try {
Context viewContext = null;
if (res == null) {
res = context.getPackageManager().getResourcesForApplication(settings.addonThemePackage);
}
try {
viewContext = context.createPackageContext(settings.addonThemePackage, Context.CONTEXT_IGNORE_SECURITY);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
if (res != null && viewContext != null) {
int id = res.getIdentifier("tweet", "layout", settings.addonThemePackage);
v = LayoutInflater.from(viewContext).inflate(res.getLayout(id), null);
holder.name = (TextView) v.findViewById(res.getIdentifier("name", "id", settings.addonThemePackage));
holder.profilePic = (ImageView) v.findViewById(res.getIdentifier("profile_pic", "id", settings.addonThemePackage));
holder.time = (TextView) v.findViewById(res.getIdentifier("time", "id", settings.addonThemePackage));
holder.tweet = (TextView) v.findViewById(res.getIdentifier("tweet", "id", settings.addonThemePackage));
holder.reply = (EditText) v.findViewById(res.getIdentifier("reply", "id", settings.addonThemePackage));
holder.favorite = (ImageButton) v.findViewById(res.getIdentifier("favorite", "id", settings.addonThemePackage));
holder.retweet = (ImageButton) v.findViewById(res.getIdentifier("retweet", "id", settings.addonThemePackage));
holder.favCount = (TextView) v.findViewById(res.getIdentifier("fav_count", "id", settings.addonThemePackage));
holder.retweetCount = (TextView) v.findViewById(res.getIdentifier("retweet_count", "id", settings.addonThemePackage));
holder.expandArea = (LinearLayout) v.findViewById(res.getIdentifier("expansion", "id", settings.addonThemePackage));
holder.replyButton = (ImageButton) v.findViewById(res.getIdentifier("reply_button", "id", settings.addonThemePackage));
holder.image = (ImageView) v.findViewById(res.getIdentifier("image", "id", settings.addonThemePackage));
holder.retweeter = (TextView) v.findViewById(res.getIdentifier("retweeter", "id", settings.addonThemePackage));
holder.background = (LinearLayout) v.findViewById(res.getIdentifier("background", "id", settings.addonThemePackage));
holder.playButton = (ImageView) v.findViewById(res.getIdentifier("play_button", "id", settings.addonThemePackage));
holder.screenTV = (TextView) v.findViewById(res.getIdentifier("screenname", "id", settings.addonThemePackage));
try {
holder.quoteButton = (ImageButton) v.findViewById(res.getIdentifier("quote_button", "id", settings.addonThemePackage));
holder.shareButton = (ImageButton) v.findViewById(res.getIdentifier("share_button", "id", settings.addonThemePackage));
} catch (Exception e) {
// they don't exist because the theme was made before they were added
}
try {
holder.isAConversation = (ImageView) v.findViewById(res.getIdentifier("is_a_conversation", "id", settings.addonThemePackage));
} catch (Exception e) {
}
}
} catch (Exception e) {
e.printStackTrace();
v = inflater.inflate(layout, viewGroup, false);
holder.name = (TextView) v.findViewById(R.id.name);
holder.profilePic = (ImageView) v.findViewById(R.id.profile_pic);
holder.time = (TextView) v.findViewById(R.id.time);
holder.tweet = (TextView) v.findViewById(R.id.tweet);
holder.reply = (EditText) v.findViewById(R.id.reply);
holder.favorite = (ImageButton) v.findViewById(R.id.favorite);
holder.retweet = (ImageButton) v.findViewById(R.id.retweet);
holder.favCount = (TextView) v.findViewById(R.id.fav_count);
holder.retweetCount = (TextView) v.findViewById(R.id.retweet_count);
holder.expandArea = (LinearLayout) v.findViewById(R.id.expansion);
holder.replyButton = (ImageButton) v.findViewById(R.id.reply_button);
holder.image = (NetworkedCacheableImageView) v.findViewById(R.id.image);
holder.retweeter = (TextView) v.findViewById(R.id.retweeter);
holder.background = (LinearLayout) v.findViewById(R.id.background);
holder.playButton = (NetworkedCacheableImageView) v.findViewById(R.id.play_button);
holder.screenTV = (TextView) v.findViewById(R.id.screenname);
try {
holder.quoteButton = (ImageButton) v.findViewById(R.id.quote_button);
holder.shareButton = (ImageButton) v.findViewById(R.id.share_button);
} catch (Exception x) {
// theme was made before they were added
}
try {
holder.isAConversation = (ImageView) v.findViewById(R.id.is_a_conversation);
} catch (Exception x) {
}
}
} else {
v = inflater.inflate(layout, viewGroup, false);
holder.name = (TextView) v.findViewById(R.id.name);
holder.profilePic = (ImageView) v.findViewById(R.id.profile_pic);
holder.time = (TextView) v.findViewById(R.id.time);
holder.tweet = (TextView) v.findViewById(R.id.tweet);
holder.reply = (EditText) v.findViewById(R.id.reply);
holder.favorite = (ImageButton) v.findViewById(R.id.favorite);
holder.retweet = (ImageButton) v.findViewById(R.id.retweet);
holder.favCount = (TextView) v.findViewById(R.id.fav_count);
holder.retweetCount = (TextView) v.findViewById(R.id.retweet_count);
holder.expandArea = (LinearLayout) v.findViewById(R.id.expansion);
holder.replyButton = (ImageButton) v.findViewById(R.id.reply_button);
holder.image = (NetworkedCacheableImageView) v.findViewById(R.id.image);
holder.retweeter = (TextView) v.findViewById(R.id.retweeter);
holder.background = (LinearLayout) v.findViewById(R.id.background);
holder.playButton = (NetworkedCacheableImageView) v.findViewById(R.id.play_button);
holder.screenTV = (TextView) v.findViewById(R.id.screenname);
try {
holder.quoteButton = (ImageButton) v.findViewById(R.id.quote_button);
holder.shareButton = (ImageButton) v.findViewById(R.id.share_button);
} catch (Exception x) {
// theme was made before they were added
}
try {
holder.isAConversation = (ImageView) v.findViewById(R.id.is_a_conversation);
} catch (Exception x) {
}
}
// sets up the font sizes
holder.tweet.setTextSize(settings.textSize);
holder.name.setTextSize(settings.textSize + 4);
holder.screenTV.setTextSize(settings.textSize - 2);
holder.time.setTextSize(settings.textSize - 3);
holder.retweeter.setTextSize(settings.textSize - 3);
holder.favCount.setTextSize(settings.textSize + 1);
holder.retweetCount.setTextSize(settings.textSize + 1);
holder.reply.setTextSize(settings.textSize);
v.setTag(holder);
return v;
}
use of com.klinker.android.twitter.views.NetworkedCacheableImageView in project Talon-for-Twitter by klinker24.
the class InteractionsCursorAdapter method newView.
@Override
public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
View v = null;
final ViewHolder holder = new ViewHolder();
v = inflater.inflate(layout, viewGroup, false);
holder.title = (HoloTextView) v.findViewById(R.id.title);
holder.text = (HoloTextView) v.findViewById(R.id.text);
holder.background = (LinearLayout) v.findViewById(R.id.background);
holder.picture = (NetworkedCacheableImageView) v.findViewById(R.id.picture);
// sets up the font sizes
holder.title.setTextSize(15);
holder.text.setTextSize(14);
v.setTag(holder);
return v;
}
use of com.klinker.android.twitter.views.NetworkedCacheableImageView in project Talon-for-Twitter by klinker24.
the class MultiplePicsGridAdapter method getView.
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.picture, null);
AbsListView.LayoutParams params = new AbsListView.LayoutParams(gridWidth, gridWidth);
convertView.setLayoutParams(params);
ViewHolder holder = new ViewHolder();
holder.iv = (NetworkedCacheableImageView) convertView.findViewById(R.id.picture);
convertView.setTag(holder);
}
final ViewHolder holder = (ViewHolder) convertView.getTag();
holder.iv.loadImage(text.get(position), false, new NetworkedCacheableImageView.OnImageLoadedListener() {
@Override
public void onImageLoaded(CacheableBitmapDrawable result) {
holder.iv.setBackgroundDrawable(null);
}
});
holder.iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent viewImage = new Intent(context, PhotoPagerActivity.class);
viewImage.putExtra("url", pics);
viewImage.putExtra("start_page", position);
context.startActivity(viewImage);
}
});
return convertView;
}
use of com.klinker.android.twitter.views.NetworkedCacheableImageView in project Talon-for-Twitter by klinker24.
the class PicturesArrayAdapter method newView.
public View newView(ViewGroup viewGroup) {
View v;
final ViewHolder holder;
v = inflater.inflate(R.layout.picture, viewGroup, false);
holder = new ViewHolder();
holder.iv = (NetworkedCacheableImageView) v.findViewById(R.id.picture);
v.setTag(holder);
return v;
}
use of com.klinker.android.twitter.views.NetworkedCacheableImageView in project Talon-for-Twitter by klinker24.
the class ComposeSecAccActivity method setUpReplyText.
public void setUpReplyText() {
useAccOne = false;
useAccTwo = true;
NetworkedCacheableImageView pic = (NetworkedCacheableImageView) findViewById(R.id.profile_pic);
HoloTextView currentName = (HoloTextView) findViewById(R.id.current_name);
if (settings.roundContactImages) {
pic.loadImage(settings.secondProfilePicUrl, false, null, NetworkedCacheableImageView.CIRCLE);
} else {
pic.loadImage(settings.secondProfilePicUrl, false, null);
}
currentName.setText("@" + settings.secondScreenName);
// for failed notification
if (!sharedPrefs.getString("draft", "").equals("")) {
reply.setText(sharedPrefs.getString("draft", ""));
reply.setSelection(reply.getText().length());
}
String to = getIntent().getStringExtra("user") + (isDM ? "" : " ");
if ((!to.equals("null ") && !isDM) || (isDM && !to.equals("null"))) {
if (!isDM) {
Log.v("username_for_noti", "to place: " + to);
reply.setText(to);
reply.setSelection(reply.getText().toString().length());
} else {
contactEntry.setText(to);
reply.requestFocus();
}
sharedPrefs.edit().putString("draft", "").commit();
}
notiId = getIntent().getLongExtra("id", 0);
replyText = getIntent().getStringExtra("reply_to_text");
// Get intent, action and MIME type
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
// Handle text being sent
handleSendText(intent);
} else if (type.startsWith("image/")) {
// Handle single image being sent
handleSendImage(intent);
}
}
}
Aggregations