Search in sources :

Example 46 with Toolbar

use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.

the class ContactListSettings method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing())
        return;
    setContentView(R.layout.activity_with_toolbar_and_container);
    String title = PreferenceSummaryHelperActivity.getPreferenceTitle(getString(R.string.preference_contacts));
    Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, title);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, new ContactListSettingsFragment()).commit();
    }
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 47 with Toolbar

use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.

the class CustomNotifySettings method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_with_toolbar_and_container);
    account = EntityIntentBuilder.getAccount(getIntent());
    user = EntityIntentBuilder.getUser(getIntent());
    group = getIntent().getStringExtra(GROUP_KEY);
    phraseID = getIntent().getLongExtra(PHRASE_ID_KEY, -1);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setTitle(getTitle());
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(CustomNotifySettings.this);
        }
    });
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    if (savedInstanceState == null) {
        Key key = Key.createKey(account, user, group, phraseID);
        if (key == null)
            finish();
        getFragmentManager().beginTransaction().add(R.id.fragment_container, CustomNotifSettingsFragment.createInstance(this, key)).commit();
    }
}
Also used : View(android.view.View) Key(com.xabber.android.data.notification.custom_notification.Key) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 48 with Toolbar

use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.

the class PhraseAdder method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, getString(R.string.phrase_add), R.drawable.ic_clear_white_24dp);
    toolbar.inflateMenu(R.menu.toolbar_save);
    toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            return onOptionsItemSelected(item);
        }
    });
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
}
Also used : MenuItem(android.view.MenuItem) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 49 with Toolbar

use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.

the class PhraseEditor method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    index = getPhraseIndex(getIntent());
    if (index == null) {
        finish();
        return;
    }
    Phrase phrase = PhraseManager.getInstance().getPhrase(index);
    if (phrase == null) {
        finish();
        return;
    }
    setPhrase(phrase);
    String title = phrase.getText();
    if ("".equals(title))
        title = Application.getInstance().getString(R.string.phrase_empty);
    Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, title);
    toolbar.inflateMenu(R.menu.toolbar_delete);
    toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            return onOptionsItemSelected(item);
        }
    });
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
}
Also used : MenuItem(android.view.MenuItem) Phrase(com.xabber.android.data.message.phrase.Phrase) Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Example 50 with Toolbar

use of androidx.appcompat.widget.Toolbar in project xabber-android by redsolution.

the class PrivacySettings method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing())
        return;
    setContentView(R.layout.activity_with_toolbar_and_container);
    String title = PreferenceSummaryHelperActivity.getPreferenceTitle(getString(R.string.preference_privacy));
    Toolbar toolbar = ToolbarHelper.setUpDefaultToolbar(this, title);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, new PrivacySettingsFragment()).commit();
    }
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Aggregations

Toolbar (androidx.appcompat.widget.Toolbar)284 View (android.view.View)116 TextView (android.widget.TextView)58 RecyclerView (androidx.recyclerview.widget.RecyclerView)44 Bundle (android.os.Bundle)43 Intent (android.content.Intent)39 NonNull (androidx.annotation.NonNull)36 Fragment (androidx.fragment.app.Fragment)33 ActionBar (androidx.appcompat.app.ActionBar)29 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)29 Nullable (androidx.annotation.Nullable)28 BarPainter (com.xabber.android.ui.color.BarPainter)26 R (org.thoughtcrime.securesms.R)26 Context (android.content.Context)25 ViewGroup (android.view.ViewGroup)25 EditText (android.widget.EditText)23 MenuItem (android.view.MenuItem)21 ImageView (android.widget.ImageView)20 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)20 Navigation (androidx.navigation.Navigation)20