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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations