@ -50,13 +50,15 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
//Initialize toolbar
//Initialize toolbar
toolbar = findViewById ( R . id . toolbar ) ;
toolbar = findViewById ( R . id . toolbar ) ;
toolbar . setTitle ( "Create topic " ) ;
toolbar . setTitle ( "Create PM " ) ;
setSupportActionBar ( toolbar ) ;
setSupportActionBar ( toolbar ) ;
if ( getSupportActionBar ( ) ! = null ) {
if ( getSupportActionBar ( ) ! = null ) {
getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ;
getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ;
getSupportActionBar ( ) . setDisplayShowHomeEnabled ( true ) ;
getSupportActionBar ( ) . setDisplayShowHomeEnabled ( true ) ;
}
}
createDrawer ( ) ;
progressBar = findViewById ( R . id . progressBar ) ;
progressBar = findViewById ( R . id . progressBar ) ;
emojiKeyboard = findViewById ( R . id . emoji_keyboard ) ;
emojiKeyboard = findViewById ( R . id . emoji_keyboard ) ;
@ -69,10 +71,6 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
contentEditor . setEmojiKeyboard ( emojiKeyboard ) ;
contentEditor . setEmojiKeyboard ( emojiKeyboard ) ;
emojiKeyboard . registerEmojiInputField ( contentEditor ) ;
emojiKeyboard . registerEmojiInputField ( contentEditor ) ;
contentEditor . setOnSubmitListener ( v - > {
contentEditor . setOnSubmitListener ( v - > {
if ( TextUtils . isEmpty ( subjectInput . getEditText ( ) . getText ( ) ) ) {
subjectInput . setError ( "Required" ) ;
return ;
}
if ( TextUtils . isEmpty ( contentEditor . getText ( ) ) ) {
if ( TextUtils . isEmpty ( contentEditor . getText ( ) ) ) {
contentEditor . setError ( "Required" ) ;
contentEditor . setError ( "Required" ) ;
return ;
return ;
@ -97,11 +95,14 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
@Override
@Override
public void onBackPressed ( ) {
public void onBackPressed ( ) {
if ( emojiKeyboard . getVisibility ( ) = = View . VISIBLE ) {
if ( drawer . isDrawerOpen ( ) ) {
drawer . closeDrawer ( ) ;
return ;
} else if ( emojiKeyboard . getVisibility ( ) = = View . VISIBLE ) {
emojiKeyboard . setVisibility ( View . GONE ) ;
emojiKeyboard . setVisibility ( View . GONE ) ;
} else {
return ;
super . onBackPressed ( ) ;
}
}
super . onBackPressed ( ) ;
}
}