Search in sources :

Example 46 with Nullable

use of android.support.annotation.Nullable in project Android-skin-support by ximsfei.

the class MiddleFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_middle, null);
    mHorizontalBar = (ProgressBar) view.findViewById(R.id.progress_horizontal);
    mAdd = (Button) view.findViewById(R.id.add);
    mAdd.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            mHorizontalBar.setProgress(mHorizontalBar.getProgress() + 2);
        }
    });
    mSpinner = (Spinner) view.findViewById(R.id.spinner);
    final CharSequence[] entries = getResources().getStringArray(R.array.languages);
    if (entries != null) {
        final ArrayAdapter<CharSequence> adapter = new ArrayAdapter<>(getActivity(), R.layout.simple_spinner_item, entries);
        adapter.setDropDownViewResource(R.layout.simple_spinner_item);
        mSpinner.setAdapter(adapter);
    }
    return view;
}
Also used : View(android.view.View) ArrayAdapter(android.widget.ArrayAdapter) Nullable(android.support.annotation.Nullable)

Example 47 with Nullable

use of android.support.annotation.Nullable in project LookLook by xinghongfei.

the class TopNewsFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.topnews_fragment_layout, container, false);
    ButterKnife.bind(this, view);
    return view;
}
Also used : BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 48 with Nullable

use of android.support.annotation.Nullable in project iosched by google.

the class WelcomeFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    LOGD(TAG, "Creating View");
    if (mActivity instanceof WelcomeFragmentContainer) {
        WelcomeFragmentContainer activity = (WelcomeFragmentContainer) mActivity;
        attachToPrimaryButton(activity.getPrimaryButton());
        attachToSecondaryButton(activity.getSecondaryButton());
        activity.setButtonBarVisibility(shouldShowButtonBar());
    }
    return view;
}
Also used : TextView(android.widget.TextView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 49 with Nullable

use of android.support.annotation.Nullable in project Transitions-Everywhere by andkulikov.

the class Scale method createAnimation.

@Nullable
private Animator createAnimation(final View view, float startScale, float endScale, TransitionValues values) {
    final float initialScaleX = view.getScaleX();
    final float initialScaleY = view.getScaleY();
    float startScaleX = initialScaleX * startScale;
    float endScaleX = initialScaleX * endScale;
    float startScaleY = initialScaleY * startScale;
    float endScaleY = initialScaleY * endScale;
    if (values != null) {
        Float savedScaleX = (Float) values.values.get(PROPNAME_SCALE_X);
        Float savedScaleY = (Float) values.values.get(PROPNAME_SCALE_Y);
        // continue animation from the interrupted state
        if (savedScaleX != null && savedScaleX != initialScaleX) {
            startScaleX = savedScaleX;
        }
        if (savedScaleY != null && savedScaleY != initialScaleY) {
            startScaleY = savedScaleY;
        }
    }
    view.setScaleX(startScaleX);
    view.setScaleY(startScaleY);
    Animator animator = TransitionUtils.mergeAnimators(ObjectAnimator.ofFloat(view, View.SCALE_X, startScaleX, endScaleX), ObjectAnimator.ofFloat(view, View.SCALE_Y, startScaleY, endScaleY));
    addListener(new TransitionListenerAdapter() {

        @Override
        public void onTransitionEnd(Transition transition) {
            view.setScaleX(initialScaleX);
            view.setScaleY(initialScaleY);
        }
    });
    return animator;
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) Transition(com.transitionseverywhere.Transition) Nullable(android.support.annotation.Nullable)

Example 50 with Nullable

use of android.support.annotation.Nullable in project Transitions-Everywhere by andkulikov.

the class AutoTransitionSample method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_autotransition, container, false);
    final ViewGroup transitionsContainer = (ViewGroup) view.findViewById(R.id.transitions_container);
    final TextView text = (TextView) transitionsContainer.findViewById(R.id.text);
    transitionsContainer.findViewById(R.id.button).setOnClickListener(new VisibleToggleClickListener() {

        @Override
        protected void changeVisibility(boolean visible) {
            TransitionManager.beginDelayedTransition(transitionsContainer);
            // it is the same as
            // TransitionManager.beginDelayedTransition(transitionsContainer, new AutoTransition());
            // where AutoTransition is the set of Fade and ChangeBounds transitions
            text.setVisibility(visible ? View.VISIBLE : View.GONE);
        }
    });
    return view;
}
Also used : ViewGroup(android.view.ViewGroup) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Aggregations

Nullable (android.support.annotation.Nullable)582 View (android.view.View)315 TextView (android.widget.TextView)163 RecyclerView (android.support.v7.widget.RecyclerView)85 BindView (butterknife.BindView)57 ImageView (android.widget.ImageView)52 ArrayList (java.util.ArrayList)43 IOException (java.io.IOException)36 Bundle (android.os.Bundle)35 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)35 Intent (android.content.Intent)32 ViewGroup (android.view.ViewGroup)32 Cursor (android.database.Cursor)29 Uri (android.net.Uri)27 File (java.io.File)24 AdapterView (android.widget.AdapterView)22 List (java.util.List)20 NonNull (android.support.annotation.NonNull)19 Context (android.content.Context)15 Bitmap (android.graphics.Bitmap)15