Browse Source

externalize editor with subject input field

pms
oogee 6 years ago
parent
commit
99b8b2c297
  1. 2
      app/src/main/AndroidManifest.xml
  2. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java
  3. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/create_topic/CreateTopicActivity.java
  4. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/create_topic/NewTopicTask.java
  5. 28
      app/src/main/res/layout/activity_create_content.xml
  6. 32
      app/src/main/res/layout/full_post_editor.xml

2
app/src/main/AndroidManifest.xml

@ -161,7 +161,7 @@
</service>
<activity
android:name=".activities.create_content.CreateContentActivity"
android:name=".activities.create_topic.CreateTopicActivity"
android:configChanges="orientation|screenSize"
android:parentActivityName=".activities.main.MainActivity"
android:theme="@style/AppTheme.NoActionBar" />

6
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java

@ -23,7 +23,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.LoginActivity;
import gr.thmmy.mthmmy.activities.create_content.CreateContentActivity;
import gr.thmmy.mthmmy.activities.create_topic.CreateTopicActivity;
import gr.thmmy.mthmmy.base.BaseActivity;
import gr.thmmy.mthmmy.model.Board;
import gr.thmmy.mthmmy.model.Bookmark;
@ -105,8 +105,8 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
newTopicFAB.setOnClickListener(view -> {
if (sessionManager.isLoggedIn()) {
if (newTopicUrl != null) {
Intent intent = new Intent(this, CreateContentActivity.class);
intent.putExtra(CreateContentActivity.EXTRA_NEW_TOPIC_URL, newTopicUrl);
Intent intent = new Intent(this, CreateTopicActivity.class);
intent.putExtra(CreateTopicActivity.EXTRA_NEW_TOPIC_URL, newTopicUrl);
startActivity(intent);
}
} else {

4
app/src/main/java/gr/thmmy/mthmmy/activities/create_content/CreateContentActivity.java → app/src/main/java/gr/thmmy/mthmmy/activities/create_topic/CreateTopicActivity.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.activities.create_content;
package gr.thmmy.mthmmy.activities.create_topic;
import android.content.Intent;
import android.content.SharedPreferences;
@ -21,7 +21,7 @@ import gr.thmmy.mthmmy.session.SessionManager;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import timber.log.Timber;
public class CreateContentActivity extends BaseActivity implements NewTopicTask.NewTopicTaskCallbacks {
public class CreateTopicActivity extends BaseActivity implements NewTopicTask.NewTopicTaskCallbacks {
public final static String EXTRA_NEW_TOPIC_URL = "new-topic-extra";

2
app/src/main/java/gr/thmmy/mthmmy/activities/create_content/NewTopicTask.java → app/src/main/java/gr/thmmy/mthmmy/activities/create_topic/NewTopicTask.java

@ -1,4 +1,4 @@
package gr.thmmy.mthmmy.activities.create_content;
package gr.thmmy.mthmmy.activities.create_topic;
import android.os.AsyncTask;

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

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".activities.create_content.CreateContentActivity"
tools:context=".activities.create_topic.CreateTopicActivity"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true">
@ -29,31 +29,11 @@
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/subject_input"
android:layout_width="240dp"
android:layout_height="wrap_content"
<include
layout="@layout/full_post_editor"
android:layout_below="@id/appbar"
android:layout_margin="16dp"
android:hint="@string/subject">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lines="1"
android:maxLines="1"
android:ellipsize="end"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
<gr.thmmy.mthmmy.editorview.EditorView
android:id="@+id/main_content_editorview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/subject_input"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:hint="topic message"/>
android:layout_width="match_parent"/>
<gr.thmmy.mthmmy.editorview.EmojiKeyboard
android:id="@+id/emoji_keyboard"

32
app/src/main/res/layout/full_post_editor.xml

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/subject_input"
android:layout_width="240dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:hint="@string/subject">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lines="1"
android:maxLines="1"
android:ellipsize="end"
android:inputType="text"/>
</com.google.android.material.textfield.TextInputLayout>
<gr.thmmy.mthmmy.editorview.EditorView
android:id="@+id/main_content_editorview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:hint="topic message"/>
</LinearLayout>
Loading…
Cancel
Save