Search in sources :

Example 66 with Toolbar

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

the class AboutActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(AboutActivity.this);
        }
    });
    findViewById(R.id.about_github).setOnClickListener(this);
    findViewById(R.id.about_twitter).setOnClickListener(this);
    findViewById(R.id.about_redsolution).setOnClickListener(this);
    findViewById(R.id.about_text_xmpp_protocol).setOnClickListener(this);
    ((TextView) findViewById(R.id.about_text_developers)).setMovementMethod(LinkMovementMethod.getInstance());
    ((TextView) findViewById(R.id.about_text_translators)).setMovementMethod(LinkMovementMethod.getInstance());
    ((TextView) findViewById(R.id.about_text_license)).setMovementMethod(LinkMovementMethod.getInstance());
    CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    collapsingToolbar.setTitle(getString(R.string.application_title_short));
    ((TextView) findViewById(R.id.about_version)).setText(Application.getInstance().getVersionName());
    loadBackdrop();
}
Also used : CollapsingToolbarLayout(com.google.android.material.appbar.CollapsingToolbarLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Toolbar(androidx.appcompat.widget.Toolbar)

Example 67 with Toolbar

use of androidx.appcompat.widget.Toolbar in project Signal-Android by WhisperSystems.

the class ManagePendingAndRequestingMembersActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState, boolean ready) {
    super.onCreate(savedInstanceState, ready);
    setContentView(R.layout.group_pending_and_requesting_member_activity);
    if (savedInstanceState == null) {
        GroupId.V2 groupId = GroupId.parseOrThrow(getIntent().getStringExtra(GROUP_ID)).requireV2();
        ViewPager2 viewPager = findViewById(R.id.pending_and_requesting_pager);
        TabLayout tabLayout = findViewById(R.id.pending_and_requesting_tabs);
        viewPager.setAdapter(new ViewPagerAdapter(this, groupId));
        new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> {
            switch(position) {
                case 0:
                    tab.setText(R.string.PendingMembersActivity_requests);
                    break;
                case 1:
                    tab.setText(R.string.PendingMembersActivity_invites);
                    break;
                default:
                    throw new AssertionError();
            }
        }).attach();
    }
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    requireSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Also used : ViewPager2(androidx.viewpager2.widget.ViewPager2) Context(android.content.Context) Bundle(android.os.Bundle) TabLayout(com.google.android.material.tabs.TabLayout) PendingMemberInvitesFragment(org.thoughtcrime.securesms.groups.ui.invitesandrequests.invited.PendingMemberInvitesFragment) NonNull(androidx.annotation.NonNull) Intent(android.content.Intent) ViewPager2(androidx.viewpager2.widget.ViewPager2) RequestingMembersFragment(org.thoughtcrime.securesms.groups.ui.invitesandrequests.requesting.RequestingMembersFragment) R(org.thoughtcrime.securesms.R) FragmentActivity(androidx.fragment.app.FragmentActivity) FragmentStateAdapter(androidx.viewpager2.adapter.FragmentStateAdapter) DynamicTheme(org.thoughtcrime.securesms.util.DynamicTheme) PassphraseRequiredActivity(org.thoughtcrime.securesms.PassphraseRequiredActivity) DynamicNoActionBarTheme(org.thoughtcrime.securesms.util.DynamicNoActionBarTheme) Fragment(androidx.fragment.app.Fragment) GroupId(org.thoughtcrime.securesms.groups.GroupId) Toolbar(androidx.appcompat.widget.Toolbar) TabLayoutMediator(com.google.android.material.tabs.TabLayoutMediator) TabLayout(com.google.android.material.tabs.TabLayout) TabLayoutMediator(com.google.android.material.tabs.TabLayoutMediator) GroupId(org.thoughtcrime.securesms.groups.GroupId) Toolbar(androidx.appcompat.widget.Toolbar)

Example 68 with Toolbar

use of androidx.appcompat.widget.Toolbar in project Signal-Android by WhisperSystems.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
    Toolbar toolbar = findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.app_name_short);
    setSupportActionBar(toolbar);
    imageEditorView = findViewById(R.id.image_editor);
    imageEditorView.setUndoRedoStackListener((undoAvailable, redoAvailable) -> {
        Log.d("ALAN", String.format("Undo/Redo available: %s, %s", undoAvailable ? "Y" : "N", redoAvailable ? "Y" : "N"));
        if (menu == null)
            return;
        MenuItem undo = menu.findItem(R.id.action_undo);
        MenuItem redo = menu.findItem(R.id.action_redo);
        if (undo != null)
            undo.setVisible(undoAvailable);
        if (redo != null)
            redo.setVisible(redoAvailable);
    });
    EditorModel model = null;
    if (savedInstanceState != null) {
        model = savedInstanceState.getParcelable("MODEL");
        Log.d("ALAN", "Restoring instance " + (model != null ? model.hashCode() : 0));
    }
    if (model == null) {
        model = initialModel();
        Log.d("ALAN", "New instance created " + model.hashCode());
    }
    imageEditorView.setModel(model);
    imageEditorView.setTapListener(new ImageEditorView.TapListener() {

        @Override
        public void onEntityDown(@Nullable EditorElement editorElement) {
            Log.d("ALAN", "Entity down " + editorElement);
        }

        @Override
        public void onEntitySingleTap(@Nullable EditorElement editorElement) {
            Log.d("ALAN", "Entity single tapped " + editorElement);
        }

        @Override
        public void onEntityDoubleTap(@NonNull EditorElement editorElement) {
            Log.d("ALAN", "Entity double tapped " + editorElement);
            if (editorElement.getRenderer() instanceof MultiLineTextRenderer) {
                imageEditorView.startTextEditing(editorElement);
            } else {
                imageEditorView.deleteElement(editorElement);
            }
        }
    });
}
Also used : EditorModel(org.signal.imageeditor.core.model.EditorModel) MultiLineTextRenderer(org.signal.imageeditor.core.renderers.MultiLineTextRenderer) EditorElement(org.signal.imageeditor.core.model.EditorElement) MenuItem(android.view.MenuItem) ImageEditorView(org.signal.imageeditor.core.ImageEditorView) Toolbar(androidx.appcompat.widget.Toolbar)

Example 69 with Toolbar

use of androidx.appcompat.widget.Toolbar in project CircleIndicator by ongakuer.

the class SampleActivity method initToolbar.

private void initToolbar() {
    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    toolbar.setNavigationOnClickListener(v -> onBackPressed());
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar)

Example 70 with Toolbar

use of androidx.appcompat.widget.Toolbar in project RxBinding by JakeWharton.

the class RxToolbarTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    toolbar = new Toolbar(this);
    toolbar.setNavigationContentDescription(NAVIGATION_CONTENT_DESCRIPTION);
    toolbar.setNavigationIcon(android.R.drawable.sym_def_app_icon);
    setContentView(toolbar);
}
Also used : Toolbar(androidx.appcompat.widget.Toolbar)

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