Search in sources :

Example 1 with TextView

use of org.holoeverywhere.widget.TextView in project HoloEverywhere by Prototik.

the class SliderMenu method bindView.

@SuppressWarnings("deprecation")
View bindView(BaseSliderItem<?> item, View view, boolean selected, int defaultTextAppearance, int defaultTextAppearanceInverse) {
    TextView labelView = (TextView) view.findViewById(android.R.id.text1);
    if (labelView != null) {
        labelView.setText(item.mLabel);
    }
    final int textAppearance = item.mTextAppereance != 0 ? item.mTextAppereance : defaultTextAppearance;
    final int textAppearanceInverse = item.mTextAppereanceInverse != 0 ? item.mTextAppereanceInverse : defaultTextAppearanceInverse;
    setTextAppearance(labelView, mInverseTextColorWhenSelected && selected ? textAppearanceInverse : textAppearance);
    ImageView iconView = (ImageView) view.findViewById(android.R.id.icon1);
    iconView.setImageDrawable(item.mIcon);
    iconView.setVisibility(item.mIcon == null ? View.GONE : View.VISIBLE);
    return bindAppearanceView(view, selected, item);
}
Also used : TextView(org.holoeverywhere.widget.TextView) ImageView(android.widget.ImageView)

Example 2 with TextView

use of org.holoeverywhere.widget.TextView in project HoloEverywhere by Prototik.

the class DummyFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    TextView view = new TextView(inflater.getContext());
    view.setText("Dummy content " + Integer.toHexString(hashCode()));
    view.setGravity(Gravity.CENTER);
    return view;
}
Also used : TextView(org.holoeverywhere.widget.TextView)

Example 3 with TextView

use of org.holoeverywhere.widget.TextView in project HoloEverywhere by Prototik.

the class DatePickerDialog method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Log.d(TAG, "onCreateView: ");
    getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    View view = inflater.inflate(R.layout.date_picker_dialog, container, false);
    mDayOfWeekView = (TextView) view.findViewById(R.id.date_picker_week);
    mMonthAndDayView = (LinearLayout) view.findViewById(R.id.date_picker_month_and_day);
    mMonthAndDayView.setOnClickListener(this);
    mSelectedMonthTextView = (TextView) view.findViewById(R.id.date_picker_month);
    mSelectedDayTextView = (TextView) view.findViewById(R.id.date_picker_day);
    mYearView = (TextView) view.findViewById(R.id.date_picker_year);
    mYearView.setOnClickListener(this);
    int listPosition = -1;
    int listPositionOffset = 0;
    int currentView = MONTH_AND_DAY_VIEW;
    if (savedInstanceState != null) {
        mWeekStart = savedInstanceState.getInt(KEY_WEEK_START);
        mMinYear = savedInstanceState.getInt(KEY_YEAR_START);
        mMaxYear = savedInstanceState.getInt(KEY_YEAR_END);
        currentView = savedInstanceState.getInt(KEY_CURRENT_VIEW);
        listPosition = savedInstanceState.getInt(KEY_LIST_POSITION);
        listPositionOffset = savedInstanceState.getInt(KEY_LIST_POSITION_OFFSET);
    }
    final Activity activity = getActivity();
    mDayPickerView = new DayPickerView(activity, this);
    mYearPickerView = new YearPickerView(activity, this);
    Resources res = getResources();
    mDayPickerDescription = res.getString(R.string.day_picker_description);
    mSelectDay = res.getString(R.string.select_day);
    mYearPickerDescription = res.getString(R.string.year_picker_description);
    mSelectYear = res.getString(R.string.select_year);
    mAnimator = (AccessibleDateAnimator) view.findViewById(R.id.animator);
    mAnimator.addView(mDayPickerView);
    mAnimator.addView(mYearPickerView);
    mAnimator.setDateMillis(mCalendar.getTimeInMillis());
    // TODO: Replace with animation decided upon by the design team.
    Animation animation = new AlphaAnimation(0.0f, 1.0f);
    animation.setDuration(ANIMATION_DURATION);
    mAnimator.setInAnimation(animation);
    // TODO: Replace with animation decided upon by the design team.
    Animation animation2 = new AlphaAnimation(1.0f, 0.0f);
    animation2.setDuration(ANIMATION_DURATION);
    mAnimator.setOutAnimation(animation2);
    mDoneButton = (Button) view.findViewById(R.id.done);
    mDoneButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            tryVibrate();
            if (mCallBack != null) {
                mCallBack.onDateSet(DatePickerDialog.this, mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), mCalendar.get(Calendar.DAY_OF_MONTH));
            }
            dismiss();
        }
    });
    updateDisplay(false);
    setCurrentView(currentView);
    if (listPosition != -1) {
        if (currentView == MONTH_AND_DAY_VIEW) {
            mDayPickerView.postSetSelection(listPosition);
        } else if (currentView == YEAR_VIEW) {
            mYearPickerView.postSetSelection(listPosition);
        }
    }
    return view;
}
Also used : Activity(android.app.Activity) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) OnClickListener(android.view.View.OnClickListener) Resources(android.content.res.Resources) TextView(org.holoeverywhere.widget.TextView) View(android.view.View) AlphaAnimation(android.view.animation.AlphaAnimation)

Example 4 with TextView

use of org.holoeverywhere.widget.TextView in project HoloEverywhere by Prototik.

the class TimePickerDialog method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    View view = inflater.inflate(R.layout.time_picker_dialog, null);
    KeyboardListener keyboardListener = new KeyboardListener();
    view.findViewById(R.id.time_picker_dialog).setOnKeyListener(keyboardListener);
    Resources res = getResources();
    mHourPickerDescription = res.getString(R.string.hour_picker_description);
    mSelectHours = res.getString(R.string.select_hours);
    mMinutePickerDescription = res.getString(R.string.minute_picker_description);
    mSelectMinutes = res.getString(R.string.select_minutes);
    mHourView = (TextView) view.findViewById(R.id.hours);
    mHourView.setOnKeyListener(keyboardListener);
    mHourSpaceView = (TextView) view.findViewById(R.id.hour_space);
    mMinuteSpaceView = (TextView) view.findViewById(R.id.minutes_space);
    mMinuteView = (TextView) view.findViewById(R.id.minutes);
    mMinuteView.setOnKeyListener(keyboardListener);
    mAmPmTextView = (TextView) view.findViewById(R.id.ampm_label);
    mAmPmTextView.setOnKeyListener(keyboardListener);
    String[] amPmTexts = new DateFormatSymbols().getAmPmStrings();
    mAmText = amPmTexts[0];
    mPmText = amPmTexts[1];
    mTimePicker = (RadialPickerLayout) view.findViewById(R.id.time_picker);
    mTimePicker.setOnValueSelectedListener(this);
    mTimePicker.setOnKeyListener(keyboardListener);
    mTimePicker.initialize(getActivity(), mInitialHourOfDay, mInitialMinute, mIs24HourMode);
    int currentItemShowing = HOUR_INDEX;
    if (savedInstanceState != null && savedInstanceState.containsKey(KEY_CURRENT_ITEM_SHOWING)) {
        currentItemShowing = savedInstanceState.getInt(KEY_CURRENT_ITEM_SHOWING);
    }
    setCurrentItemShowing(currentItemShowing, false, true, true);
    mTimePicker.invalidate();
    mHourView.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            setCurrentItemShowing(HOUR_INDEX, true, false, true);
            mTimePicker.tryVibrate();
        }
    });
    mMinuteView.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            setCurrentItemShowing(MINUTE_INDEX, true, false, true);
            mTimePicker.tryVibrate();
        }
    });
    mDoneButton = (Button) view.findViewById(R.id.done_button);
    mDoneButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mInKbMode && isTypedTimeFullyLegal()) {
                finishKbMode(false);
            } else {
                mTimePicker.tryVibrate();
            }
            if (mCallback != null) {
                mCallback.onTimeSet(mTimePicker, mTimePicker.getHours(), mTimePicker.getMinutes());
            }
            dismiss();
        }
    });
    mDoneButton.setOnKeyListener(keyboardListener);
    // Enable or disable the AM/PM view.
    if (mIs24HourMode) {
        mAmPmTextView.setVisibility(View.GONE);
        RelativeLayout.LayoutParams paramsSeparator = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        paramsSeparator.addRule(RelativeLayout.CENTER_IN_PARENT);
        TextView separatorView = (TextView) view.findViewById(R.id.separator);
        separatorView.setLayoutParams(paramsSeparator);
    } else {
        mAmPmTextView.setVisibility(View.VISIBLE);
        updateAmPmDisplay(mInitialHourOfDay < 12 ? AM : PM);
        mAmPmTextView.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                mTimePicker.tryVibrate();
                int amOrPm = mTimePicker.getIsCurrentlyAmOrPm();
                if (amOrPm == AM) {
                    amOrPm = PM;
                } else if (amOrPm == PM) {
                    amOrPm = AM;
                }
                updateAmPmDisplay(amOrPm);
                mTimePicker.setAmOrPm(amOrPm);
            }
        });
    }
    mAllowAutoAdvance = true;
    setHour(mInitialHourOfDay, true);
    setMinute(mInitialMinute);
    // Set up for keyboard mode.
    mDoublePlaceholderText = "--";
    mDeletedKeyFormat = res.getString(R.string.deleted_key);
    mPlaceholderText = mDoublePlaceholderText.charAt(0);
    mAmKeyCode = mPmKeyCode = -1;
    generateLegalTimesTree();
    if (mInKbMode) {
        mTypedTimes = savedInstanceState.getIntegerArrayList(KEY_TYPED_TIMES);
        tryStartingKbMode(-1);
        mHourView.invalidate();
    } else if (mTypedTimes == null) {
        mTypedTimes = new ArrayList<Integer>();
    }
    return view;
}
Also used : ArrayList(java.util.ArrayList) TextView(org.holoeverywhere.widget.TextView) View(android.view.View) RelativeLayout(android.widget.RelativeLayout) OnClickListener(android.view.View.OnClickListener) DateFormatSymbols(java.text.DateFormatSymbols) TextView(org.holoeverywhere.widget.TextView) Resources(android.content.res.Resources)

Example 5 with TextView

use of org.holoeverywhere.widget.TextView in project mobile-android by photo.

the class AccountActivity method init.

void init() {
    getGoogleLoginFragment();
    Button googleLoginButton = (Button) findViewById(R.id.account_google_login_button);
    googleLoginButton.setText(Html.fromHtml(getString(R.string.account_google_login_button)));
    findViewById(R.id.google_login_view).setVisibility(CommonUtils.isFroyoOrHigher() ? View.GONE : View.GONE);
    TextView signInInstructions = (TextView) findViewById(R.id.instant_sign_in_instructions);
    signInInstructions.setText(Html.fromHtml(getString(R.string.instant_sign_in_instructions)));
    TextView signUpInstructions = (TextView) findViewById(R.id.signup_instructions);
    signUpInstructions.setMovementMethod(LinkMovementMethod.getInstance());
    signUpInstructions.setText(Html.fromHtml(getString(R.string.account_signup_instructions)));
}
Also used : Button(android.widget.Button) TextView(org.holoeverywhere.widget.TextView)

Aggregations

TextView (org.holoeverywhere.widget.TextView)8 View (android.view.View)3 Resources (android.content.res.Resources)2 OnClickListener (android.view.View.OnClickListener)2 Activity (android.app.Activity)1 TypedValue (android.util.TypedValue)1 ViewGroup (android.view.ViewGroup)1 AlphaAnimation (android.view.animation.AlphaAnimation)1 Animation (android.view.animation.Animation)1 Button (android.widget.Button)1 ImageView (android.widget.ImageView)1 RelativeLayout (android.widget.RelativeLayout)1 ObjectAnimator (com.nineoldandroids.animation.ObjectAnimator)1 DateFormatSymbols (java.text.DateFormatSymbols)1 ArrayList (java.util.ArrayList)1