use of android.widget.TextView in project cucumber-jvm by cucumber.
the class CalculatorActivitySteps method I_should_see_s_on_the_display.
@Then("^I should see (\\S+) on the display$")
public void I_should_see_s_on_the_display(String s) {
TextView display = (TextView) getActivity().findViewById(R.id.txt_calc_display);
String displayed_result = display.getText().toString();
assertEquals(s, displayed_result);
}
use of android.widget.TextView in project AnimeTaste by daimajia.
the class StartActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mContext = this;
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
mVideoList = (ListView) findViewById(R.id.videoList);
mDrawerList = (ListView) findViewById(R.id.function_list);
mDrawer = (LinearLayout) findViewById(R.id.drawer);
mLayoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mCategoryList = (ListView) findViewById(R.id.category_list);
mFooterView = mLayoutInflater.inflate(R.layout.load_item, null);
mLoadProgress = (ProgressBar) mFooterView.findViewById(R.id.loading);
mLoadText = (TextView) mFooterView.findViewById(R.id.load_text);
mVideoList.addFooterView(mFooterView);
mVideoList.setOnScrollListener(this);
mDrawer.setOnTouchListener(this);
View headerView = mLayoutInflater.inflate(R.layout.gallery_item, null, false);
mVideoList.addHeaderView(headerView);
mRecommendPager = (ViewPager) headerView.findViewById(R.id.pager);
mRecommendPager.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
PointF downP = new PointF();
PointF curP = new PointF();
int act = event.getAction();
if (act == MotionEvent.ACTION_DOWN || act == MotionEvent.ACTION_MOVE || act == MotionEvent.ACTION_UP) {
((ViewGroup) v).requestDisallowInterceptTouchEvent(true);
if (downP.x == curP.x && downP.y == curP.y) {
return false;
}
}
return false;
}
});
mRecommendIndicator = (UnderlinePageIndicator) headerView.findViewById(R.id.indicator);
if (getIntent().hasExtra("Success")) {
init(getIntent());
} else {
Toast.makeText(mContext, R.string.init_failed, Toast.LENGTH_SHORT).show();
finish();
}
mDrawerAapter = new SimpleAdapter(this, getDrawerItems(), R.layout.drawer_item, new String[] { "img", "title" }, new int[] { R.id.item_icon, R.id.item_name });
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_action_navigation_menu, R.string.app_name, R.string.app_name) {
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
if (mPreviousType != mType || mPreviousCategoryId != mCategoryId) {
mCurrentPage = 1;
mIsEnd = false;
mVideoAdapter.removeAllData();
mFooterView.findViewById(R.id.loading).setVisibility(View.VISIBLE);
mFooterView.findViewById(R.id.load_text).setVisibility(View.INVISIBLE);
triggerApiConnector();
}
}
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
mPreviousType = mType;
mPreviousCategoryId = mCategoryId;
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerList.setAdapter(mDrawerAapter);
mDrawerList.setOnItemClickListener(this);
ViewUtils.setListViewHeightBasedOnChildren(mDrawerList);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(true);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
getSupportActionBar().setLogo(R.drawable.rsz_ab_icon);
rateForUsOrCheckUpdate();
showWhatsNew();
}
use of android.widget.TextView in project AnimeTaste by daimajia.
the class AnimationListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView titleTextView;
TextView contentTextView;
ImageView thumbImageView;
ViewHolder holder;
if (convertView == null) {
convertView = mLayoutInflater.inflate(R.layout.video_item, parent, false);
titleTextView = (TextView) convertView.findViewById(R.id.title);
contentTextView = (TextView) convertView.findViewById(R.id.content);
thumbImageView = (ImageView) convertView.findViewById(R.id.thumb);
titleTextView.setTypeface(mRobotoTitle);
holder = new ViewHolder(titleTextView, contentTextView, thumbImageView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
titleTextView = holder.titleText;
contentTextView = holder.contentText;
thumbImageView = holder.thumbImageView;
}
Animation animation = (Animation) getItem(position);
Picasso.with(mContext).load(animation.HomePic).placeholder(R.drawable.placeholder_thumb).error(R.drawable.placeholder_fail).into(thumbImageView);
titleTextView.setText(animation.Name);
contentTextView.setText(animation.Brief);
convertView.setOnClickListener(new AnimationItemOnClickListener(animation));
convertView.setOnLongClickListener(new OnLongClickListener() {
// 保证长按事件传递
@Override
public boolean onLongClick(View v) {
return false;
}
});
titleTextView.setTextColor(animation.isWatched() ? mWatchedTitleColor : mUnWatchedTitleColor);
return convertView;
}
use of android.widget.TextView in project AnimationEasingFunctions by daimajia.
the class EasingAdapter method getView.
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
Object o = getItem(i);
BaseEasingMethod b = ((Skill) o).getMethod(1000);
int start = b.getClass().getName().lastIndexOf(".") + 1;
String name = b.getClass().getName().substring(start);
View v = LayoutInflater.from(mContext).inflate(R.layout.item, null);
TextView tv = (TextView) v.findViewById(R.id.list_item_text);
tv.setText(name);
v.setTag(o);
return v;
}
use of android.widget.TextView in project subsampling-scale-image-view by davemorrissey.
the class ConfigurationActivity method updateNotes.
private void updateNotes() {
if (position > notes.size() - 1) {
return;
}
getActionBar().setSubtitle(notes.get(position).subtitle);
((TextView) findViewById(id.note)).setText(notes.get(position).text);
findViewById(id.next).setVisibility(position >= notes.size() - 1 ? View.INVISIBLE : View.VISIBLE);
findViewById(id.previous).setVisibility(position <= 0 ? View.INVISIBLE : View.VISIBLE);
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) findViewById(id.imageView);
if (position == 0) {
imageView.setMinimumDpi(50);
} else {
imageView.setMaxScale(2F);
}
if (position == 1) {
imageView.setMinimumTileDpi(50);
} else {
imageView.setMinimumTileDpi(500);
}
if (position == 4) {
imageView.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_CENTER);
} else if (position == 5) {
imageView.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_CENTER_IMMEDIATE);
} else {
imageView.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_FIXED);
}
if (position == 6) {
imageView.setDoubleTapZoomDpi(240);
} else {
imageView.setDoubleTapZoomScale(1F);
}
if (position == 7) {
imageView.setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_CENTER);
} else if (position == 8) {
imageView.setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_OUTSIDE);
} else {
imageView.setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_INSIDE);
}
if (position == 9) {
imageView.setDebug(true);
} else {
imageView.setDebug(false);
}
if (position == 2) {
imageView.setScaleAndCenter(0f, new PointF(1228, 816));
imageView.setPanEnabled(false);
} else {
imageView.setPanEnabled(true);
}
if (position == 3) {
imageView.setScaleAndCenter(1f, new PointF(1228, 816));
imageView.setZoomEnabled(false);
} else {
imageView.setZoomEnabled(true);
}
}
Aggregations