Java Code Examples for android.widget.ViewFlipper#setOutAnimation()

The following examples show how to use android.widget.ViewFlipper#setOutAnimation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecentUnlocksCard.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.card_recent_unlocks, null);

    mCardTitle = (TextView) rootView.findViewById(R.id.card_recent_unlocks_title);
    mRecentUnlocksList = (ListView) rootView.findViewById(R.id.card_recent_unlocks_list);

    mMoreItemsButton = (RelativeLayout) rootView.findViewById(R.id.card_recent_unlocks_more_button);

    mViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_recent_unlocks_view_flipper);
    mViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mMessageViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_recent_unlocks_connection_view_flipper);
    mMessageViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mMessageViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mRecentUnlocksList.setOnItemClickListener(new recentUnlocksListItemClickListener());

    mCard = (LinearLayout) rootView.findViewById(R.id.card_recent_unlocks_card);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.card_recent_unlocks_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.card_recent_unlocks_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.card_recent_unlocks_message_summary);

    mMoreItemsButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(mContext, RecentUnlocksActivity.class));
        }
    });

    return rootView;
}
 
Example 2
Source File: CriticalItemsCard.java    From WaniKani-for-Android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.card_critical_items, null);

    mCardTitle = (TextView) rootView.findViewById(R.id.card_critical_items_title);
    mCriticalItemsList = (ListView) rootView.findViewById(R.id.card_critical_items_list);

    mViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_critical_items_view_flipper);
    mViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mMessageViewFlipper = (ViewFlipper) rootView.findViewById(R.id.card_critical_items_connection_view_flipper);
    mMessageViewFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
    mMessageViewFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

    mCard = (LinearLayout) rootView.findViewById(R.id.card_critical_items_card);

    mMessageIcon = (ImageView) rootView.findViewById(R.id.card_critical_items_message_icon);
    mMessageTitle = (TextView) rootView.findViewById(R.id.card_critical_items_message_title);
    mMessageSummary = (TextView) rootView.findViewById(R.id.card_critical_items_message_summary);

    mCriticalItemsList.setOnItemClickListener(new criticalItemListItemClickListener());

    mMoreButton = (RelativeLayout) rootView.findViewById(R.id.card_critical_items_more_button);
    mMoreButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(getActivity(), CriticalItemsActivity.class));
        }
    });

    return rootView;
}
 
Example 3
Source File: IntroActivity.java    From WhatsAppStatusSaver with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_intro);
    final SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE);
    alreadyOpened = sharedPref.getBoolean("already-opened", false);
    if (!alreadyOpened) {
        SharedPreferences.Editor editor = sharedPref.edit();
        editor.putBoolean("already-opened", true);
        editor.apply();
        Handler handler = new Handler();
        handler.postDelayed(
                new Runnable() {
                    public void run() {
                        startActivity(new Intent(IntroActivity.this, MainActivity.class));
                        finish();
                    }
                }, 21000L);
    } else {
        startActivity(new Intent(IntroActivity.this, MainActivity.class));
        finish();
    }

    mVisible = true;
    mControlsView = findViewById(R.id.fullscreen_content_controls);
    mContentView = findViewById(R.id.fullscreen_content);

    simpleViewFlipper = (ViewFlipper) findViewById(R.id.view_flipper); // get the reference of ViewFlipper
    // Set up the user interaction to manually show or hide the system UI.
    mContentView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            toggle();
        }
    });


    for (int i = 0; i < images.length; i++) {
        // create the object of ImageView
        ImageView imageView = new ImageView(this);
        imageView.setImageResource(images[i]); // set image in ImageView
        simpleViewFlipper.addView(imageView); // add the created ImageView in ViewFlipper
    }
    // Declare in and out animations and load them using AnimationUtils class
    Animation in = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
    Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
    // set the animation type's to ViewFlipper
    simpleViewFlipper.setInAnimation(in);
    simpleViewFlipper.setOutAnimation(out);
    // set interval time for flipping between views
    simpleViewFlipper.setFlipInterval(3000);
    // set auto start for flipping between views
    simpleViewFlipper.setAutoStart(true);

}
 
Example 4
Source File: SRSCard.java    From WaniKani-for-Android with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.card_srs, null);

        context = getActivity();

        mApprenticeParent = (LinearLayout) rootView.findViewById(R.id.card_status_apprentice_parent);
        mGuruParent = (LinearLayout) rootView.findViewById(R.id.card_status_guru_parent);
        mMasterParent = (LinearLayout) rootView.findViewById(R.id.card_status_master_parent);
        mEnlightenedParent = (LinearLayout) rootView.findViewById(R.id.card_status_enlightened_parent);
        mBurnedParent = (LinearLayout) rootView.findViewById(R.id.card_status_burned_parent);

        mApprentice = (TextView) rootView.findViewById(R.id.card_status_apprentice);
        mGuru = (TextView) rootView.findViewById(R.id.card_status_guru);
        mMaster = (TextView) rootView.findViewById(R.id.card_status_master);
        mEnlightened = (TextView) rootView.findViewById(R.id.card_status_enlightened);
        mBurned = (TextView) rootView.findViewById(R.id.card_status_burned);
        mTotalItems = (TextView) rootView.findViewById(R.id.card_status_total_items);

        mApprenticeIcon = (ImageView) rootView.findViewById(R.id.card_status_apprentice_icon);
        mGuruIcon = (ImageView) rootView.findViewById(R.id.card_status_guru_icon);
        mMasterIcon = (ImageView) rootView.findViewById(R.id.card_status_master_icon);
        mEnlightenedIcon = (ImageView) rootView.findViewById(R.id.card_status_enlightened_icon);
        mBurnedIcon = (ImageView) rootView.findViewById(R.id.card_status_burned_icon);

        mApprenticeIcon.setColorFilter(getResources().getColor(R.color.apptheme_main),
                PorterDuff.Mode.SRC_ATOP);
        mGuruIcon.setColorFilter(getResources().getColor(R.color.apptheme_main),
                PorterDuff.Mode.SRC_ATOP);
        mMasterIcon.setColorFilter(getResources().getColor(R.color.apptheme_main),
                PorterDuff.Mode.SRC_ATOP);
        mEnlightenedIcon.setColorFilter(getResources().getColor(R.color.apptheme_main),
                PorterDuff.Mode.SRC_ATOP);
        mBurnedIcon.setColorFilter(getResources().getColor(R.color.apptheme_main),
                PorterDuff.Mode.SRC_ATOP);
/*

        mDetailsFlipper = (ViewFlipper) rootView.findViewById(R.id.card_status_details_flipper);
        mDetailsFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
        mDetailsFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);
*/

        mDetailsSuperFlipper = (ViewFlipper) rootView.findViewById(R.id.card_status_details_super_flipper);
        mDetailsSuperFlipper.setInAnimation(getActivity(), R.anim.abc_fade_in);
        mDetailsSuperFlipper.setOutAnimation(getActivity(), R.anim.abc_fade_out);

        mDetailsRadicals = (TextView) rootView.findViewById(R.id.card_status_details_radicals_count);
        mDetailsKanji = (TextView) rootView.findViewById(R.id.card_status_details_kanji_count);
        mDetailsVocabulary = (TextView) rootView.findViewById(R.id.card_status_details_vocabulary_count);
        mDetailsTotal = (TextView) rootView.findViewById(R.id.card_status_details_total_count);
        mDetailsSRSLogo = (ImageView) rootView.findViewById(R.id.card_status_details_srs_logo);
        mDetailsSRSLevel = (TextView) rootView.findViewById(R.id.card_status_details_srs_level);
        mDetailsUp = (RelativeLayout) rootView.findViewById(R.id.card_status_details_up_button);

        mMainContent = (LinearLayout) rootView.findViewById(R.id.card_status_main_content);
        mDetailsContent = (RelativeLayout) rootView.findViewById(R.id.card_status_details_content);

        mCard = (LinearLayout) rootView.findViewById(R.id.card_status_card);

        setOnClickListeners();

        return rootView;
    }