• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ShimmerFrameLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.facebook.shimmer.ShimmerFrameLayout的典型用法代码示例。如果您正苦于以下问题:Java ShimmerFrameLayout类的具体用法?Java ShimmerFrameLayout怎么用?Java ShimmerFrameLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ShimmerFrameLayout类属于com.facebook.shimmer包,在下文中一共展示了ShimmerFrameLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onViewCreated

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState){
    super.onViewCreated(view, savedInstanceState);

    final Bundle args = getArguments();
    String unlockAction = "unlock";
    if(args != null){
        unlockAction = args.getString(EXTRA_UNLOCK_ACTION, unlockAction);
    }

    sliderText = (TextView) view.findViewById(R.id.slider_text);
    sliderText.setText(R.string.unlock_slider_description);

    final SlideButton slideButton = (SlideButton) view.findViewById(R.id.unlock_slider);
    slideButton.setOnSeekBarChangeListener(this);

    shimmerContainer = (ShimmerFrameLayout) view.findViewById(R.id.shimmer_view_container);
    shimmerContainer.startShimmerAnimation();
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:20,代码来源:SlideToUnlockDialog.java


示例2: onCreate

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.main);
  mShimmerViewContainer = (ShimmerFrameLayout) findViewById(R.id.shimmer_view_container);

  mPresetButtons = new Button[]{
      (Button) findViewById(R.id.preset_button0),
      (Button) findViewById(R.id.preset_button1),
      (Button) findViewById(R.id.preset_button2),
      (Button) findViewById(R.id.preset_button3),
      (Button) findViewById(R.id.preset_button4),
  };
  for (int i = 0; i < mPresetButtons.length; i++) {
    final int preset = i;
    mPresetButtons[i].setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        selectPreset(preset, true);
      }
    });
  }
}
 
开发者ID:facebook,项目名称:shimmer-android,代码行数:25,代码来源:MainActivity.java


示例3: onViewCreated

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState){
    super.onViewCreated(view, savedInstanceState);

    final Bundle args = getArguments();
    String unlockAction = "unlock";
    if(args != null){
        unlockAction = args.getString(EXTRA_UNLOCK_ACTION, unlockAction);
    }

    sliderText = (TextView) view.findViewById(R.id.slider_text);
    sliderText.setText(getString(R.string.unlock_slider_description, unlockAction));

    final SlideButton slideButton = (SlideButton) view.findViewById(R.id.unlock_slider);
    slideButton.setOnSeekBarChangeListener(this);

    shimmerContainer = (ShimmerFrameLayout) view.findViewById(R.id.shimmer_view_container);
    shimmerContainer.startShimmerAnimation();
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:20,代码来源:SlideToUnlockDialog.java


示例4: updateCarStatusAsync

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
private void updateCarStatusAsync()
{
    (findViewById(R.id.progressBar)).setVisibility(View.VISIBLE);
    ShimmerFrameLayout container = (ShimmerFrameLayout) findViewById(R.id.shimmer_view_container);
    container.startShimmerAnimation();

    final Context context = this;
    final Activity activity = this;

    new AsyncTask<Void, Void, Void>() {
        @Override
        protected Void doInBackground(Void... params) {
            final Carwings carwings = new Carwings(context);

            carwings.update();
            LeafNotification.sendNotification(context, carwings);

            activity.runOnUiThread(new Runnable() {
                public void run() {
                    updateCarStatusUI(carwings);
                }
            });
            return null;
        }
    }.execute(null, null, null);
}
 
开发者ID:jaxbot,项目名称:wear-LeafStatus,代码行数:27,代码来源:MyActivity.java


示例5: updateCarStatusUI

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
private void updateCarStatusUI(Carwings carwings)
{
    Resources res = getResources();

    (findViewById(R.id.surfaceView2)).setBackgroundColor(res.getColor(
            carwings.currentBattery == 12 ? R.color.green :
                    carwings.charging ? R.color.orange :
                            carwings.currentBattery > 2 ? R.color.blue : R.color.red));

    (findViewById(R.id.progressBar)).setVisibility(View.GONE);
    ShimmerFrameLayout container = (ShimmerFrameLayout) findViewById(R.id.shimmer_view_container);
    container.stopShimmerAnimation();

    ((TextView) findViewById(R.id.battery_bars)).setText(
            String.format(res.getString(R.string.charge_status_battery_bars), carwings.currentBattery));
    ((TextView) findViewById(R.id.chargetime)).setText(
            String.format(res.getString(carwings.charging ? R.string.charge_status_charging
            : R.string.charge_status_not_charging), carwings.chargeTime, carwings.chargerType));

    ((TextView) findViewById(R.id.range)).setText(carwings.range);
    ((TextView) findViewById(R.id.lastupdated)).setText(carwings.lastUpdateTime);
    findViewById(R.id.button).setEnabled(true);
}
 
开发者ID:jaxbot,项目名称:wear-LeafStatus,代码行数:24,代码来源:MyActivity.java


示例6: CommonShimmerVH

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
public CommonShimmerVH(View view) {
    super(view);
    if (view instanceof ShimmerFrameLayout) {
        final ShimmerFrameLayout shimmerView = (ShimmerFrameLayout) view;
        shimmerView.setAutoStart(false);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:CommonShimmerVH.java


示例7: startAnim

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
public void startAnim() {

        if (itemView instanceof ShimmerFrameLayout) {
            final ShimmerFrameLayout shimmerView = (ShimmerFrameLayout) itemView;
            if (!shimmerView.isAnimationStarted()) {
                shimmerView.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        shimmerView.startShimmerAnimation();
                    }
                }, 100);

            }
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:CommonShimmerVH.java


示例8: stopAnim

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
public void stopAnim() {

        if (itemView instanceof ShimmerFrameLayout) {
            final ShimmerFrameLayout shimmerView = (ShimmerFrameLayout) itemView;
            if (shimmerView.isAnimationStarted()) {
                shimmerView.stopShimmerAnimation();
            }
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:CommonShimmerVH.java


示例9: ShimmerViewHolder

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
public ShimmerViewHolder(View view) {
    super(view);
    if (view instanceof ShimmerFrameLayout) {
        final ShimmerFrameLayout shimmerView = (ShimmerFrameLayout) view;
        shimmerView.setAutoStart(false);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ShimmerViewHolder.java


示例10: stopAnim

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
public void stopAnim() {

        if (itemView instanceof ShimmerFrameLayout) {
            final ShimmerFrameLayout shimmerView = (ShimmerFrameLayout) itemView;
            if (shimmerView.isAnimationStarted()) {
                shimmerView.setAutoStart(false);
            }
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:ShimmerViewHolder.java


示例11: onCreate

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    shimmer = (ShimmerFrameLayout) findViewById(R.id.shimmer);
    shimmer.setAutoStart(true);
}
 
开发者ID:rathodchintan,项目名称:chintanrathod.com,代码行数:9,代码来源:MainActivity.java


示例12: ItemHolder

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
public ItemHolder(View view) {
    super(view);
    shimmerFrameLayout = (ShimmerFrameLayout) view.findViewById(R.id.fl_shimmer);
    txtCelebName = (TextView) view.findViewById(R.id.txtCelebName);
    txtCelebMovie = (TextView) view.findViewById(R.id.txtCelebMovie);
    profileImage = (CircleImageView) view.findViewById(R.id.profileImage);
}
 
开发者ID:rathodchintan,项目名称:chintanrathod.com,代码行数:8,代码来源:ItemHolder.java


示例13: selectPreset

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
/**
 * Select one of the shimmer animation presets.
 *
 * @param preset index of the shimmer animation preset
 * @param showToast whether to show a toast describing the preset, or not
 */
private void selectPreset(int preset, boolean showToast) {
  if (mCurrentPreset == preset) {
    return;
  }
  if (mCurrentPreset >= 0) {
    mPresetButtons[mCurrentPreset].setBackgroundResource(R.color.preset_button_background);
  }
  mCurrentPreset = preset;
  mPresetButtons[mCurrentPreset].setBackgroundResource(R.color.preset_button_background_selected);

  // Save the state of the animation
  boolean isPlaying = mShimmerViewContainer.isAnimationStarted();

  // Reset all parameters of the shimmer animation
  mShimmerViewContainer.useDefaults();

  // If a toast is already showing, hide it
  if (mPresetToast != null) {
    mPresetToast.cancel();
  }

  switch (preset) {
    default:
    case 0:
      // Default
      mPresetToast = Toast.makeText(this, "Default", Toast.LENGTH_SHORT);
      break;
    case 1:
      // Slow and reverse
      mShimmerViewContainer.setDuration(5000);
      mShimmerViewContainer.setRepeatMode(ObjectAnimator.REVERSE);
      mPresetToast = Toast.makeText(this, "Slow and reverse", Toast.LENGTH_SHORT);
      break;
    case 2:
      // Thin, straight and transparent
      mShimmerViewContainer.setBaseAlpha(0.1f);
      mShimmerViewContainer.setDropoff(0.1f);
      mShimmerViewContainer.setTilt(0);
      mPresetToast = Toast.makeText(this, "Thin, straight and transparent", Toast.LENGTH_SHORT);
      break;
    case 3:
      // Sweep angle 90
      mShimmerViewContainer.setAngle(ShimmerFrameLayout.MaskAngle.CW_90);
      mPresetToast = Toast.makeText(this, "Sweep angle 90", Toast.LENGTH_SHORT);
      break;
    case 4:
      // Spotlight
      mShimmerViewContainer.setBaseAlpha(0);
      mShimmerViewContainer.setDuration(2000);
      mShimmerViewContainer.setDropoff(0.1f);
      mShimmerViewContainer.setIntensity(0.35f);
      mShimmerViewContainer.setMaskShape(ShimmerFrameLayout.MaskShape.RADIAL);
      mPresetToast = Toast.makeText(this, "Spotlight", Toast.LENGTH_SHORT);
      break;
  }

  // Show toast describing the chosen preset, if necessary
  if (showToast) {
    mPresetToast.show();
  }

  // Setting a value on the shimmer layout stops the animation. Restart it, if necessary.
  if (isPlaying) {
    mShimmerViewContainer.startShimmerAnimation();
  }
}
 
开发者ID:facebook,项目名称:shimmer-android,代码行数:73,代码来源:MainActivity.java


示例14: onCreateView

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_layout, container, false);

    ShimmerFrameLayout shimmerContainer = (ShimmerFrameLayout) view.findViewById(R.id.shimmerLayout);
    shimmerContainer.setDuration(getResources().getInteger(R.integer.animation_duration));
    shimmerContainer.setRepeatDelay(getResources().getInteger(R.integer.repeat_delay));
    shimmerContainer.setRepeatMode(ValueAnimator.REVERSE);
    shimmerContainer.startShimmerAnimation();

    return view;
}
 
开发者ID:captswag,项目名称:fb-shimmer-animation,代码行数:14,代码来源:ViewFragment.java


示例15: onCreate

import com.facebook.shimmer.ShimmerFrameLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    setContentView(R.layout.splash);
    mShimmerViewContainer = (ShimmerFrameLayout) findViewById(R.id.shimmer_view_container);


    mShimmerViewContainer.setDuration(2000);
    mShimmerViewContainer.setRepeatMode(ObjectAnimator.REVERSE);
    mShimmerViewContainer.startShimmerAnimation();
    mSplashThread =  new Thread(){
        @Override
        public void run(){
            try {
                synchronized(this){
                    // Wait given period of time or exit on touch
                    wait(4000);
                }
            }
            catch(InterruptedException ex){
            }

            finish();
        }
    };

    new android.os.Handler().postDelayed(new Runnable() {

        /*
         * Showing splash screen with a timer. This will be useful when you
         * want to show case your app logo / company
         */

        @Override
        public void run() {
            // This method will be executed once the timer is over
            // Start your app main activity
            Intent i = new Intent(Splash.this, MainActivity.class);
            startActivity(i);

            // close this activity
            finish();
        }
    }, 4000);

}
 
开发者ID:Aparoksha,项目名称:App_2016,代码行数:49,代码来源:Splash.java



注:本文中的com.facebook.shimmer.ShimmerFrameLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JShell类代码示例发布时间:2022-05-22
下一篇:
Java Progressive类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap