Browse Source

parametrize editor background drawable

pull/45/head
Thodoris1999 6 years ago
parent
commit
d51596681a
  1. 8
      app/src/main/java/gr/thmmy/mthmmy/utils/EditorView.java
  2. 3
      app/src/main/res/layout/activity_topic_quick_reply_row.xml
  3. 4
      app/src/main/res/layout/editor_view.xml

8
app/src/main/java/gr/thmmy/mthmmy/utils/EditorView.java

@ -4,7 +4,7 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
@ -65,6 +65,12 @@ public class EditorView extends LinearLayout {
a.recycle();
}
// without this, the editor gets default window background
Drawable background = getBackground();
for (int i = 0; i < getChildCount(); i++) {
getChildAt(i).setBackground(background);
}
emojiButton = findViewById(R.id.emoji_keyboard_button);
editText.setOnTouchListener((v, event) -> {

3
app/src/main/res/layout/activity_topic_quick_reply_row.xml

@ -84,7 +84,8 @@
android:id="@+id/reply_editorview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:hint="Post message"/>
android:background="@color/card_background"
card_view:hint="Post message" />
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>

4
app/src/main/res/layout/editor_view.xml

@ -8,8 +8,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:columnWidth="36dp"
android:background="@color/card_background">
app:columnWidth="36dp">
<!--bold, italic, etc buttons-->
<android.support.v7.widget.AppCompatImageButton
android:id="@+id/bold_button"
@ -121,7 +120,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/card_background"
android:paddingLeft="16dp"
android:paddingRight="16dp">

Loading…
Cancel
Save