Java Code Examples for android.support.v7.app.ActionBar.hide()

The following are Jave code examples for showing how to use hide() of the android.support.v7.app.ActionBar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: FlexibleSearchBar   File: MainActivity.java   Source Code and License Vote up 7 votes
private void initView() {
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
        supportActionBar.hide();
    }
    searchbarview = (SearchBarView) findViewById(R.id.searchbarview);
    searchbarview.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            // enter search activity
            Toast.makeText(MainActivity.this, "enter search activity", Toast.LENGTH_SHORT).show();
        }
    });
    AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbarlayout);
    appBarLayout.addOnOffsetChangedListener(this);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    RecyclerView mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setVerticalScrollBarEnabled(true);
    mRecyclerView.setNestedScrollingEnabled(false);
    mRecyclerView.setAdapter(new MyAdapter());
}
 
Example 2
Project: Bigbang   File: CopyActivity.java   Source Code and License Vote up 7 votes
private void fullScreenMode(boolean fullScreen) {
    ActionBar actionBar = getSupportActionBar();
    isFullScreen = fullScreen;
    if(fullScreen) {
        if(actionBar != null) {
            actionBar.hide();
        }

        adjustActionBarWrap();
    } else {
        if(actionBar != null) {
            actionBar.show();
        }

        copyFab.hide();
        exitFab.hide();
        exitFullScreenFab.hide();
    }
    SPHelper.save(IS_FULL_SCREEN_COPY,fullScreen);
}
 
Example 3
Project: wzyx-android-user   File: PayOrderActivity.java   Source Code and License Vote up 6 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    //设置支付宝沙箱环境
    EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_payorder);
    StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.white));
    //隐藏actionBar
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    //绑定ButterKnife
    ButterKnife.bind(this);
    initView(getIntent());
    initTitleBarEvent();
}
 
Example 4
Project: wzyx-android-user   File: CityPickerActivity.java   Source Code and License Vote up 6 votes
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //初始化百度地图SDK
    SDKInitializer.initialize(getApplicationContext());
    setContentView(R.layout.cp_activity_city_list);
    StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.white));
    //隐藏actionBar
    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null){
        actionBar.hide();
    }
    initData();
    initView();
    //声明LocationClient类
    mLocationClient = new LocationClient(getApplicationContext());
    //注册监听函数
    mLocationClient.registerLocationListener(myListener);
    initLocation();

}
 
Example 5
Project: GiraffePlayer2   File: UIHelper.java   Source Code and License Vote up 6 votes
public UIHelper showActionBar(boolean show) {
    if (activity == null) {
        return this;
    }
    if (activity instanceof AppCompatActivity) {
        ActionBar supportActionBar = ((AppCompatActivity) activity).getSupportActionBar();
        if (supportActionBar != null) {
            try {
                supportActionBar.setShowHideAnimationEnabled(false);
            } catch (Exception e) {

            }
            if (show) {
                supportActionBar.show();
            } else {
                supportActionBar.hide();
            }
        }
    }
    return this;
}
 
Example 6
Project: IslamicLibraryAndroid   File: ReadingActivity.java   Source Code and License Vote up 6 votes
private void hide() {
    // Hide UI first
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    if (mControlsView != null) {
        animateFadeOutHide(mControlsView, FADE_ANIMATION_DURATION);
    }
    if (searchScrubBar != null) {
        animateFadeOutHide(searchScrubBar, FADE_ANIMATION_DURATION);
    }

    if (mFloatingPageNumberFrameLayout != null) {
        animateFadeOutHide(mFloatingPageNumberFrameLayout, FADE_ANIMATION_DURATION);
    }

    mVisible = false;

    // Schedule a runnable to remove the status and navigation bar after a delay
    mHideHandler.removeCallbacks(mShowPart2Runnable);
    mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);

}
 
Example 7
Project: Beach-Android   File: PollActivity.java   Source Code and License Vote up 5 votes
private void initViews(){
    ivBack = (ImageView) findViewById(R.id.ivBack);
    ivNext = (ImageView) findViewById(R.id.ivNext);
    ivNext.setVisibility(View.INVISIBLE);
    tvHeader = (TextView) findViewById(R.id.tvHeader);
    tvHeader.setText(getIntent().getStringExtra("poll").toUpperCase());
    scrollViewPoll = (ScrollView) findViewById(R.id.scrollViewPoll);
    etPollQues = (EditText) findViewById(R.id.etPollQues);
    tvResponseType = (TextView) findViewById(R.id.tvResponseType);
    llResponseType = (LinearLayout) findViewById(R.id.llResponseType);
    tvTextBoxMulChoice = (TextView) findViewById(R.id.tvTextBoxMulChoice);
    tvTextBoxRBtn = (TextView) findViewById(R.id.tvTextBoxRBtn);
    tvTextBoxNumeric = (TextView) findViewById(R.id.tvTextBoxNumeric);
    tvTextBox = (TextView) findViewById(R.id.tvTextBox);
    llMultipleChoice = (LinearLayout) findViewById(R.id.llMultipleChoice);
    etOptionOne = (EditText) findViewById(R.id.etOptionOne);
    etOptionTwo = (EditText) findViewById(R.id.etOptionTwo);
    etOptionThree = (EditText) findViewById(R.id.etOptionThree);
    etOptionFour = (EditText) findViewById(R.id.etOptionFour);
    btnViewSaved = (Button) findViewById(R.id.btnViewSaved);
    btnAddMoreChoice = (Button) findViewById(R.id.btnAddMoreChoice);
    rlPollExpiry = (RelativeLayout) findViewById(R.id.rlPollExpiry);
    btnPollExpiryTime = (Button) findViewById(R.id.btnPollExpiryTime);
    btnSend = (Button) findViewById(R.id.btnSend);
    btnSave = (Button) findViewById(R.id.btnSave);
    tvRecipientMsg = (TextView) findViewById(R.id.tvRecipientMsg);
    opt = 0;
    isFragmentOpen = false;
    ActionBar actionBar = getSupportActionBar();
    if(actionBar!=null){
        actionBar.hide();
    }
}
 
Example 8
Project: HeadlineNews   File: JCVideoPlayer.java   Source Code and License Vote up 5 votes
public static void hideSupportActionBar(Context context) {
    if (ACTION_BAR_EXIST) {
        ActionBar ab = JCUtils.getAppCompActivity(context).getSupportActionBar();
        if (ab != null) {
            ab.setShowHideAnimationEnabled(false);
            ab.hide();
        }
    }
    if (TOOL_BAR_EXIST) {
        JCUtils.getAppCompActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
Example 9
Project: MKVideoPlayer   File: MKPlayer.java   Source Code and License Vote up 5 votes
private void tryFullScreen(boolean fullScreen) {
    if (activity instanceof AppCompatActivity) {
        ActionBar supportActionBar = ((AppCompatActivity) activity).getSupportActionBar();
        if (supportActionBar != null) {
            if (fullScreen) {
                supportActionBar.hide();
            } else {
                supportActionBar.show();
            }
        }
    }
    setFullScreen(fullScreen);
}
 
Example 10
Project: PlayerBase   File: AndroidMediaController.java   Source Code and License Vote up 5 votes
public void setSupportActionBar(@Nullable ActionBar actionBar) {
    mActionBar = actionBar;
    if (isShowing()) {
        actionBar.show();
    } else {
        actionBar.hide();
    }
}
 
Example 11
Project: wzyx-android-user   File: RegisterActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);
    StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.white));
    //隐藏actionBar
    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null){
        actionBar.hide();
    }
    //绑定ButterKnife
    ButterKnife.bind(this);
}
 
Example 12
Project: RLibrary   File: StyleActivity.java   Source Code and License Vote up 5 votes
/**
 * 基本样式
 */
protected void loadActivityStyle() {
    final Window window = getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    final ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
        supportActionBar.hide();
    }
}
 
Example 13
Project: wzyx-android-user   File: EditGenderActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_edit_gender);
    StatusBarCompat.setStatusBarColor(this,getResources().getColor(R.color.white));
    //隐藏actionBar
    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null){
        actionBar.hide();
    }
    //绑定ButterKnife
    ButterKnife.bind(this);
    initTitleBar();
}
 
Example 14
Project: FastAndroid   File: LaunchActivity.java   Source Code and License Vote up 5 votes
private void hide() {
    // Hide UI first
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    mControlsView.setVisibility(View.GONE);
    mVisible = false;

    // Schedule a runnable to remove the status and navigation bar after a delay
    mHideHandler.removeCallbacks(mShowPart2Runnable);
    mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
}
 
Example 15
Project: live_master   File: GiraffePlayer.java   Source Code and License Vote up 5 votes
private void tryFullScreen(boolean fullScreen) {
    if (activity instanceof AppCompatActivity) {
        ActionBar supportActionBar = ((AppCompatActivity) activity).getSupportActionBar();
        if (supportActionBar != null) {
            if (fullScreen) {
                supportActionBar.hide();
            } else {
                supportActionBar.show();
            }
        }
    }
    setFullScreen(fullScreen);
}
 
Example 16
Project: FloatingNew   File: SplashScreen.java   Source Code and License Vote up 5 votes
private void hide() {
    // Hide UI first
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }


    // Schedule a runnable to remove the status and navigation bar after a delay
    mHideHandler.removeCallbacks(mShowPart2Runnable);
    int UI_ANIMATION_DELAY = 200;
    mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
}
 
Example 17
Project: FastEc   File: ExampleActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    StatusBarCompat.translucentStatusBar(this, true);
}
 
Example 18
Project: Edu   File: JCVideoPlayer.java   Source Code and License Vote up 5 votes
public static void hideSupportActionBar(Context context) {
    if (ACTION_BAR_EXIST) {
        ActionBar ab = JCUtils.getAppCompActivity(context).getSupportActionBar();
        if (ab != null) {
            ab.setShowHideAnimationEnabled(false);
            ab.hide();
        }
    }
    if (TOOL_BAR_EXIST) {
        JCUtils.getAppCompActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
Example 19
Project: CodeCompilerApp   File: SystemUiHelperImplHC.java   Source Code and License Vote up 5 votes
protected void onSystemUiHidden() {
    ActionBar ab = ((ActionBarActivity) mActivity).getSupportActionBar();
    if (ab != null) {
        ab.hide();
    }

    mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setIsShowing(false);
}
 
Example 20
Project: MixUtils   File: BaseActivity.java   Source Code and License Vote up 4 votes
public void restoreActionBar() {
  ActionBar actionBar = getSupportActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
  actionBar.hide();
  actionBar.setDisplayShowTitleEnabled(false);
}