android.support.v7.app.ActionBar的实例源码

项目:Bigbang    文件:CopyActivity.java   
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);
}
项目:QueryHighlighter    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mAdapter = new CheesesAdapter();

    final ListView listView = (ListView) findViewById(android.R.id.list);
    listView.setAdapter(mAdapter);

    final ActionBar actionBar = getSupportActionBar();
    actionBar.setCustomView(R.layout.search_view);
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

    final EditText editText = (EditText) actionBar.getCustomView();
    editText.addTextChangedListener(mTextWatcher);
    editText.requestFocus();
}
项目:Phoenix-for-VK    文件:LikesFragment.java   
@Override
public void onResume() {
    super.onResume();
    ActionBar actionBar = ActivityUtils.supportToolbarFor(this);
    if(actionBar != null){
        actionBar.setTitle("likes".equals(getArguments().getString(Extra.FILTER)) ? R.string.like : R.string.shared);
        actionBar.setSubtitle(null);
    }

    new ActivityFeatures.Builder()
            .begin()
            .setBlockNavigationDrawer(false)
            .setStatusBarColored(true)
            .build()
            .apply(getActivity());
}
项目:changApp    文件:PostulacionesActivasActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_postulaciones_activas);
    // Setting ViewPager for each Tabs
    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager_pa);
    setupViewPager(viewPager);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerpa);
    // Adding menu icon to Toolbar
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
        VectorDrawableCompat indicator
                = VectorDrawableCompat.create(getResources(),R.drawable.ic_menu,getTheme());
        indicator.setTint(ResourcesCompat.getColor(getResources(),R.color.white,getTheme()));
        supportActionBar.setHomeAsUpIndicator(indicator);
        supportActionBar.setDisplayHomeAsUpEnabled(true);
    }

}
项目:simple-stack    文件:MainActivity.java   
@Override
public void handleStateChange(@NonNull StateChange traversal,@NonNull final StateChanger.Callback callback) {
    Path path = traversal.topNewState();
    setTitle(path.getTitle());
    ActionBar actionBar = getSupportActionBar();
    boolean canGoBack = traversal.getNewState().size() > 1;
    actionBar.setDisplayHomeAsUpEnabled(canGoBack);
    actionBar.setHomeButtonEnabled(canGoBack);
    containerAsStateChanger.handleStateChange(traversal,new StateChanger.Callback() {
        @Override
        public void stateChangeComplete() {
            invalidateOptionsMenu();
            callback.stateChangeComplete();
        }
    });
}
项目:chuck    文件:TransactionActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.chuck_activity_transaction);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    title = (TextView) findViewById(R.id.toolbar_title);

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);

    ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
    if (viewPager != null) {
        setupViewPager(viewPager);
    }

    TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
    tabLayout.setupWithViewPager(viewPager);

    transactionId = getIntent().getLongExtra(ARG_TRANSACTION_ID,0);
    getSupportLoaderManager().initLoader(0,null,this);
}
项目:OneWeather    文件:SettingActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setting);


    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null){
        actionBar.setTitle("    设置");
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.ic_back);
    }


    if (Build.VERSION.SDK_INT >= 21 && Build.VERSION.SDK_INT <23) {
        getWindow().setStatusBarColor(0x22000000);//浅黑
    } else if (Build.VERSION.SDK_INT >= 23) {
        View decorView = getWindow().getDecorView();
        decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        getWindow().setStatusBarColor(Color.TRANSPARENT);
    }


}
项目:Pigeon    文件:BaseActivity.java   
/**
 * 初始化ToolBar
 *
 * @param toolbar ToolBar的实例
 * @param title 标题
 * @param isBack 是否出现返回按钮
 */
public void initToolBar(Toolbar toolbar,String title,boolean isBack) {
    toolbar.setTitle(title);
    setSupportActionBar(toolbar);
    if (isBack) {
        try {
            ActionBar actionBar = getSupportActionBar();
            if (null != actionBar)
                actionBar.setDisplayHomeAsUpEnabled(true);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }

}
项目:Phoenix-for-VK    文件:DialogsFragment.java   
@Override
public void onResume() {
    super.onResume();
    Settings.get().ui().notifyPlaceResumed(Place.DIALOGS);

    ActionBar actionBar = ActivityUtils.supportToolbarFor(this);
    if (actionBar != null) {
        actionBar.setTitle(R.string.dialogs);
        actionBar.setSubtitle(getArguments().getString(Extra.SUBTITLE));
    }

    if (getActivity() instanceof OnSectionResumeCallback) {
        ((OnSectionResumeCallback) getActivity()).onSectionResume(NavigationFragment.SECTION_ITEM_DIALOGS);
    }

    new ActivityFeatures.Builder()
            .begin()
            .setBlockNavigationDrawer(false)
            .setStatusBarColored(true)
            .build()
            .apply(getActivity());
}
项目:android_firebase_green_thumb    文件:PlantDetailActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detail);

    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    mToolbar.setTitle("");
    mItemDescription = (TextView) findViewById(R.id.text_view_item_description);
    mItemPrice = (TextView) findViewById(R.id.text_view_item_price);
    final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);

    setSupportActionBar(mToolbar);
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
        supportActionBar.setDisplayHomeAsUpEnabled(true);
    }
    fab.setOnClickListener(this);

    mItemId = getIntent().getIntExtra(INTENT_EXTRA_ITEM,0);

    getSupportLoaderManager().initLoader(PLANT_DETAIL_LOADER,this);
}
项目:Phoenix-for-VK    文件:FwdsFragment.java   
@Override
public void onResume() {
    super.onResume();
    if(getActivity() instanceof OnSectionResumeCallback){
        ((OnSectionResumeCallback)getActivity()).onClearSelection();
    }

    ActionBar actionBar = ActivityUtils.supportToolbarFor(this);
    if(actionBar != null){
        actionBar.setSubtitle(null);
        actionBar.setTitle(R.string.title_mssages);
    }

    new ActivityFeatures.Builder()
            .begin()
            .setBlockNavigationDrawer(false)
            .setStatusBarColored(true)
            .build()
            .apply(getActivity());
}
项目:Hello-Music-droid    文件:FoldersFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
    View rootView = inflater.inflate(
            R.layout.fragment_folders,container,false);

    Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
    ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);

    ActionBar ab = ((AppCompatActivity) getActivity()).getSupportActionBar();
    ab.setHomeAsUpIndicator(R.drawable.ic_menu);
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setTitle(R.string.folders);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
    mProgressBar = (ProgressBar) rootView.findViewById(R.id.progressBar);

    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

    if (getActivity() != null)
        new loadFolders().execute("");
    return rootView;
}
项目:IdeaTrackerPlus    文件:MainActivity.java   
private void selectFavoriteProject() {

        if (!mNoProject) {
            mSelectedProfileIndex = getIndexOfFavorite();
            IProfile activeProfile = mProfiles.get(mSelectedProfileIndex);
            String activeProfileName = activeProfile.getName().getText();

            ActionBar bar;
            if ((bar = getSupportActionBar()) != null) {
                bar.setTitle(activeProfileName);
            }

            DataEntry.setTableName(activeProfileName);

            switchToProjectColors();
        }
    }
项目:GitHub    文件:ThreadExampleActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Set up the action bar.
    final android.support.v7.app.ActionBar actionBar = getSupportActionBar();
    actionBar.setNavigationMode(android.support.v7.app.ActionBar.NAVIGATION_MODE_TABS);

    SectionsPagerAdapter pageAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
    viewPager = (ViewPager) findViewById(R.id.pager);
    viewPager.setAdapter(pageAdapter);

    viewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
        @Override
        public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
        }
    });

    for (int i = 0; i < pageAdapter.getCount(); i++) {
        getSupportActionBar().addTab(getSupportActionBar().newTab()
                .setText(pageAdapter.getPageTitle(i))
                .setTabListener(this));
    }
}
项目:MovieApp    文件:GenreFragment.java   
private void init(View view) {
    unbinder = ButterKnife.bind(this,view);

    activity = (AppCompatActivity) getActivity();

    activity.setSupportActionBar(toolbar);
    ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(title);
    }

    LinearLayoutManager layoutManager
            = new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.addItemDecoration(new DividerItemDecoration(activity,layoutManager.getOrientation()));
    recyclerView.setHasFixedSize(true);
    recyclerView.setMotionEventSplittingEnabled(false);
    recyclerView.setNestedScrollingEnabled(false);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setAdapter(genreAdapter);
}
项目:Nird2    文件:IntroductionMessageFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,Bundle savedInstanceState) {

    // change toolbar text
    ActionBar actionBar = introductionActivity.getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle(R.string.introduction_message_title);
    }

    // inflate view
    View v = inflater.inflate(R.layout.introduction_message,false);
    ui = new ViewHolder(v);
    ui.text.setVisibility(GONE);
    ui.message.setSendButtonEnabled(false);

    return v;
}
项目:Companion-For-PUBG-Android    文件:ItemDetailActivity.java   
@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setSupportActionBar(toolbar);

    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowHomeEnabled(true);
    }

    final Intent intent = getIntent();
    if (intent == null) {
        throw new IllegalStateException("Missing intent");
    }
    final Item item = (Item) intent.getSerializableExtra(EXTRA_ITEM);
    if (item instanceof Weapon) {
        showFragment(WeaponDetailFragment.newInstance((Weapon) item),WeaponDetailFragment.TAG);
    } else if (item instanceof Ammo) {
        showFragment(AmmoDetailFragment.newInstance((Ammo) item),WeaponDetailFragment.TAG);
    } else {
        Toast.makeText(this,"We're still working on this feature!",Toast.LENGTH_SHORT).show();
        finish();
    }
}
项目:ArcLayout-master    文件:DemoLikeTumblrActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.like_a_tumblr);

  Demo demo = getDemo(getIntent());

  ActionBar bar = getSupportActionBar();
  bar.setTitle(demo.titleResId);
  bar.setDisplayHomeAsUpEnabled(true);

  rootLayout = findViewById(R.id.root_layout);
  menuLayout = (ClipRevealFrame) findViewById(R.id.menu_layout);
  arcLayout = (ArcLayout) findViewById(R.id.arc_layout);
  centerItem = findViewById(R.id.center_item);

  centerItem.setOnClickListener(this);
  for (int i = 0,size = arcLayout.getChildCount(); i < size; i++) {
    arcLayout.getChildAt(i).setOnClickListener(this);
  }

  findViewById(R.id.fab).setOnClickListener(this);

}
项目:social-journal    文件:AddNote.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_note);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    // Get a support ActionBar corresponding to this toolbar
    ActionBar ab = getSupportActionBar();

    // Enable the Up button
    if (ab != null) {
        ab.setDisplayHomeAsUpEnabled(true);
    }


    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(view,"Replace with your own action",Snackbar.LENGTH_LONG)
                    .setAction("Action",null).show();
        }
    });
}
项目:thermalprinterhelper    文件:PrinterListActivity.java   
private void initUi() {
    ActionBar actionBar = getSupportActionBar();
    actionBar.hide();

    printerlist_list = (ListView) findViewById(R.id.printerlist_list);
    toolbar_refresh = (Button) findViewById(R.id.toolbar_refresh);
    toolbar_left_button = (ImageButton) findViewById(R.id.toolbar_left_button);

    printerlist_active = (TextView) findViewById(R.id.printerlist_active);
    printerlist_progress = (ProgressBar) findViewById(R.id.printerlist_progress);
    printerlist_content = (LinearLayout) findViewById(R.id.printerlist_content);

    printerlist_progress.setVisibility(View.GONE);

    toolbar_left_button.setOnClickListener(this);
    toolbar_refresh.setOnClickListener(this);
    printerlist_list.setOnItemClickListener(this);
}
项目:TurboChat    文件:ProfileActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_root);
    ButterKnife.bind(this);

    String userNick = getIntent().getExtras().getString(ARG_USER);
    inflateFragment(userNick);
    setSupportActionBar(toolbar);
    final ActionBar supportActionBar = getSupportActionBar();
    supportActionBar.setTitle(userNick);
    supportActionBar.setDisplayHomeAsUpEnabled(true);
}
项目:dkplayer    文件:ListFragmentViewPagerActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list_fragment_view_pager);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setTitle("LIST FRAGMENT VIEWPAGER");
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    initView();
}
项目:Customerly-Android-SDK    文件:IAct_FullScreenImage.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if(this.getIntent() != null) {
        this._SourceUrl = this.getIntent().getStringExtra(EXTRA_IMAGE_SOURCE);
        if(this._SourceUrl != null) {
            ImageView _ImageView = new TouchImageView(this);
            _ImageView.setBackgroundColor(Color.WHITE);
            _ImageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
            _ImageView.setAdjustViewBounds(true);
            try {
                Customerly.get()._RemoteImageHandler.request(new IU_RemoteImageHandler.Request()
                        .fitCenter()
                        .load(this._SourceUrl)
                        .into(this,_ImageView)
                        .placeholder(R.drawable.io_customerly__pic_placeholder_fullscreen));
                super.setContentView(_ImageView);

                final ActionBar actionBar = this.getSupportActionBar();
                if (actionBar != null) {
                    String title;
                    if(Customerly.get().__PING__LAST_widget_color != 0) {
                        actionBar.setBackgroundDrawable(new ColorDrawable(Customerly.get().__PING__LAST_widget_color));
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                            this.getWindow().setStatusBarColor(IU_Utils.alterColor(Customerly.get().__PING__LAST_widget_color,0.8f));
                        }

                        if (IU_Utils.getContrastColor(Customerly.get().__PING__LAST_widget_color) == Color.BLACK) {
                            actionBar.setHomeAsUpIndicator(R.drawable.io_customerly__ic_arrow_back_black_24dp);
                            title = String.format("<font color='#000000'>%1$s</font>",actionBar.getTitle());

                        } else {
                            actionBar.setHomeAsUpIndicator(R.drawable.io_customerly__ic_arrow_back_white_24dp);
                            title = String.format("<font color='#ffffff'>%1$s</font>",actionBar.getTitle());
                        }
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                            actionBar.setTitle(Html.fromHtml(title,0));
                        } else {
                            //noinspection deprecation
                            actionBar.setTitle(Html.fromHtml(title));
                        }
                    }
                    actionBar.setDisplayHomeAsUpEnabled(true);
                }
                return;
            } catch (Exception glideException) {
                IEr_CustomerlyErrorHandler.sendError(IEr_CustomerlyErrorHandler.ERROR_CODE__GLIDE_ERROR,"Error during Glide loading in FullScreenImage_Activity",glideException);
            }
        }
    }
    this.finish();
}
项目:MyMap    文件:NavigationActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_navigation);
    ActionBar actionBar = getSupportActionBar();
    if(actionBar!=null)actionBar.hide();
    EventBus.getDefault().register(this);
    initView();
    mapview.onCreate(savedInstanceState);// 此方法必须重写
    initMap();
    int screenWidth = getWindowManager().getDefaultDisplay().getWidth(); // 屏幕宽(像素,如:480px)
    int screenHeight = getWindowManager().getDefaultDisplay().getHeight(); // 屏幕高(像素,如:800p)
    Log.d(TAG,"onCreate: "+screenWidth+"  "+screenHeight);
}
项目:dhbw-timetable-android    文件:DayDetailsActivity.java   
private void setupActionBar() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        // Show the Up button in the action bar.
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
项目:dhbw-timetable-android    文件:CourseDetailsActivity.java   
private void setupActionBar() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        // Show the Up button in the action bar.
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
项目:aos-Video    文件:BrowserCategoryVideo.java   
@Override
public void onActivityCreated(Bundle bundle) {
    super.onActivityCreated(bundle);
    if (bundle!=null) {
        int navigationMode = bundle.getInt(KEY_ACTIONBAR_NAVIGATION_MODE,ActionBar.NAVIGATION_MODE_STANDARD);
        if (navigationMode==ActionBar.NAVIGATION_MODE_LIST) {
            setupMovieActionBarNavigation(false); // false because the corresponding fragment is already re-created by the framework after rotation
        } else {
            setNavigationMode(navigationMode);
        }
    }
}
项目:wzyx-android-user    文件:SplashActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    //隐藏actionBar
    ActionBar actionBar = getSupportActionBar();
    if(actionBar != null){
        actionBar.hide();
    }
    //检查定位权限
    startLocateWithCheck();
    //2秒后跳转到登陆界面
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {

            //检查用户是否已登录
            AccountManager.checkAccount(new IUserChecker() {
                @Override
                public void onSignIn() {
                    //已经登录过
                    ActivityUtils.startActivity(SplashActivity.this,MainActivity.class);
                    SplashActivity.this.finish();
                }
                @Override
                public void onNotSignIn() {
                    //还未登录过
                    ActivityUtils.startActivity(SplashActivity.this,LoginActivity.class);
                    SplashActivity.this.finish();
                }
            });
        }
    },2000);
}
项目:ZeroKit-Android-SDK    文件:MainActivity.java   
private void whoAmI() {
    zerokit.whoAmI().enqueue(new Action<String>() {
        @Override
        public void call(String userId) {
            MainActivity.this.userId = userId;
            ActionBar supportActionBar = MainActivity.this.getSupportActionBar();
            if (supportActionBar != null) supportActionBar.setSubtitle("User Id: " + userId);
        }
    });
}
项目:rx-twitter-stream-android    文件:StreamActivity.java   
private void handleMenuSearch() {
    ActionBar supportActionBar = getSupportActionBar();

    if (isSearchOpened) {
        disableSearch(supportActionBar);
    } else {

        supportActionBar.setDisplayShowCustomEnabled(true);
        supportActionBar.setCustomView(R.layout.search_bar);
        supportActionBar.setDisplayShowTitleEnabled(false);

        termsSearch = (EditText) supportActionBar.getCustomView().findViewById(R.id.terms_search);

        termsSearch.setOnEditorActionListener((view,id,event) -> {
            if (id == EditorInfo.IME_ACTION_SEARCH) {
                doSearch(termsSearch.getText().toString());
                disableSearch(supportActionBar);
                return true;
            }
            return false;
        });

        termsSearch.requestFocus();

        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);

        mSearchAction.setIcon(getResources().getDrawable(R.mipmap.ic_clear_white_24dp,null));

        isSearchOpened = true;
    }
}
项目:OSchina_resources_android    文件:BackActivity.java   
@Override
protected void initWindow() {
    super.initWindow();
    mToolBar = (Toolbar) findViewById(R.id.toolbar);
    if (mToolBar != null) {
        setSupportActionBar(mToolBar);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setHomeButtonEnabled(false);
        }
    }
}
项目:Khonsu    文件:LaunchingFragment.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }

    CraftARSDK.Instance().init(getActivity().getApplicationContext());
    //Initialize the Collection Manager
    mCollectionManager = CraftAROnDeviceCollectionManager.Instance();

    //Initialize the Offline IR Module
    mCraftAROnDeviceIR = CraftAROnDeviceIR.Instance();

    //Obtain the collection with token.
    //This will lookup for the collection in the internal storage,and return the collection if it's available.
    CraftAROnDeviceCollection col =  mCollectionManager.get(COLLECTION_TOKEN);

    if(col == null){
        //Collection is not available. Add it from the CraftAR using collection bundle.
        mCollectionManager.addCollection("stickers.zip",this);
    }else{
        //Collection is already available in the device.
        col.sync(this);
    }
}
项目:tumbviewer    文件:LikesActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_likes);
    Toolbar toolbar = findViewById(R.id.toolBar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();

    Bundle bundle = getIntent().getBundleExtra("bundle");
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        if (bundle == null) {
            actionBar.setTitle(getString(R.string.page_user_like));
        } else {
            actionBar.setTitle(getString(R.string.likes_title,bundle.getString("blog_name")));
        }
    }
    CollapsingToolbarLayout collapsingToolbarLayout = findViewById(R.id.collapsingToolbar);
    collapsingToolbarLayout.setTitleEnabled(false);

    LikesFragment likesFragment = new LikesFragment();
    likesFragment.setArguments(bundle);

    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.add(R.id.fragment_container,likesFragment);
    ft.commit();

    setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
项目:CoolCloud-Weather    文件:AboutApplicationActivity.java   
@Override
public void initView() {

    setContentView(R.layout.activity_about_application);

    Toolbar toolbar = (Toolbar)findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null){
        actionBar.setTitle("关于酷云");
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    github = (Button)findViewById(R.id.github);
    blog = (Button)findViewById(R.id.blog);
}
项目:crates-io-android    文件:LoginActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowHomeEnabled(true);

    apiToken = findViewById(R.id.api_token);
    confirmButton = findViewById(R.id.confirm_button);

    confirmButton.setOnClickListener(view -> {
        Thread thread = new Thread() {
            @Override
            public void run() {
                try {
                    Utility.saveData("token",apiToken.getText().toString().trim());
                    User user = Networking.getMe(apiToken.getText().toString().trim());
                    if (user != null) {
                       apiToken.post(() -> finish());
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        };
        thread.start();
    });
}
项目:android_ui    文件:PagerActivity.java   
@Override
@SuppressWarnings("ConstantConditions")
protected void onCreate(@Nullable Bundle savedInstanceState) {
    requestFeature(FEATURE_TOOLBAR);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_pager);
    this.mViewPager = findViewById(R.id.pager);
    mViewPager.setAdapter(new PagesAdapter(getSupportFragmentManager()));
    final ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeAsUpIndicator(ResourceUtils.getVectorDrawable(getResources(),R.drawable.samples_vc_arrow_back_24dp,getTheme()));
}
项目:ChatExchange-old    文件:ActionBarHue.java   
public static void setActionBarColor(AppCompatActivity activity,int mAppBarColor)
{
    if (mSharedPreferences == null)
    {
        mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(activity);
    }

    if (activity != null)
    {
        ActionBar actionBar = activity.getSupportActionBar();

        if (actionBar != null)
        {
            actionBar.setBackgroundDrawable(new ColorDrawable(mAppBarColor));

            //Change status bar color too
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
            {
                Window window = activity.getWindow();

                // clear FLAG_TRANSLUCENT_STATUS flag:
                window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

                // add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
                window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
                window.setStatusBarColor(HueUtils.darkenColor(mAppBarColor,0.7f));
            }
        }
    }
}
项目:android-geohash    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    getSupportFragmentManager().beginTransaction()
            .replace(R.id.main_container,new ConverterFragment())
            .commit();

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayHomeAsUpEnabled(true);

    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setCheckedItem(R.id.converter);
    navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem item) {
            if(item.getItemId() == R.id.converter) {
                if (!item.isChecked()) {
                    getSupportFragmentManager().beginTransaction()
                            .replace(R.id.main_container,new ConverterFragment())
                            .commit();
                }
            } else {
                if(!item.isChecked()) {
                    getSupportFragmentManager().beginTransaction()
                            .replace(R.id.main_container,new MapFragment())
                            .commit();
                }
            }
            item.setChecked(true);
            drawerLayout.closeDrawers();
            return false;
        }
    });
}
项目:OzComicReader    文件:SettingsActivity.java   
/**
 * Set up the {@link android.app.ActionBar},if the API is available.
 */
private void setupActionBar() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        // Show the Up button in the action bar.
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
项目:SampleAppArch    文件:SettingsActivity.java   
/**
 * Set up the {@link android.app.ActionBar},if the API is available.
 */
private void setupActionBar() {
  ActionBar actionBar = getSupportActionBar();
  if (actionBar != null) {
    // Show the Up button in the action bar.
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


com.google.gson.internal.bind.ArrayTypeAdapter的实例源码
com.google.gson.JsonSyntaxException的实例源码
com.google.gson.JsonDeserializer的实例源码
com.google.gson.internal.ConstructorConstructor的实例源码
com.google.gson.JsonPrimitive的实例源码
com.google.gson.LongSerializationPolicy的实例源码
com.google.gson.internal.GsonInternalAccess的实例源码
com.google.gson.JsonIOException的实例源码
com.google.gson.internal.StringMap的实例源码
com.google.gson.JsonObject的实例源码
com.google.gson.internal.bind.TimeTypeAdapter的实例源码
com.google.gson.FieldAttributes的实例源码
com.google.gson.internal.bind.TreeTypeAdapter的实例源码
com.google.gson.internal.LinkedHashTreeMap的实例源码
com.google.gson.TypeAdapterFactory的实例源码
com.google.gson.JsonSerializer的实例源码
com.google.gson.FieldNamingPolicy的实例源码
com.google.gson.JsonElement的实例源码
com.google.gson.internal.JsonReaderInternalAccess的实例源码
com.google.gson.TypeAdapter的实例源码