use of android.widget.ImageView in project ion by koush.
the class KenBurnsSample method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
KenBurnsView view = new KenBurnsView(this);
setContentView(view);
final ProgressDialog dlg = new ProgressDialog(this);
dlg.setTitle("Loading...");
dlg.setIndeterminate(false);
dlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dlg.show();
// this is going to load a 30mb download...
Ion.with(this).load("file:///android_asset/telescope.jpg").progressDialog(dlg).setLogging("DeepZoom", Log.VERBOSE).withBitmap().deepZoom().intoImageView(view).setCallback(new FutureCallback<ImageView>() {
@Override
public void onCompleted(Exception e, ImageView result) {
dlg.cancel();
}
});
}
use of android.widget.ImageView in project ion by koush.
the class LollipopTransition method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lollipop_list);
ImageView[] ivs = new ImageView[] { (ImageView) findViewById(R.id.one), (ImageView) findViewById(R.id.two), (ImageView) findViewById(R.id.three), (ImageView) findViewById(R.id.four) };
for (int i = 1; i <= ivs.length; i++) {
final int thumb = i;
ImageView iv = ivs[i - 1];
Ion.with(iv).centerCrop().load("https://raw.githubusercontent.com/koush/SampleImages/master/" + i + ".thumb.jpg");
iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ImageView iv = (ImageView) v;
BitmapInfo bi = Ion.with(iv).getBitmapInfo();
Intent intent = new Intent(LollipopTransition.this, LollipopTransitionFullscreen.class);
intent.putExtra("bitmapInfo", bi.key);
intent.putExtra("thumb", thumb);
startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(LollipopTransition.this, iv, "photo_hero").toBundle());
}
});
}
}
use of android.widget.ImageView in project glitch-hq-android by tinyspeck.
the class MailboxListViewAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView != null) {
holder = (ViewHolder) convertView.getTag();
}
if (holder == null) {
convertView = m_inflater.inflate(R.layout.mailbox_list_item, null);
holder = new ViewHolder();
holder.name = (TextView) convertView.findViewById(R.id.inbox_message_name);
holder.name.setTypeface(m_application.m_vagFont);
holder.text = (TextView) convertView.findViewById(R.id.inbox_message_text);
holder.text.setTypeface(m_application.m_vagLightFont);
holder.time = (TextView) convertView.findViewById(R.id.inbox_message_when);
holder.time.setTypeface(m_application.m_vagLightFont);
holder.icon = (ImageView) convertView.findViewById(R.id.icon_message_sender);
holder.divider = (View) convertView.findViewById(R.id.inbox_message_divider);
holder.whole = (View) convertView.findViewById(R.id.inbox_item);
convertView.setTag(holder);
}
holder = (ViewHolder) convertView.getTag();
if (position < getCount()) {
glitchMail message = m_mailList.get(position);
if (message.sender_label != null && !message.sender_label.equals("")) {
holder.name.setText(message.sender_label);
holder.text.setText(message.text);
} else {
holder.name.setText("Glitch");
holder.text.setText(Html.fromHtml(message.text));
}
if (message.sender_avatar != null && !message.sender_avatar.equals("")) {
DrawableURL.CropShow(holder.icon, message.sender_avatar + "_100.png");
} else {
BitmapUtil.CropShow(holder.icon, BitmapFactory.decodeResource(m_act.getResources(), R.drawable.wireframe));
holder.icon.setVisibility(View.INVISIBLE);
}
if (message.is_read == false) {
holder.text.setTypeface(m_application.m_vagLightFont, Typeface.BOLD);
}
holder.time.setText(Util.TimeToString((int) (System.currentTimeMillis() / 1000 - message.received)));
if (position == getCount() - 1)
holder.divider.setVisibility(View.GONE);
else
holder.divider.setVisibility(View.VISIBLE);
}
holder.whole.setTag(position);
holder.whole.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
glitchMail currentMessage = m_mailList.get((Integer) v.getTag());
if (currentMessage.is_read == false) {
((MailboxFragment) m_bf).markAsRead(currentMessage.id);
((TextView) v.findViewById(R.id.inbox_message_text)).setTypeface(m_application.m_vagLightFont, Typeface.NORMAL);
}
MailboxDetailFragment fm = new MailboxDetailFragment(currentMessage.id);
((HomeScreen) m_act).setCurrentFragment(fm, true);
}
});
return convertView;
}
use of android.widget.ImageView in project glitch-hq-android by tinyspeck.
the class ProfileFragment method init.
private void init(View root) {
boolean bUpdateData = m_actList == null;
View profileSelf = root.findViewById(R.id.profile_user_self);
View profileOther = root.findViewById(R.id.profile_others);
ImageView vbg = (ImageView) root.findViewById(R.id.profilebg);
int nType = Util.GetScreenSizeAttribute(getActivity());
int[] resBackgrounds = { R.drawable.profile_background, R.drawable.profile_background_l, R.drawable.profile_background_xl };
int[] resGroddleBg = { R.drawable.profile_other_background, R.drawable.profile_other_background, R.drawable.profile_other_background_xl };
vbg.setImageResource(m_bOtherProfile ? resGroddleBg[nType] : resBackgrounds[nType]);
if (nType == 0) {
int nPaddingTop = 180;
int nWidth = Util.GetScreenSize(getActivity()).widthPixels;
if (nWidth > 320)
nPaddingTop = 170;
if (m_bOtherProfile)
nPaddingTop -= 36;
vbg.setPadding(0, nPaddingTop, 0, 0);
} else if (nType == 2) {
int nPaddingTop = 120;
if (m_bOtherProfile)
nPaddingTop = 0;
vbg.setPadding(0, nPaddingTop, 0, 0);
}
ScrollView sv = (ScrollView) root.findViewById(R.id.scr_profile);
sv.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent arg1) {
return true;
}
});
profileSelf.setVisibility(m_bOtherProfile ? View.GONE : View.VISIBLE);
profileOther.setVisibility(m_bOtherProfile ? View.VISIBLE : View.GONE);
((ImageView) root.findViewById(R.id.rookfossil_image)).setVisibility(m_bOtherProfile ? View.GONE : View.VISIBLE);
((ImageView) root.findViewById(R.id.treasure_image)).setVisibility(m_bOtherProfile ? View.VISIBLE : View.GONE);
m_vProfile = m_bOtherProfile ? profileOther : profileSelf;
nameTextView = (TextView) m_vProfile.findViewById(R.id.playername);
nameTextView.setTypeface(m_application.m_vagFont);
m_listView = (LinearListView) root.findViewById(R.id.homeListView);
m_learningListView = (LinearListView) root.findViewById(R.id.learning_list);
m_unlearningListView = (LinearListView) root.findViewById(R.id.unlearning_list);
m_onlineIcon = (ImageView) m_vProfile.findViewById(R.id.player_online_status);
m_avatar = (ImageView) m_vProfile.findViewById(R.id.avatar);
if (!m_bOtherProfile) {
m_tv_currants = (TextView) m_vProfile.findViewById(R.id.profile_currant_amount);
m_tv_currants.setTypeface(m_application.m_vagLightFont);
m_tv_imagination = (TextView) m_vProfile.findViewById(R.id.profile_imagination_amount);
m_tv_imagination.setTypeface(m_application.m_vagLightFont);
}
m_tv_level = (TextView) m_vProfile.findViewById(R.id.tv_level);
m_tv_level.setTypeface(m_application.m_vagLightFont);
m_tv_achievements = (TextView) m_vProfile.findViewById(R.id.tv_achievements);
m_tv_achievements.setTypeface(m_application.m_vagLightFont);
m_tv_skills = (TextView) m_vProfile.findViewById(R.id.tv_skills);
m_tv_skills.setTypeface(m_application.m_vagLightFont);
m_tv_upgrades = (TextView) m_vProfile.findViewById(R.id.tv_upgrades);
m_tv_upgrades.setTypeface(m_application.m_vagLightFont);
if (bUpdateData)
m_actList = new Vector<glitchActivity>();
m_adapter = new ActivityListViewAdapter(this, m_actList);
m_listView.setAdapter(m_adapter);
if (bUpdateData) {
m_learningList = new Vector<skillAvailable>();
m_unlearningList = new Vector<skillAvailable>();
}
m_learningAdapter = new LearningListViewAdapter(getActivity(), m_learningList);
m_learningListView.setAdapter(m_learningAdapter);
m_unlearningAdapter = new UnlearningListViewAdapter(getActivity(), m_unlearningList);
m_unlearningListView.setAdapter(m_unlearningAdapter);
View clouds = root.findViewById(R.id.clouds);
Util.startTranslateAnimation(clouds, 300000);
m_learningListView.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
skillAvailable skill = m_learningList.get(0);
SkillDetailFragment fm = new SkillDetailFragment(m_this, skill);
((HomeScreen) getActivity()).setCurrentFragment(fm, true);
}
});
m_unlearningListView.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
skillAvailable skill = m_unlearningList.get(0);
SkillDetailFragment fm = new SkillDetailFragment(m_this, skill);
((HomeScreen) getActivity()).setCurrentFragment(fm, true);
}
});
// initPushToRefresh();
setupSettings();
if (m_bOtherProfile) {
m_learningListView.setVisibility(View.GONE);
m_unlearningListView.setVisibility(View.GONE);
if (bUpdateData)
getProfileInfo(false);
} else {
m_learningListView.setVisibility(View.VISIBLE);
m_unlearningListView.setVisibility(View.VISIBLE);
if (bUpdateData) {
GlitchRequest request = m_application.glitch.getRequest("players.info");
request.execute(this);
}
}
if (!bUpdateData)
showProfilePage();
}
use of android.widget.ImageView in project glitch-hq-android by tinyspeck.
the class LoginScreen method setupTitlebar.
private void setupTitlebar() {
ImageView v = (ImageView) findViewById(R.id.img_title_bar);
if (v != null) {
int[] nRes = { R.drawable.navbar_l, R.drawable.navbar_l, R.drawable.navbar_xl };
int nType = Util.GetScreenSizeAttribute(this);
v.setImageResource(nRes[nType]);
}
}
Aggregations