Browse Source

toolbar fix

pull/51/head
Thodoris1999 6 years ago
parent
commit
5ad072e417
  1. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/create_content/CreateContentActivity.java
  2. 8
      app/src/main/res/layout/activity_create_content.xml

8
app/src/main/java/gr/thmmy/mthmmy/activities/create_content/CreateContentActivity.java

@ -5,11 +5,8 @@ import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.design.widget.TextInputLayout; import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View; import android.view.View;
import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputConnection;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
@ -21,7 +18,7 @@ import gr.thmmy.mthmmy.session.SessionManager;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar; import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import timber.log.Timber; import timber.log.Timber;
public class CreateContentActivity extends AppCompatActivity implements EmojiKeyboard.EmojiKeyboardOwner, public class CreateContentActivity extends BaseActivity implements EmojiKeyboard.EmojiKeyboardOwner,
NewTopicTask.NewTopicTaskCallbacks { NewTopicTask.NewTopicTaskCallbacks {
public final static String EXTRA_NEW_TOPIC_URL = "new-topic-extra"; public final static String EXTRA_NEW_TOPIC_URL = "new-topic-extra";
@ -37,14 +34,13 @@ public class CreateContentActivity extends AppCompatActivity implements EmojiKey
setContentView(R.layout.activity_create_content); setContentView(R.layout.activity_create_content);
//Initialize toolbar //Initialize toolbar
Toolbar toolbar = findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("Create topic"); toolbar.setTitle("Create topic");
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
} }
((TextView) findViewById(R.id.toolbar_title)).setText(R.string.create_topic);
progressBar = findViewById(R.id.progressBar); progressBar = findViewById(R.id.progressBar);

8
app/src/main/res/layout/activity_create_content.xml

@ -24,14 +24,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
app:contentInsetStartWithNavigation="0dp" android:gravity="center"
app:popupTheme="@style/ToolbarTheme"> app:popupTheme="@style/ToolbarTheme">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white" />
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>

Loading…
Cancel
Save