Android Open Source - PrettyBundle Test Primary Extra Fragment






From Project

Back to project page PrettyBundle.

License

The source code is released under:

Apache License

If you think the Android project PrettyBundle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.tale.prettybundle.sample.fragments;
/*from  ww  w  .  j  a  v  a  2 s.co m*/
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.tale.prettybundle.Extra;
import com.tale.prettybundle.PrettyBundle;
import com.tale.prettybundle.sample.R;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by giang on 2/26/15.
 */
public class TestPrimaryExtraFragment extends Fragment {

    @Extra int intVal = 0;
    @Extra long longVal = 0;
    @Extra float floatVal = 0;
    @Extra double doubleVal = 0;
    @Extra boolean booleanVal = false;
    @Extra String stringVal = "Default";
    @Extra CharSequence charSequenceVal = "Default";

    @InjectView(R.id.tvInt) TextView tvInt;
    @InjectView(R.id.tvLong) TextView tvLong;
    @InjectView(R.id.tvFloat) TextView tvFloat;
    @InjectView(R.id.tvDouble) TextView tvDouble;
    @InjectView(R.id.tvBoolean) TextView tvBoolean;
    @InjectView(R.id.tvString) TextView tvString;
    @InjectView(R.id.tvCharSequence) TextView tvCharSequence;

    @Override public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        PrettyBundle.inject(this);
    }

    @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.layout_test_primary_type_display, container, false);
    }

    @Override public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ButterKnife.inject(this, view);

        tvInt.setText(String.valueOf(intVal));
        tvLong.setText(String.valueOf(longVal));
        tvFloat.setText(String.valueOf(floatVal));
        tvDouble.setText(String.valueOf(doubleVal));
        tvBoolean.setText(String.valueOf(booleanVal));
        tvString.setText(stringVal);
        tvCharSequence.setText(charSequenceVal);
    }
}




Java Source Code List

com.tale.prettybundle.ExtraBinderProvider.java
com.tale.prettybundle.ExtraBinder.java
com.tale.prettybundle.Extra.java
com.tale.prettybundle.Injector.java
com.tale.prettybundle.PrettyBundle.java
com.tale.prettybundle.internal.ExtraAnnotatedClass.java
com.tale.prettybundle.internal.ExtraClassesGrouped.java
com.tale.prettybundle.internal.ExtraInjectorClassBuilder.java
com.tale.prettybundle.internal.ExtraUtilityClassBuilder.java
com.tale.prettybundle.internal.PrettyBundleProcessor.java
com.tale.prettybundle.internal.SupportedType.java
com.tale.prettybundle.sample.ActivitiesClassTest.java
com.tale.prettybundle.sample.ActivitiesTest.java
com.tale.prettybundle.sample.ApplicationTest.java
com.tale.prettybundle.sample.BaseActivityUnitTestCase.java
com.tale.prettybundle.sample.InjectArrayExtrasTest.java
com.tale.prettybundle.sample.InjectParcelableExtrasTest.java
com.tale.prettybundle.sample.InjectPrimaryTypeExtrasFragmentTest.java
com.tale.prettybundle.sample.InjectPrimaryTypeExtrasTest.java
com.tale.prettybundle.sample.InjectStringExtrasTest.java
com.tale.prettybundle.sample.MainActivity.java
com.tale.prettybundle.sample.MenuActivity.java
com.tale.prettybundle.sample.TestArrayExtrasActivity.java
com.tale.prettybundle.sample.TestExtraOnFragmentActivity.java
com.tale.prettybundle.sample.TestParcelableActivity.java
com.tale.prettybundle.sample.TestPrimaryTypeDisplayActivity.java
com.tale.prettybundle.sample.TestPrimaryTypeSetterActivity.java
com.tale.prettybundle.sample.TestStringExtra1Activity.java
com.tale.prettybundle.sample.TestStringExtra2Activity.java
com.tale.prettybundle.sample.data.Person.java
com.tale.prettybundle.sample.espresso.ExtViewActions.java
com.tale.prettybundle.sample.fragments.TestPrimaryExtraFragment.java
com.tale.prettybundle.sample.services.TestPrimaryTypeService.java