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();
}
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);
}
}
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);
}
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);
}
}
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);
}
}
Aggregations