Search in sources :

Example 51 with TextView

use of android.widget.TextView in project mosby by sockeqwe.

the class TextSizeTransition method captureValues.

private void captureValues(TransitionValues transitionValues) {
    if (transitionValues.view instanceof TextView) {
        TextView textView = (TextView) transitionValues.view;
        transitionValues.values.put(PROPNAME_TEXT_SIZE, textView.getTextSize());
    }
}
Also used : TextView(android.widget.TextView)

Example 52 with TextView

use of android.widget.TextView in project mosby by sockeqwe.

the class SecondBackstackMviLifecycleFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_mvi, container, false);
    TextView tv = (TextView) view.findViewById(R.id.text);
    tv.setText(getClass().getSimpleName());
    return view;
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) LifecycleTestView(com.hannesdorfmann.mosby3.mvi.integrationtest.lifecycle.LifecycleTestView) Nullable(android.support.annotation.Nullable)

Example 53 with TextView

use of android.widget.TextView in project TextJustify-Android by bluejamesbond.

the class TestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(getContentView());
    testName = Utils.splitCamelCase(getClass().getSimpleName());
    TextView titleBar = ((TextView) findViewById(R.id.titlebar));
    if (titleBar != null) {
        titleBar.setText(testName);
    }
}
Also used : TextView(android.widget.TextView)

Example 54 with TextView

use of android.widget.TextView in project TextJustify-Android by bluejamesbond.

the class TestList method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Set default app font
    // FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/notosans.ttf");
    // Set layout
    setContentView(R.layout.testlist_activity);
    // Create list of simple test names
    String[] testNames = new String[tests.length];
    for (int i = 0; i < testNames.length; i++) {
        testNames[i] = Utils.splitCamelCase(tests[i].getSimpleName()).toUpperCase();
    }
    // Get listView
    ListView lv = (ListView) findViewById(R.id.list);
    // Assign adapter to List
    lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, testNames) {

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View view = super.getView(position, convertView, parent);
            TextView textView = (TextView) view.findViewById(android.R.id.text1);
            textView.setTypeface(Typeface.DEFAULT_BOLD);
            textView.setBackgroundColor(Color.parseColor("#111111"));
            textView.setTextColor(Color.WHITE);
            textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
            return view;
        }
    });
    // For each click
    lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            startActivity(new Intent(TestList.this, tests[i]));
        }
    });
}
Also used : ViewGroup(android.view.ViewGroup) Intent(android.content.Intent) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) ListView(android.widget.ListView) TextView(android.widget.TextView) AdapterView(android.widget.AdapterView)

Example 55 with TextView

use of android.widget.TextView in project BGABanner-Android by bingoogolapple.

the class BGABanner method initView.

private void initView(Context context) {
    RelativeLayout pointContainerRl = new RelativeLayout(context);
    if (Build.VERSION.SDK_INT >= 16) {
        pointContainerRl.setBackground(mPointContainerBackgroundDrawable);
    } else {
        pointContainerRl.setBackgroundDrawable(mPointContainerBackgroundDrawable);
    }
    pointContainerRl.setPadding(mPointContainerLeftRightPadding, mPointTopBottomMargin, mPointContainerLeftRightPadding, mPointTopBottomMargin);
    RelativeLayout.LayoutParams pointContainerLp = new RelativeLayout.LayoutParams(RMP, RWC);
    // 处理圆点在顶部还是底部
    if ((mPointGravity & Gravity.VERTICAL_GRAVITY_MASK) == Gravity.TOP) {
        pointContainerLp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
    } else {
        pointContainerLp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    }
    addView(pointContainerRl, pointContainerLp);
    RelativeLayout.LayoutParams indicatorLp = new RelativeLayout.LayoutParams(RWC, RWC);
    indicatorLp.addRule(CENTER_VERTICAL);
    if (mIsNumberIndicator) {
        mNumberIndicatorTv = new TextView(context);
        mNumberIndicatorTv.setId(R.id.banner_indicatorId);
        mNumberIndicatorTv.setGravity(Gravity.CENTER_VERTICAL);
        mNumberIndicatorTv.setSingleLine(true);
        mNumberIndicatorTv.setEllipsize(TextUtils.TruncateAt.END);
        mNumberIndicatorTv.setTextColor(mNumberIndicatorTextColor);
        mNumberIndicatorTv.setTextSize(TypedValue.COMPLEX_UNIT_PX, mNumberIndicatorTextSize);
        mNumberIndicatorTv.setVisibility(View.INVISIBLE);
        if (mNumberIndicatorBackground != null) {
            if (Build.VERSION.SDK_INT >= 16) {
                mNumberIndicatorTv.setBackground(mNumberIndicatorBackground);
            } else {
                mNumberIndicatorTv.setBackgroundDrawable(mNumberIndicatorBackground);
            }
        }
        pointContainerRl.addView(mNumberIndicatorTv, indicatorLp);
    } else {
        mPointRealContainerLl = new LinearLayout(context);
        mPointRealContainerLl.setId(R.id.banner_indicatorId);
        mPointRealContainerLl.setOrientation(LinearLayout.HORIZONTAL);
        mPointRealContainerLl.setGravity(Gravity.CENTER_VERTICAL);
        pointContainerRl.addView(mPointRealContainerLl, indicatorLp);
    }
    RelativeLayout.LayoutParams tipLp = new RelativeLayout.LayoutParams(RMP, RWC);
    tipLp.addRule(CENTER_VERTICAL);
    mTipTv = new TextView(context);
    mTipTv.setGravity(Gravity.CENTER_VERTICAL);
    mTipTv.setSingleLine(true);
    mTipTv.setEllipsize(TextUtils.TruncateAt.END);
    mTipTv.setTextColor(mTipTextColor);
    mTipTv.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTipTextSize);
    pointContainerRl.addView(mTipTv, tipLp);
    int horizontalGravity = mPointGravity & Gravity.HORIZONTAL_GRAVITY_MASK;
    // 处理圆点在左边、右边还是水平居中
    if (horizontalGravity == Gravity.LEFT) {
        indicatorLp.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
        tipLp.addRule(RelativeLayout.RIGHT_OF, R.id.banner_indicatorId);
        mTipTv.setGravity(Gravity.CENTER_VERTICAL | Gravity.RIGHT);
    } else if (horizontalGravity == Gravity.RIGHT) {
        indicatorLp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        tipLp.addRule(RelativeLayout.LEFT_OF, R.id.banner_indicatorId);
    } else {
        indicatorLp.addRule(RelativeLayout.CENTER_HORIZONTAL);
        tipLp.addRule(RelativeLayout.LEFT_OF, R.id.banner_indicatorId);
    }
    showPlaceholder();
}
Also used : RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) LinearLayout(android.widget.LinearLayout)

Aggregations

TextView (android.widget.TextView)4994 View (android.view.View)2680 ImageView (android.widget.ImageView)1137 Button (android.widget.Button)442 LinearLayout (android.widget.LinearLayout)439 LayoutInflater (android.view.LayoutInflater)425 Intent (android.content.Intent)397 ListView (android.widget.ListView)389 AdapterView (android.widget.AdapterView)372 ViewGroup (android.view.ViewGroup)322 OnClickListener (android.view.View.OnClickListener)304 RecyclerView (android.support.v7.widget.RecyclerView)197 Test (org.junit.Test)197 ScrollView (android.widget.ScrollView)166 DialogInterface (android.content.DialogInterface)162 Context (android.content.Context)156 Drawable (android.graphics.drawable.Drawable)155 EditText (android.widget.EditText)149 AlertDialog (android.app.AlertDialog)144 Bundle (android.os.Bundle)144