Search in sources :

Example 6 with ViewAnimator

use of android.widget.ViewAnimator in project Android-Developers-Samples by johnjohndoe.

the class MainActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.menu_toggle_log:
            mLogShown = !mLogShown;
            ViewAnimator output = (ViewAnimator) findViewById(R.id.sample_output);
            if (mLogShown) {
                output.setDisplayedChild(1);
            } else {
                output.setDisplayedChild(0);
            }
            supportInvalidateOptionsMenu();
            return true;
    }
    return super.onOptionsItemSelected(item);
}
Also used : ViewAnimator(android.widget.ViewAnimator)

Example 7 with ViewAnimator

use of android.widget.ViewAnimator in project Android-Developers-Samples by johnjohndoe.

the class MainActivity method onPrepareOptionsMenu.

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem logToggle = menu.findItem(R.id.menu_toggle_log);
    logToggle.setVisible(findViewById(R.id.sample_output) instanceof ViewAnimator);
    logToggle.setTitle(mLogShown ? R.string.sample_hide_log : R.string.sample_show_log);
    return super.onPrepareOptionsMenu(menu);
}
Also used : ViewAnimator(android.widget.ViewAnimator) MenuItem(android.view.MenuItem)

Example 8 with ViewAnimator

use of android.widget.ViewAnimator in project Android-Developers-Samples by johnjohndoe.

the class MainActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.menu_toggle_log:
            mLogShown = !mLogShown;
            ViewAnimator output = (ViewAnimator) findViewById(R.id.sample_output);
            if (mLogShown) {
                output.setDisplayedChild(1);
            } else {
                output.setDisplayedChild(0);
            }
            supportInvalidateOptionsMenu();
            return true;
    }
    return super.onOptionsItemSelected(item);
}
Also used : ViewAnimator(android.widget.ViewAnimator)

Example 9 with ViewAnimator

use of android.widget.ViewAnimator in project Android-Developers-Samples by johnjohndoe.

the class MainActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case R.id.menu_toggle_log:
            mLogShown = !mLogShown;
            ViewAnimator output = (ViewAnimator) findViewById(R.id.sample_output);
            if (mLogShown) {
                output.setDisplayedChild(1);
            } else {
                output.setDisplayedChild(0);
            }
            supportInvalidateOptionsMenu();
            return true;
    }
    return super.onOptionsItemSelected(item);
}
Also used : ViewAnimator(android.widget.ViewAnimator)

Example 10 with ViewAnimator

use of android.widget.ViewAnimator in project Android-Developers-Samples by johnjohndoe.

the class MainActivity method onPrepareOptionsMenu.

@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem logToggle = menu.findItem(R.id.menu_toggle_log);
    logToggle.setVisible(findViewById(R.id.sample_output) instanceof ViewAnimator);
    logToggle.setTitle(mLogShown ? R.string.sample_hide_log : R.string.sample_show_log);
    return super.onPrepareOptionsMenu(menu);
}
Also used : ViewAnimator(android.widget.ViewAnimator) MenuItem(android.view.MenuItem)

Aggregations

ViewAnimator (android.widget.ViewAnimator)13 MenuItem (android.view.MenuItem)5 TextView (android.widget.TextView)2 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 ProgressBar (android.widget.ProgressBar)1 ViewFlipper (android.widget.ViewFlipper)1 AnimatedRotateDrawable (com.aviary.android.feather.graphics.AnimatedRotateDrawable)1 BottombarViewFlipper (com.aviary.android.feather.widget.BottombarViewFlipper)1 Test (org.junit.Test)1