Search in sources :

Example 96 with TextView

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);
}
Also used : TextView(android.widget.TextView) Then(cucumber.api.java.en.Then)

Example 97 with TextView

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();
}
Also used : OnTouchListener(android.view.View.OnTouchListener) PointF(android.graphics.PointF) ActionBarDrawerToggle(android.support.v4.app.ActionBarDrawerToggle) SimpleAdapter(android.widget.SimpleAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) MotionEvent(android.view.MotionEvent)

Example 98 with TextView

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;
}
Also used : OnLongClickListener(android.view.View.OnLongClickListener) Animation(com.zhan_dui.model.Animation) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 99 with TextView

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;
}
Also used : Skill(com.daimajia.easing.Skill) BaseEasingMethod(com.daimajia.easing.BaseEasingMethod) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 100 with TextView

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);
    }
}
Also used : PointF(android.graphics.PointF) TextView(android.widget.TextView) SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView)

Aggregations

TextView (android.widget.TextView)4784 View (android.view.View)2545 ImageView (android.widget.ImageView)1082 Button (android.widget.Button)423 LinearLayout (android.widget.LinearLayout)417 LayoutInflater (android.view.LayoutInflater)401 ListView (android.widget.ListView)375 Intent (android.content.Intent)367 AdapterView (android.widget.AdapterView)356 ViewGroup (android.view.ViewGroup)314 OnClickListener (android.view.View.OnClickListener)291 Test (org.junit.Test)197 RecyclerView (android.support.v7.widget.RecyclerView)177 ScrollView (android.widget.ScrollView)157 Drawable (android.graphics.drawable.Drawable)152 DialogInterface (android.content.DialogInterface)145 Context (android.content.Context)144 EditText (android.widget.EditText)138 Bundle (android.os.Bundle)133 AlertDialog (android.app.AlertDialog)127