Java Code Examples for android.widget.LinearLayout#startAnimation()
The following examples show how to use
android.widget.LinearLayout#startAnimation() .
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: StartActivity.java From FriendBook with GNU General Public License v3.0 | 6 votes |
private void initDisPlay() { tvSkip = findViewById(R.id.tv_skip); tvSkip.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { skip(); } }); View contentView = findViewById(R.id.content_view); if (DisplayUtil.hasVirtualNavigationBar(this)) { contentView.setPadding(0, 0, 0, DisplayUtil.getNavigationBarHeight(this)); } TextView tvVersionName = findViewById(R.id.tv_version_name); tvVersionName.setText(BuildConfig.VERSION_NAME); LinearLayout llWelcome = (LinearLayout) findViewById(R.id.ll_welcome); TextView tvDate = findViewById(R.id.tv_date); SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日,EEEE"); tvDate.setText(format2.format(new Date())); Animation animation = AnimationUtils.loadAnimation(this, R.anim.alpha_in); llWelcome.startAnimation(animation); }
Example 2
Source File: MainActivity.java From ssj with GNU General Public License v3.0 | 6 votes |
/** * Toggle visibility of a linear layout and all of it's children. * @param layout LinearLayout to show/hide. * @param enable True to enable visibility, false otherwise. */ private void toggleLayout(LinearLayout layout, boolean enable) { actionButtonsVisible = enable; if (enable) { layout.setVisibility(View.VISIBLE); layout.startAnimation(showLayout); fab.startAnimation(showButton); } else { layout.setVisibility(View.GONE); layout.startAnimation(hideLayout); fab.startAnimation(hideButton); } for (int i = 0; i < layout.getChildCount(); i++) { layout.getChildAt(i).setEnabled(enable); } }
Example 3
Source File: EUExWidget.java From appcan-android with GNU Lesser General Public License v3.0 | 5 votes |
private void showLoadingPage(WidgetConfigVO configVO, EBrowserWindow curWind) { LayoutInflater layoutInflater = LayoutInflater.from(mContext); inflate = (LinearLayout) layoutInflater.inflate(EUExUtil.getResLayoutID("platform_mp_window_middle_loadding"), null); inflate.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); ImageView platform_mp_loadding_close = (ImageView) inflate.findViewById(EUExUtil.getResIdID("platform_mp_loadding_close")); TextView platformName = (TextView) inflate.findViewById(EUExUtil.getResIdID("platform_mp_loadding_iconname")); platformName.setText(configVO.widgetName); platform_mp_loadding_close.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //回调前端方法去关闭子应用 callBackPluginJs("uexWidget.cbCloseLoading", "0"); mBrwView.removeView(inflate); } }); ImageButton platform_mp_loadding_icon = (ImageButton) inflate.findViewById(EUExUtil.getResIdID("platform_mp_loadding_icon")); curWind.showButtonIcon(platform_mp_loadding_icon, configVO.appIcon); TranslateAnimation anim = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 1.0f, Animation.RELATIVE_TO_PARENT, 0.0f); anim.setDuration(500); inflate.startAnimation(anim); ViewGroup.LayoutParams param=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); mBrwView.addView(inflate, -1,param); Log.e("TAG", "显示过度界面完成================"); }
Example 4
Source File: SplashActivity.java From android-spotify-demo with MIT License | 4 votes |
private void StartAnimations(){ Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha); anim.reset(); LinearLayout l = (LinearLayout)findViewById(R.id.lin_lay); l.clearAnimation(); l.startAnimation(anim); anim = AnimationUtils.loadAnimation(this, R.anim.translate); anim.reset(); ImageView iv = (ImageView)findViewById(R.id.splash); iv.clearAnimation(); iv.startAnimation(anim); Thread splashTread = new Thread() { @Override public void run() { try { int waited = 0; // Splash screen pause time while (waited < 2500) { sleep(100); waited += 100; } Intent intent = new Intent(SplashActivity.this, SpotifyLoginActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(intent); overridePendingTransition(R.anim.pull_up_from_bottom, R.anim.hold); SplashActivity.this.finish(); } catch (InterruptedException e) { // do nothing } finally { SplashActivity.this.finish(); } } }; splashTread.start(); }
Example 5
Source File: PhotoActivity.java From Effects-Pro with MIT License | 4 votes |
private void displayEffectHolder() { hideEffectsBox(true); hideLoading(); if (selected_effect.equals("hue")) { hue_value.setProgress(180); modifyHueHolder(); hue_value.setOnSeekBarChangeListener(onHueChange); } else if (selected_effect.equals("brightness")) { bright_value.setProgress(200); modifyBrightnessHolder(); bright_value.setOnSeekBarChangeListener(onBrightChange); } else if (selected_effect.equals("contrast")) { cont_value.setProgress(50); modifyContrastHolder(); cont_value.setOnSeekBarChangeListener(onContChange); } else if (selected_effect.equals("flip")) { flip_h = false; flip_v = false; rotate_value.setProgress(0); modifyRotateHolder(); rotate_value.setOnSeekBarChangeListener(onRotateChange); } else if (selected_effect.equals("gamma")) { gRed_value.setProgress(24); gGreen_value.setProgress(24); gBlue_value.setProgress(24); modifyGammaHolder(); gRed_value.setOnSeekBarChangeListener(onGRedChange); gGreen_value.setOnSeekBarChangeListener(onGGreenChange); gBlue_value.setOnSeekBarChangeListener(onGBlueChange); } else if (selected_effect.equals("cdepth")) { cdepth_value.setProgress(1); modifyCDepthHolder(); cdepth_value.setOnSeekBarChangeListener(onCDepthChange); } else if (selected_effect.equals("cbalance")) { bRed_value.setProgress(100); bGreen_value.setProgress(100); bBlue_value.setProgress(100); modifyBalanceHolder(); bRed_value.setOnSeekBarChangeListener(onBRedChange); bGreen_value.setOnSeekBarChangeListener(onBGreenChange); bBlue_value.setOnSeekBarChangeListener(onBBlueChange); } else if (selected_effect.equals("boost")) { boost_type = 1; boost_value.setProgress(100); modifyBoostHolder(); boost_value.setOnSeekBarChangeListener(onBoostChange); } else if (selected_effect.equals("saturation")) { sat_value.setProgress(100); modifySaturationHolder(); sat_value.setOnSeekBarChangeListener(onSatChange); } holder_target = (LinearLayout) findViewById(getResources().getIdentifier("holder_" + selected_effect, "id", getPackageName())); /* // SET MAX SIZE FOR TOOL BOX OF FILTER DisplayMetrics metrics = getResources().getDisplayMetrics(); holder_target.getLayoutParams().width = Math.min(700, metrics.widthPixels); holder_target.requestLayout(); */ holder_target.setVisibility(View.VISIBLE); apply_set.setVisibility(View.VISIBLE); animation = AnimationUtils.loadAnimation(this, R.anim.holder_bottom_fast); holder_target.startAnimation(animation); animation = AnimationUtils.loadAnimation(this, R.anim.holder_top_fast); apply_set.startAnimation(animation); }
Example 6
Source File: StartActivity.java From EverMemo with MIT License | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setLogo(R.drawable.ab_logo); mContext = this; mEvernote = new Evernote(mContext); MobclickAgent.onError(this); setContentView(R.layout.activity_start); mMemosGrid = (MultiColumnListView) findViewById(R.id.memos); mBindEvernotePanel = (LinearLayout) findViewById(R.id.evernote_panel); mBindEvernote = (Button) findViewById(R.id.bind_evernote); mBindEvernotePandelHeight = mBindEvernotePanel.getLayoutParams().height; LoaderManager manager = getSupportLoaderManager(); mMemosAdapter = new MemosAdapter(mContext, null, CursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER, this, this); mMemosGrid.setAdapter(mMemosAdapter); manager.initLoader(1, null, this); mSharedPreferences = PreferenceManager .getDefaultSharedPreferences(mContext); if (mSharedPreferences.getInt(sStartCount, 1) == 1) { mBindEvernotePanel.startAnimation(new MarginAnimation( mBindEvernotePanel, 0, 0, 0, 0, 600)); new Timer().schedule(new TimerTask() { @Override public void run() { StartActivity.this.runOnUiThread(new Runnable() { @Override public void run() { mBindEvernotePanel .startAnimation(new MarginAnimation( mBindEvernotePanel, 0, 0, 0, -mBindEvernotePandelHeight)); } }); } }, 5000); mSharedPreferences .edit() .putInt(sStartCount, mSharedPreferences.getInt(sStartCount, 1) + 1) .commit(); mBindEvernote.setOnClickListener(this); } if (mSharedPreferences.getBoolean( SettingActivity.OPEN_MEMO_WHEN_START_UP, false)) { startActivity(new Intent(this, MemoActivity.class)); } mEvernote.sync(true, true, null); UmengUpdateAgent.update(this); }