Search in sources :

Example 46 with ActionBar

use of androidx.appcompat.app.ActionBar in project android by nextcloud.

the class UserInfoActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    Log_OC.v(TAG, "onCreate() start");
    super.onCreate(savedInstanceState);
    Bundle bundle = getIntent().getExtras();
    if (bundle == null) {
        finish();
        return;
    }
    user = bundle.getParcelable(KEY_ACCOUNT);
    if (user == null) {
        finish();
        return;
    }
    if (savedInstanceState != null && savedInstanceState.containsKey(KEY_USER_DATA)) {
        userInfo = savedInstanceState.getParcelable(KEY_USER_DATA);
    } else if (bundle.containsKey(KEY_ACCOUNT)) {
        userInfo = bundle.getParcelable(KEY_USER_DATA);
    }
    mCurrentAccountAvatarRadiusDimension = getResources().getDimension(R.dimen.user_icon_radius);
    binding = UserInfoLayoutBinding.inflate(getLayoutInflater());
    setContentView(binding.getRoot());
    setupToolbar();
    // set the back button from action bar
    ActionBar actionBar = getSupportActionBar();
    // check if is not null
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setDisplayShowHomeEnabled(true);
        ThemeToolbarUtils.tintBackButton(actionBar, this);
    }
    binding.userinfoList.setAdapter(new UserInfoAdapter(null, ThemeColorUtils.primaryColor(getAccount(), true, this)));
    if (userInfo != null) {
        populateUserInfoUi(userInfo);
    } else {
        setMultiListLoadingMessage();
        fetchAndSetData();
    }
    setHeaderImage();
}
Also used : Bundle(android.os.Bundle) ActionBar(androidx.appcompat.app.ActionBar)

Example 47 with ActionBar

use of androidx.appcompat.app.ActionBar in project ToyShark by LipiLee.

the class DetailActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_detail);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    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();
        }
    });
    final ActionBar back = getSupportActionBar();
    if (back != null) {
        back.setDisplayHomeAsUpEnabled(true);
    }
}
Also used : FloatingActionButton(com.google.android.material.floatingactionbutton.FloatingActionButton) View(android.view.View) ActionBar(androidx.appcompat.app.ActionBar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 48 with ActionBar

use of androidx.appcompat.app.ActionBar in project mapbox-plugins-android by mapbox.

the class PlacePickerActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Hide any toolbar an apps theme might automatically place in activities. Typically creating an
    // activity style would cover this issue but this seems to prevent us from getting the users
    // application colorPrimary color.
    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    setContentView(R.layout.mapbox_activity_place_picker);
    if (savedInstanceState == null) {
        accessToken = getIntent().getStringExtra(PlaceConstants.ACCESS_TOKEN);
        options = getIntent().getParcelableExtra(PlaceConstants.PLACE_OPTIONS);
        includeReverseGeocode = options.includeReverseGeocode();
    }
    // Initialize the view model.
    viewModel = ViewModelProviders.of(this).get(PlacePickerViewModel.class);
    viewModel.getResults().observe(this, this);
    bindViews();
    addBackButtonListener();
    addPlaceSelectedButton();
    customizeViews();
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this);
}
Also used : PlacePickerViewModel(com.mapbox.mapboxsdk.plugins.places.picker.viewmodel.PlacePickerViewModel) ActionBar(androidx.appcompat.app.ActionBar)

Example 49 with ActionBar

use of androidx.appcompat.app.ActionBar in project Signal-Android by signalapp.

the class ShareActivity method initializeToolbar.

private void initializeToolbar() {
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
}
Also used : ActionBar(androidx.appcompat.app.ActionBar) SearchToolbar(org.thoughtcrime.securesms.components.SearchToolbar) Toolbar(androidx.appcompat.widget.Toolbar)

Example 50 with ActionBar

use of androidx.appcompat.app.ActionBar in project syncthing-android by syncthing.

the class MainActivity method onPostCreate.

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    mDrawerToggle.syncState();
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setHomeButtonEnabled(true);
    }
}
Also used : ActionBar(androidx.appcompat.app.ActionBar)

Aggregations

ActionBar (androidx.appcompat.app.ActionBar)139 View (android.view.View)30 Toolbar (androidx.appcompat.widget.Toolbar)29 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)26 TextView (android.widget.TextView)18 Intent (android.content.Intent)11 Bundle (android.os.Bundle)11 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)8 SuppressLint (android.annotation.SuppressLint)7 AdapterView (android.widget.AdapterView)7 ImageView (android.widget.ImageView)7 Uri (android.net.Uri)6 DefaultItemDecoration (com.yanzhenjie.recyclerview.widget.DefaultItemDecoration)6 SharedPreferences (android.content.SharedPreferences)5 ListView (android.widget.ListView)5 Spinner (android.widget.Spinner)5 Typeface (com.mta.tehreer.graphics.Typeface)5 File (java.io.File)5 MenuItem (android.view.MenuItem)4 Button (android.widget.Button)4