当前位置: 首页>>代码示例>>Java>>正文


Java Slidr.attach方法代码示例

本文整理汇总了Java中com.r0adkll.slidr.Slidr.attach方法的典型用法代码示例。如果您正苦于以下问题:Java Slidr.attach方法的具体用法?Java Slidr.attach怎么用?Java Slidr.attach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.r0adkll.slidr.Slidr的用法示例。


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

示例1: setBaseView

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void setBaseView(@LayoutRes int layoutId) {
    Slidr.attach(this);
    contentView = LayoutInflater.from(this).inflate(R.layout.activity_back, null);
    setContentView(contentView);
    rootLayout = (CoordinatorLayout) findViewById(R.id.root_layout);
    abl = (AppBarLayout) findViewById(R.id.abl);
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    flActivityContainer = (FrameLayout) findViewById(R.id.activity_container);
    flActivityContainer.addView(LayoutInflater.from(this).inflate(layoutId, flActivityContainer, false));
    setSupportActionBar(mToolbar);
    getToolBar().setDisplayHomeAsUpEnabled(true);

    BarUtils.setStatusBarColor(this, ContextCompat.getColor(UtilsApp.getInstance(), R.color.colorPrimary), 0);
    BarUtils.addMarginTopEqualStatusBarHeight(rootLayout);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:BaseBackActivity.java

示例2: initView

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
public void initView(Bundle savedInstanceState, View view) {
    Slidr.attach(this);

    llContainer = (LinearLayout) findViewById(R.id.ll_container);
    cbAlpha = (CheckBox) findViewById(R.id.cb_alpha);
    btnRandomColor = (Button) findViewById(R.id.btn_random_color);
    tvStatusAlpha = (TextView) findViewById(R.id.tv_status_alpha);
    sbChangeAlpha = (SeekBar) findViewById(R.id.sb_change_alpha);

    cbAlpha.setOnCheckedChangeListener(mCheckedChangeListener);
    btnRandomColor.setOnClickListener(this);
    findViewById(R.id.btn_set_transparent).setOnClickListener(this);
    sbChangeAlpha.setOnSeekBarChangeListener(mColorListener);

    tvStatusAlpha.setText(String.valueOf(mAlpha));

    updateStatusBar();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:BarStatusSwipeBackActivity.java

示例3: setBaseView

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void setBaseView(@LayoutRes int layoutId) {
    Slidr.attach(this);
    contentView = LayoutInflater.from(this).inflate(R.layout.activity_back, null);
    setContentView(contentView);
    rootLayout = findViewById(R.id.root_layout);
    abl = findViewById(R.id.abl);
    mToolbar = findViewById(R.id.toolbar);
    flActivityContainer = findViewById(R.id.activity_container);
    flActivityContainer.addView(LayoutInflater.from(this).inflate(layoutId, flActivityContainer, false));
    setSupportActionBar(mToolbar);
    getToolBar().setDisplayHomeAsUpEnabled(true);

    BarUtils.setStatusBarColor(this, ContextCompat.getColor(UtilsApp.getInstance(), R.color.colorPrimary), 0);
    BarUtils.addMarginTopEqualStatusBarHeight(rootLayout);
}
 
开发者ID:Blankj,项目名称:AndroidUtilCode,代码行数:17,代码来源:BaseBackActivity.java

示例4: initView

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
public void initView(Bundle savedInstanceState, View view) {
    Slidr.attach(this);

    llContainer = findViewById(R.id.ll_container);
    cbAlpha = findViewById(R.id.cb_alpha);
    btnRandomColor = findViewById(R.id.btn_random_color);
    tvStatusAlpha = findViewById(R.id.tv_status_alpha);
    sbChangeAlpha = findViewById(R.id.sb_change_alpha);

    cbAlpha.setOnCheckedChangeListener(mCheckedChangeListener);
    btnRandomColor.setOnClickListener(this);
    findViewById(R.id.btn_set_transparent).setOnClickListener(this);
    sbChangeAlpha.setOnSeekBarChangeListener(mColorListener);

    tvStatusAlpha.setText(String.valueOf(mAlpha));

    updateStatusBar();
}
 
开发者ID:Blankj,项目名称:AndroidUtilCode,代码行数:20,代码来源:BarStatusSwipeBackActivity.java

示例5: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // 设置右滑动返回
    Slidr.attach(this);
    setContentView(R.layout.swipe_back_activity);
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mBtnChangeColor = (Button) findViewById(R.id.btn_change_color);

    setSupportActionBar(mToolbar);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    mToolbar.setBackgroundColor(mColor);
    mBtnChangeColor.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Random random = new Random();
            mColor = 0xff000000 | random.nextInt(0xffffff);
            mToolbar.setBackgroundColor(mColor);
            StatusBarUtil.setColorForSwipeBack(SwipeBackActivity.this, mColor, 38);
        }
    });
}
 
开发者ID:laobie,项目名称:StatusBarUtil,代码行数:25,代码来源:SwipeBackActivity.java

示例6: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    switch(SettingsActivity.getTheme(this)) {
        case SettingsActivity.THEME_VERT:
            setTheme(R.style.AppTheme_SlidrActivity);
            break;
        case SettingsActivity.THEME_NOIR:
            setTheme(R.style.AppThemeNoir_SlidrActivity);
            break;
        case SettingsActivity.THEME_BLEU:
            setTheme(R.style.AppThemeBleu_SlidrActivity);
            break;
        case SettingsActivity.THEME_ROUGE:
            setTheme(R.style.AppThemeRouge_SlidrActivity);
            break;
        case SettingsActivity.THEME_VIOLET:
            setTheme(R.style.AppThemeViolet_SlidrActivity);
            break;
    }

    slidrInterface = Slidr.attach(this, slidrConfig);

    super.onCreate(savedInstanceState);
}
 
开发者ID:lloydtorres,项目名称:stately,代码行数:25,代码来源:SlidrActivity.java

示例7: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
/***********************************************************************************************
 *
 * Lifecycle Methods
 *
 */

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_settings);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Slidr.attach(this);

    Timber.i("Launching Settings Fragment: (%s)", getIntent());
    if(savedInstanceState == null) {
        getFragmentManager().beginTransaction()
                .replace(R.id.container, SettingsFragment.createInstance())
                .commit();
    }

}
 
开发者ID:52inc,项目名称:android-Showcase,代码行数:22,代码来源:SettingsActivity.java

示例8: onContentChanged

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
public void onContentChanged() {
    super.onContentChanged();
    //设置沉淀式状态栏
    mImmersionBar = ImmersionBar.with(this);
    initImmersionBar(mImmersionBar);
    if (isEnableSlideFinish()) {
        Slidr.attach(this, new SlidrConfig
                .Builder()
                .edge(true)
                .edgeSize(0.18f)// The % of the screen that counts as the edge, default 18%
                .listener(new SlidrListenerAdapter() {
                    @Override
                    public void onSlideStateChanged(int state) {
                        BaseActivity.this.onSlideStateChanged(state);
                    }

                    @Override
                    public void onSlideOpened() {
                        BaseActivity.this.onSlideCancel();
                    }

                    @Override
                    public void onSlideClosed() {
                        BaseActivity.this.onSlideClosed();
                    }
                })
                .build());
    }
}
 
开发者ID:z-chu,项目名称:FriendBook,代码行数:31,代码来源:BaseActivity.java

示例9: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    //    Window window = getWindow();
    //    window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    //    window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    //    window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    //    window.setStatusBarColor(Color.TRANSPARENT);
    //}
    //if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    //    Window window = getWindow();
    //    //透明状态栏
    //    window.setFlags(
    //            WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
    //            WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    //    //透明导航栏
    //    window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    //    window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    //}
    //绑定向右滑动退出
    SlidrInterface slidrInterface = Slidr.attach(this, SlidrUtils.getSlidrConfig());

}
 
开发者ID:NICOLITE,项目名称:Palm300Heroes,代码行数:25,代码来源:BaseActivity.java

示例10: initSlidr

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
protected void initSlidr() {
    FrameLayout content = (FrameLayout)findViewById(android.R.id.content);
    content.setBackgroundColor(getResources().getColor(R.color.activityBackground));

    if (viewDelegate.isAttach()){
        attach = Slidr.attach(this);
    }
}
 
开发者ID:vcredit-zj,项目名称:noplayer,代码行数:9,代码来源:ActivityPresenter.java

示例11: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_preferences);
    ButterKnife.bind(this);

    getFragmentManager().beginTransaction()
            .replace(R.id.frame, new PreferencesFragment())
            .commit();

    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();

    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setTitle(getString(R.string.settings));
    }

    SlidrConfig config = new SlidrConfig.Builder()
            .sensitivity(1f)
            .scrimColor(Color.BLACK)
            .scrimStartAlpha(0.8f)
            .scrimEndAlpha(0f)
            .velocityThreshold(2400)
            .distanceThreshold(0.25f)
            .edge(true)
            .edgeSize(0.18f)
            .build();

    Slidr.attach(this, config);
}
 
开发者ID:tylerbwong,项目名称:Pokebase,代码行数:32,代码来源:PreferencesActivity.java

示例12: initSlidable

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
/**
 * 初始化滑动返回
 */
protected void initSlidable() {
    int isSlidable = SettingUtil.getInstance().getSlidable();
    if (isSlidable != Constant.SLIDABLE_DISABLE) {
        SlidrConfig config = new SlidrConfig.Builder()
                .edge(isSlidable == Constant.SLIDABLE_EDGE)
                .build();
        slidrInterface = Slidr.attach(this, config);
    }
}
 
开发者ID:iMeiji,项目名称:Toutiao,代码行数:13,代码来源:BaseActivity.java

示例13: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_viewer);
    ButterKnife.inject(this);

    // Get the status bar colors to interpolate between
    int primary = getResources().getColor(R.color.primaryDark);
    int secondary = getResources().getColor(R.color.accent);

    // Build the slidr config
    SlidrConfig config = new SlidrConfig.Builder()
            .primaryColor(primary)
            .secondaryColor(secondary)
            .position(SlidrPosition.LEFT)
            .touchSize(Utils.dpToPx(this, 32))
            .build();

    // Attach the Slidr Mechanism to this activity
    Slidr.attach(this, config);

    setSupportActionBar(mToolbar);
    getSupportActionBar().setTitle("");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mOS = getIntent().getParcelableExtra(EXTRA_OS);
    if(savedInstanceState != null) mOS = savedInstanceState.getParcelable(EXTRA_OS);

    // Set layout contents
    mTitle.setText(mOS.name);
    mDescription.setText(mOS.description);
    mDate.setText(String.valueOf(mOS.year));
    mVersion.setText(mOS.version);
    mSdk.setText(String.valueOf(mOS.sdk_int));

    // Load header image
    Picasso.with(this)
            .load(mOS.image_url)
            .into(mCover);
}
 
开发者ID:azimkhan917,项目名称:Slide-Master,代码行数:40,代码来源:ViewerActivity.java

示例14: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_post);
    int primary = getResources().getColor(R.color.primary_dark);
    int secondary = getResources().getColor(R.color.primary_text);

    ButterKnife.bind(this);
    SlidrConfig mConfig = new SlidrConfig.Builder()
            .primaryColor(primary)
            .secondaryColor(secondary)
            .build();


    Slidr.attach(this,mConfig);




    getSupportActionBar().setTitle("Create Post");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
开发者ID:othreecodes,项目名称:WaJeun,代码行数:23,代码来源:PostActivity.java

示例15: onCreate

import com.r0adkll.slidr.Slidr; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile);
    ButterKnife.bind(this);

    databaseHelper = DatabaseOpenHelper.getInstance(this);

    profileImg.setClipToOutline(true);
    profileImg.setElevation(PROFILE_IMG_ELEVATION);

    setSupportActionBar(toolbar);
    actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(false);
    }
    appBar.addOnOffsetChangedListener(this);
    startAlphaAnimation(title, 0, View.INVISIBLE);

    SlidrConfig config = new SlidrConfig.Builder()
            .sensitivity(1f)
            .scrimColor(Color.BLACK)
            .scrimStartAlpha(0.8f)
            .scrimEndAlpha(0f)
            .velocityThreshold(2400)
            .distanceThreshold(0.25f)
            .edge(true)
            .edgeSize(0.18f)
            .build();

    Slidr.attach(this, config);

    Bundle extras = getIntent().getExtras();
    pokemonId = extras.getInt(POKEMON_ID_KEY);
    pokemonName = extras.getString(POKEMON_NAME_KEY);

    infoView.setButtonsVisible(true);
    infoView.loadPokemonInfo(pokemonId);

    loadNextPrevious();

    Glide.with(PokemonProfileActivity.this)
            .load(String.format(getString(R.string.sprite_url),
                    databaseHelper.queryPokemonNameById(pokemonId).toLowerCase()))
            .into(profileImg);

    String formattedName = String.format(getString(R.string.pokemon_name),
            formatId(pokemonId), pokemonName);
    title.setText(formattedName);
    mainTitle.setText(formattedName);
}
 
开发者ID:tylerbwong,项目名称:Pokebase,代码行数:53,代码来源:PokemonProfileActivity.java


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