0

Hello guys i searched a lot but i got nothing how can i replace these two icon in my action bar ? thanks a lot

i have already tried but result was not ok .

    <android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end" // here i tried change the gravity but didnt work
    android:layout_margin="@dimen/fab_margin"
    app:srcCompat="@android:drawable/ic_dialog_email" />

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

enter image description here

ADM
  • 20,406
  • 11
  • 52
  • 83
Mr Taha
  • 61
  • 9

2 Answers2

1

Try this

Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
setSupportActionBar(toolbar);
toolbar.setNavigationIcon(R.drawable.your_icon);

Drawable drawable = context.getDrawable(getApplicationContext(),R.drawable.your_overflowicon);
toolbar.setOverflowIcon(drawable);
SaravInfern
  • 3,338
  • 1
  • 20
  • 44
0

add below in AndroidManifest.xml like

<application android:supportsRtl="true">

your code looks like

  <application
        android:name=".app.AppController"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true" //here change
        android:theme="@style/AppTheme">
        <activity android:name=".LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

then

add below line of in your activity's onCreate() method

getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
Omkar
  • 3,040
  • 1
  • 22
  • 42