use of android.widget.ViewFlipper in project platform_frameworks_base by android.
the class ViewFlipperActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LayoutInflater inflater = getLayoutInflater();
final View widget = inflater.inflate(R.layout.widget, null);
widget.setLayoutParams(new FrameLayout.LayoutParams(180, 180, Gravity.CENTER));
ViewFlipper flipper = (ViewFlipper) widget.findViewById(R.id.flipper);
View view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset1);
((TextView) view.findViewById(R.id.widget_text)).setText("This is a long line of text, " + "enjoy the wrapping and drawing");
view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset3);
((TextView) view.findViewById(R.id.widget_text)).setText("Another very long line of text, " + "enjoy the wrapping and drawing");
FrameLayout layout = new FrameLayout(this);
layout.addView(widget);
setContentView(layout);
}
use of android.widget.ViewFlipper in project android_frameworks_base by crdroidandroid.
the class ViewFlipperActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LayoutInflater inflater = getLayoutInflater();
final View widget = inflater.inflate(R.layout.widget, null);
widget.setLayoutParams(new FrameLayout.LayoutParams(180, 180, Gravity.CENTER));
ViewFlipper flipper = (ViewFlipper) widget.findViewById(R.id.flipper);
View view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset1);
((TextView) view.findViewById(R.id.widget_text)).setText("This is a long line of text, " + "enjoy the wrapping and drawing");
view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset3);
((TextView) view.findViewById(R.id.widget_text)).setText("Another very long line of text, " + "enjoy the wrapping and drawing");
FrameLayout layout = new FrameLayout(this);
layout.addView(widget);
setContentView(layout);
}
use of android.widget.ViewFlipper in project android_frameworks_base by ParanoidAndroid.
the class ViewFlipperActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LayoutInflater inflater = getLayoutInflater();
final View widget = inflater.inflate(R.layout.widget, null);
widget.setLayoutParams(new FrameLayout.LayoutParams(180, 180, Gravity.CENTER));
ViewFlipper flipper = (ViewFlipper) widget.findViewById(R.id.flipper);
View view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset1);
((TextView) view.findViewById(R.id.widget_text)).setText("This is a long line of text, " + "enjoy the wrapping and drawing");
view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset3);
((TextView) view.findViewById(R.id.widget_text)).setText("Another very long line of text, " + "enjoy the wrapping and drawing");
FrameLayout layout = new FrameLayout(this);
layout.addView(widget);
setContentView(layout);
}
use of android.widget.ViewFlipper in project storymaker by StoryMaker.
the class CacheWordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lock_screen);
Intent intent = getIntent();
setPin = intent.getBooleanExtra(BaseActivity.CACHEWORD_FIRST_LOCK, false);
if (setPin) {
Timber.d("got flag for cacheword pin initialization");
} else {
Timber.d("no flag for cacheword pin initialization");
}
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", BaseActivity.CACHEWORD_TIMEOUT));
mCacheWordHandler = new CacheWordHandler(this, timeout);
mViewEnterPin = findViewById(R.id.llEnterPin);
mViewCreatePin = findViewById(R.id.llCreatePin);
mTextEnterPin = (EditText) findViewById(R.id.editEnterPin);
mTextCreatePin = (EditText) findViewById(R.id.editCreatePin);
mTextConfirmPin = (EditText) findViewById(R.id.editConfirmPin);
ViewFlipper vf = (ViewFlipper) findViewById(R.id.viewFlipper);
LinearLayout flipView1 = (LinearLayout) findViewById(R.id.flipView1);
LinearLayout flipView2 = (LinearLayout) findViewById(R.id.flipView2);
mSlider = new TwoViewSlider(vf, flipView1, flipView2, mTextCreatePin, mTextConfirmPin);
}
use of android.widget.ViewFlipper in project mobile-android by photo.
the class FeatherActivity method onContentChanged.
/*
* (non-Javadoc)
*
* @see android.app.Activity#onContentChanged()
*/
@Override
public void onContentChanged() {
super.onContentChanged();
mDragLayer = (DragLayer) findViewById(R.id.dragLayer);
mToolbar = (ToolbarView) findViewById(R.id.toolbar);
mBottomBarFlipper = (BottombarViewFlipper) findViewById(R.id.bottombar_view_flipper);
mWorkspace = (Workspace) mBottomBarFlipper.findViewById(R.id.workspace);
mImageView = (ImageViewTouch) findViewById(R.id.image);
mDrawingViewContainer = (ViewGroup) findViewById(R.id.drawing_view_container);
mInlineProgressLoader = findViewById(R.id.image_loading_view);
mWorkspaceIndicator = (WorkspaceIndicator) findViewById(R.id.workspace_indicator);
mViewFlipper = ((ViewAnimator) findViewById(R.id.main_flipper));
mToolbarMainAnimator = ((ViewFlipper) mToolbar.findViewById(R.id.top_indicator_main));
mToolbarContentAnimator = ((ViewFlipper) mToolbar.findViewById(R.id.top_indicator_panel));
mPopupContainer = (ViewGroup) findViewById(R.id.feather_dialogs_container);
// update the progressbar animation drawable
AnimatedRotateDrawable d = new AnimatedRotateDrawable(getResources(), R.drawable.feather_spinner_white_16);
ProgressBar view = (ProgressBar) mToolbarContentAnimator.getChildAt(1);
view.setIndeterminateDrawable(d);
// adding the bottombar content view at runtime, otherwise fail to get the corrent child
// LayoutInflater inflater = (LayoutInflater) getSystemService( Context.LAYOUT_INFLATER_SERVICE );
// View contentView = inflater.inflate( R.layout.feather_option_panel_content, mBottomBarFlipper, false );
// FrameLayout.LayoutParams p = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT,
// FrameLayout.LayoutParams.WRAP_CONTENT );
// p.gravity = Gravity.BOTTOM;
// mBottomBarFlipper.addView( contentView, 0, p );
mBottomBarFlipper.setDisplayedChild(1);
}
Aggregations